Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#1831 closed defect (fixed)

Failed to initialize environment with development trunk version of Trac

Reported by: rancor@… 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:

  • Linux vidserv 2.6.12-gentoo-r2 #1 Sat Jul 2 22:45:07 EDT 2005 i686 AMD Athlon(tm) XP 3000+ AuthenticAMD GNU/Linux
  • Python 2.4.1
  • SQLite 3.2.2 (I also have 2.8.16 installed on the same machine)
  • svn, version 1.2.1 (r15230)
  • pysqlite 2.0.2

Attachments (0)

Change History (4)

comment:1 by Matthew Good, 19 years ago

Owner: changed from daniel to Matthew Good
Status: newassigned

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.

comment:2 by Jonas Borgström, 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 rancor@…, 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 Matthew Good, 19 years ago

Resolution: fixed
Status: assignedclosed

Yes, [2025] seems to have fixed this problem.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matthew Good.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Matthew Good to the specified user.

Add Comment


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