Modify ↓
Ticket #7204 (closed defect: duplicate)
Opened 4 years ago
Last modified 3 years ago
Config loader should die on error
| Reported by: | nkantrowitz | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | general | Version: | 0.12dev |
| Severity: | normal | Keywords: | |
| Cc: | nkantrowitz | ||
| Release Notes: | |||
| API Changes: | |||
Description
Configuration.parse_if_needed should die if self.parser.read(self.filename) returns [] as this indicates it wasn't able to read the file. This generally happens either if a permission error prevents trac.ini from being read, or if the path to a parent config is invalid. A more helpful error message is desirable in either case.
Attachments
Change History
comment:1 Changed 4 years ago by Kamil Kisiel <kamil@…>
comment:2 Changed 3 years ago by osimons
- Milestone 0.13 deleted
- Resolution set to duplicate
- Status changed from new to closed
Closing this as a duplicate of the issue (and discussion) in #5535.
Note: See
TracTickets for help on using
tickets.



We discovered this as a result of me attempting to configure Trac under FastCGI. Instead of an error related to being unable to read the trac.ini I got this:
{{{Traceback (most recent call last):
TracError: The user apache requires read _and_ write permission to the database file /var/lib/trac/db/trac.db and the directory it is located in.
}}}
The confusing part about it was that it was attempting to use an sqlite database, whereas my DB is PostgreSQL. Trac should have died earlier in the process when it could not read the config file, instead of continuing and attempting to load the defaults.