Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4361 closed defect (fixed)

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

Reported by: anonymous Owned by: k0s
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 5 years ago by k0s

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

comment:2 Changed 5 years ago by anonymous

easy_install from svn source.

comment:3 Changed 5 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 5 years ago by k0s

  • Status changed from new to assigned

working on reproduction; so far no luck

comment:5 Changed 5 years ago by k0s

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 5 years ago by k0s

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

comment:7 follow-up: Changed 5 years ago by k0s

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

comment:8 in reply to: ↑ 7 Changed 5 years ago by k0s

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 5 years ago by k0s

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 5 years ago by k0s

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

comment:11 Changed 5 years ago by k0s

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:12 Changed 5 years ago by anonymous

confirmed. The plugin now works.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from k0s. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.