Opened 5 years ago

Closed 5 years ago

# "Trac Admins" setting in web view causes internal server error on POST

Reported by: Owned by: ejucovy k0s normal TracLegosScript major 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:

1. Start traclegos web frontend
2. Visit /create-project
3. Fill out all necessary fields
5. 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
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__
File "/usr/lib/python2.5/subprocess.py", line 1153, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory


### comment:1 follow-up: ↓ 2 Changed 5 years ago by ejucovy

It looks like the trac-admin permission add call might be happening too early -- before the project is actually created?

### comment:2 in reply to: ↑ 1 Changed 5 years ago by k0s

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.close()

# TODO: favicons from logo or alternate url

# (and redirect to the admin panel?)
# XXX hack for now


### comment:3 follow-up: ↓ 4 Changed 5 years ago by 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 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 in reply to: ↑ 3 Changed 5 years ago by ejucovy

• Resolution set to invalid
• Status changed from new to closed

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.

Aha, thanks for the tip. The bug was in my supervisord config, the virtualenv wasn't active somehow. Working now.

### Modify Ticket

Change Properties