Opened 19 years ago
Closed 19 years ago
#1831 closed defect (fixed)
Failed to initialize environment with development trunk version of Trac
Reported by: | Owned by: | Matthew Good | |
---|---|---|---|
Priority: | highest | Milestone: | 0.9 |
Component: | admin/console | Version: | devel |
Severity: | blocker | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I pulled Trac from the repository this morning (July 24, 2005 @ 10am) and I'm trying to do a fresh install. When running track-admin I get an error:
Templates directory [/usr/share/trac/templates]> Creating and Initializing Project Failed to create environment. file is encrypted or is not a database Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/trac/scripts/admin.py", line 108, in env_create self.__env = Environment(self.envname, create=True, db_str=db_str) File "/usr/lib/python2.4/site-packages/trac/env.py", line 95, in __init__ setup_participant.environment_created() File "/usr/lib/python2.4/site-packages/trac/env.py", line 322, in environment_created vals) File "/usr/lib/python2.4/site-packages/trac/db.py", line 183, in executemany sqlite.Cursor.executemany(self, sql, args or []) DatabaseError: file is encrypted or is not a database Failed to initialize environment. 1 Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/trac/scripts/admin.py", line 564, in do_initenv self.env_create(db_str) File "/usr/lib/python2.4/site-packages/trac/scripts/admin.py", line 114, in env_create sys.exit(1) SystemExit: 1
The actual line that is dying is (env.py:320):
class EnvironmentSetup(Component): implements(IEnvironmentSetupParticipant) # IEnvironmentSetupParticipant methods def environment_created(self): """Insert default data into the database.""" db = self.env.get_db_cnx() cursor = db.cursor() for table, cols, vals in db_default.data: cursor.executemany("INSERT INTO %s (%s) VALUES (%s)" % (table, ','.join(cols), ','.join(['%s' for c in cols])), vals) db.commit()
Now, if I start up SQLite and try to execute:
INSERT INTO component (name,owner) VALUES ('foo','bar');
by hand it seems to work fine.
My config is:
Attachments (0)
Change History (4)
comment:1 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 19 years ago
Sorry about stealing your ticket Matthew, but I found this problem earlier today but never got around committing it. [2025] fixes a but that would initialize new databases using pysqlite1 if both pysqlite1 & 2 are installed. Please close this ticket if the fix solved the problem.
comment:3 by , 19 years ago
I got the latest from svn (July 24, 2005 @ 5:30pm) and this issue seems fixed for me. There are other issues though. Adding defects for those now.
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Yes, [2025] seems to have fixed this problem.
Ok, I can replicate the issue. Pysqlite2 is not yet fully supported, so you should use 1.0 or 1.1 for now (it will be easier to upgrade from 1.1 to 2 since they both use sqlite3).
Normally the error file is encrypted or is not a database indicates that you're trying to access the DB using the wrong sqlite version so it doesn't understand the file format. Here that shouldn't be the case since it's creating a new database.
I'll look into this.