Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#4361 closed defect (fixed)

Enabling plugin causes SystemError: Parent module 'repository_hook_system' not loaded

Reported by: anonymous Owned by: Jeff Hammel
Priority: high Component: RepositoryHookSystemPlugin
Severity: critical Keywords:
Cc: Trac Release: 0.11

Description

I just installed this plugin. Immediately after enabling the plugin trac dies with the following traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 367, in send_error
    'text/html')
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 687, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 663, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 410, in get_all_templates_dirs
    dirs += provider.get_templates_dirs()
  File "/usr/lib/python2.5/site-packages/RepositoryHookSystem-0.1-py2.5.egg/repository_hook_system/admin.py", line 55, in get_templates_dirs
    from pkg_resources import resource_filename
SystemError: Parent module 'repository_hook_system' not loaded}}}

Attachments (0)

Change History (12)

comment:1 Changed 15 years ago by Jeff Hammel

How is this plugin being installed? DL source + python setup.py install or direct DL of egg?

comment:2 Changed 15 years ago by anonymous

easy_install from svn source.

comment:3 Changed 15 years ago by anonymous

I tried variations on the TracPluginshttp://trac.edgewall.org/wiki/TracPlugins installation page

I just now completely uninstalled it then reinstalled it by dl zipped source and building it with "python setup.py bdist_egg" then copying the egg into my plugins dir under my trac instance. I have also done a variation on that "python setup.py install"

still the final system error is the same.

comment:4 Changed 15 years ago by Jeff Hammel

Status: newassigned

working on reproduction; so far no luck

comment:5 Changed 15 years ago by Jeff Hammel

Reproduced.

Reproduction steps:

(using virtualenv)

  • from the command line:
virtualenv trac
cd trac
. bin/activate
mkdir src
cd src 
svn co http://trac-hacks.org/svn/traclegosscript/anyrelease/ TracLegos
cd TracLegos
python setup.py develop
cd example/oss
python setup.py develop
cd -
paster serve --reload development.ini

(Note: this is boilerplate)

  • Click Create Project
  • Enter name and URL: foo, foo
  • Click next and then create project
  • restart paster (kill and then run above command again) this is necessary because the installed plugins are not loaded into python; need to work around this
trac-admin trac/src/TracLegos/projects/foo upgrade
  • refresh page
  • click register tab
  • create an account
trac-admin src/TracLegos/projects/foo permission add <username> TRAC_ADMIN
  • reload page, click admin tab
  • in src/, svn co http://trac-hacks.org/svn/repositoryhooksystemplugin/0.11/ RepositoryHookSystem
  • cd RepositoryHookSystem/
  • python setup.py install

  • restart paster/trac (again)
  • click on plugins
  • enable the RepositoryHookSystem plugin

Error Message:

Traceback (most recent call last):
  File "/home/jhammel/trac/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/api.py", line 367, in send_error
    'text/html')
  File "/home/jhammel/trac/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/chrome.py", line 687, in render_template
    template = self.load_template(filename, method=method)
  File "/home/jhammel/trac/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/chrome.py", line 663, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/home/jhammel/trac/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/chrome.py", line 410, in get_all_templates_dirs
    dirs += provider.get_templates_dirs()
  File "/home/jhammel/trac/lib/python2.5/site-packages/RepositoryHookSystem-0.1-py2.5.egg/repository_hook_system/admin.py", line 55, in get_templates_dirs
    from pkg_resources import resource_filename
SystemError: Parent module 'repository_hook_system' not loaded

(sorry for the verbosity, but wanted to give the whole procedure for posterity)

comment:6 Changed 15 years ago by Jeff Hammel

i notice that package data isn't included properly; will try to fix that and see if it helps

comment:7 Changed 15 years ago by Jeff Hammel

(In [5108]) move import of pkg_resources to top of file; refs #4361

comment:8 in reply to:  7 Changed 15 years ago by Jeff Hammel

Replying to k0s:

(In [5108]) move import of pkg_resources to top of file; refs #4361

well, now i'm even more confused. this seems to fix one issue but makes the other components disappear. will redo reproduction steps and hopefully see what's going on

comment:9 Changed 15 years ago by Jeff Hammel

i also still don't understand the root cause of this error at all; my only current suspicion is my bad handling of __init__.py, but its purely a far-fetched guess

comment:10 Changed 15 years ago by Jeff Hammel

think i fixed; trying to reproduce with above steps to make sure; still unsure what the issue was/is

comment:11 Changed 15 years ago by Jeff Hammel

Resolution: fixed
Status: assignedclosed

should be fixed now; again, not really sure where the error ultimately was

comment:12 Changed 15 years ago by anonymous

confirmed. The plugin now works.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeff Hammel.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.