Opened 15 years ago
Closed 15 years ago
#5660 closed defect (invalid)
"Trac Admins" setting in web view causes internal server error on POST
Reported by: | ejucovy | Owned by: | Jeff Hammel |
---|---|---|---|
Priority: | normal | Component: | TracLegosScript |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I am using http://trac-hacks.org/svn/traclegosscript/anyrelease at r6367, but this problem existed at least as far back as r5341.
Reproduction:
- Start traclegos web frontend
- Visit /create-project
- Fill out all necessary fields
- Add user "egj" to the "Trac Admins" form field
- Submit the form
An internal server error results.
Traceback:
File "/usr/local/arbezus/trac/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/urlmap.py", line 202, in __call__ return app(environ, start_response) File "/usr/local/arbezus/trac/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/httpexceptions.py", line 636, in __call__ return self.application(environ, start_response) File "/usr/local/arbezus/trac/src/traclegos/traclegos/web.py", line 387, in __call__ step.transition(project_data, {}) File "/usr/local/arbezus/trac/src/traclegos/traclegos/web.py", line 246, in transition subprocess.call(['trac-admin', project_dir, 'permission', 'add', admin, 'TRAC_ADMIN']) File "/usr/lib/python2.5/subprocess.py", line 444, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.5/subprocess.py", line 594, in __init__ errread, errwrite) File "/usr/lib/python2.5/subprocess.py", line 1153, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
Attachments (0)
Change History (4)
comment:1 follow-up: 2 Changed 15 years ago by
comment:2 Changed 15 years ago by
Replying to ejucovy:
It looks like the
trac-admin permission add
call might be happening too early -- before the project is actually created?
No, it is done after:
# create the project self.view.legos.create_project(project['vars']['project'], self.templates(project), project['vars'], database=project['database'], repository=project['repository']) project_dir = os.path.join(self.view.directory, project['vars']['project']) # write the logo_file to its new location logo_file = project['logo_file'] if logo_file: logo_file_name = os.path.basename(project['vars']['logo']) filename = os.path.join(project_dir, 'htdocs', logo_file_name) logo = file(filename, 'wb') logo.write(logo_file.read()) logo.close() # TODO: favicons from logo or alternate url # TODO: add authenticated user to TRAC_ADMIN of the new site # (and redirect to the admin panel?) # XXX hack for now for admin in project['admins']: subprocess.call(['trac-admin', project_dir, 'permission', 'add', admin, 'TRAC_ADMIN'])
comment:3 follow-up: 4 Changed 15 years ago by
The only way I can get this error is if trac-admin
is not on my PATH. Is this the case for you? Then I get the OSError above. If there is any other failure with subprocess.call
I get an IOError instead.
It is worth noting that (not this bug, but a good reason to avoid adding admins) is that if an account does not exist for the user specified (that is, you are using the AccountManagerPlugin, as in the oss_project
case), you will not be able to log in as the specified user. There is no entry in the .htpasswd file for the user. However, the user "exists" in the Trac database, so the user won't be able to register. Big caveat.
comment:4 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Replying to k0s:
The only way I can get this error is if
trac-admin
is not on my PATH. Is this the case for you? Then I get the OSError above. If there is any other failure withsubprocess.call
I get an IOError instead.
Aha, thanks for the tip. The bug was in my supervisord config, the virtualenv wasn't active somehow. Working now.
It looks like the
trac-admin permission add
call might be happening too early -- before the project is actually created?