Edgewall Software
Modify

Opened 13 years ago

Last modified 13 years ago

#10168 new defect

trac generates error 500 in case no prermission to conf/trac.ini

Reported by: mail@… Owned by:
Priority: normal Milestone: next-major-releases
Component: general Version: 0.12.2
Severity: normal Keywords: bitesized
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Hi,

I just spend several hours trying to debug a trac problem. Which can be easily reproduced.

I got …

Trac Error

TracError: The Trac Environment needs to be upgraded.

Run "trac-admin /srv/trac upgrade"

Then I realized that by changing the owner of the config file conf/trac.ini it got to work.

To reproduce this do:

root@Apollon:/srv/trac # chown root conf/trac.ini
root@Apollon:/srv/trac # ll conf/trac.ini
-rw------- 1 root apache 6,8K  5. Mai 18:18 conf/trac.ini
root@Apollon:/srv/trac # service httpd restart
httpd beenden:                                             [  OK  ]
httpd starten:                                             [  OK  ]

It does now not work.

root@Apollon:/srv/trac # chown apache conf/trac.ini
root@Apollon:/srv/trac # service httpd restart
httpd beenden:                                             [  OK  ]
httpd starten:                                             [  OK  ]

Now it works again.

I am using Trac 0.12.3dev-r10683.

Attachments (0)

Change History (4)

comment:1 by Remy Blank, 13 years ago

Keywords: bitesized added
Milestone: next-major-0.1X

Yes, that's not a very intuitive error message. We have another ticket for log file permissions, but none for trac.ini AFAICT.

comment:2 by Christian Boos, 13 years ago

We could also warn against running trac-admin as root? At the very least in the docs (TracEnvironment, TracAdmin), but maybe even at the comment line (e.g. printerr(_("Warning: running as root, modified files might become unreadable by others."))).

in reply to:  2 comment:3 by Remy Blank, 13 years ago

Replying to cboos:

We could also warn against running trac-admin as root?

Now that you mention it, that might indeed be a good idea. Funnily enough, I am running trac-admin as root regularly, and have never had an issue.

/me hides in shame

comment:4 by Christian Boos, 13 years ago

Well, yes, that warning could quickly grow annoying for advanced users. We should rather report in a more explicit way the lack of reading permissions when that happens (we do have a ticket for the trac.ini case, #10044).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.