Edgewall Software
Modify

Opened 12 years ago

Closed 9 years ago

#2993 closed defect (worksforme)

Trac totally disabled due to error after debian unstable upgrade.

Reported by: mark@… Owned by: Jonas Borgström
Priority: highest Milestone:
Component: general Version: 0.9.4
Severity: critical Keywords:
Cc: mark@…
Release Notes:
API Changes:

Description (last modified by Emmanuel Blot)

Running Debian unstable

Subversion 1.3.1-1
Trac 0.9.4-2
mod_python 3.1.3-3
python 2.3.5-5
python2.3-subversion 1.3.1-1

I get this error in my error.log when going to a trac site.

   1.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):
   2.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n    result = object(req)
   3.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/web/modpython_frontend.py", line 86, in handler\n    gateway.run(dispatch_request)
   4.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/web/wsgi.py", line 87, in run\n    response = application(self.environ, self._start_response)
   5.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 288, in dispatch_request\n    env = _open_environment(env_path, run_once=environ['wsgi.run_once'])
   6.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 54, in _open_environment\n    env_cache[env_path] = open_environment(env_path)
   7.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/env.py", line 432, in open_environment\n    if env.needs_upgrade():
   8.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/env.py", line 291, in needs_upgrade\n    if participant.environment_needs_upgrade(db):
   9.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/env.py", line 344, in environment_needs_upgrade\n    dbver = self.env.get_version(db)
  10.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/env.py", line 204, in get_version\n    cursor.execute("SELECT value FROM system WHERE name='database_version'")
  11.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 48, in execute\n    return self.cursor.execute(sql)
  12.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 39, in execute\n    args or [])
  13.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 31, in _rollback_on_error\n    return function(self, *args, **kwargs)
  14.
      [Thu Apr 06 20:23:29 2006] [error] [client 192.168.0.2] PythonHandler trac.web.modpython_frontend: Warning: You can only execute one statement at a time. 

"You can only execute one statement at a time" is also given on any attempt at using trac-admin. No matter what I do with it it always says that.

Attachments (0)

Change History (16)

comment:1 Changed 12 years ago by Christian Boos

Well, it also happened to me this afternoon, after I upgraded to pysqlite-2.2.0 … It's typically an error which happens when the pysqlite package you're using is loading a sqlite3.so library having a different version than the one against which pysqlite was built.

More specifically in my case, I did set the LD_LIBRARY_PATH to point to the sqlite-3.3.4 sqlite3.so library, but did a mistake in setting the PYTHONPATH: instead of my brand new pysqlite-2.2.0, an "old" pysqlite-2.1.3 egg (compiled against sqlite-3.2.8) was found…

Please don't forget to close this as worksforme once you solved the issue.

comment:2 Changed 12 years ago by Emmanuel Blot

Description: modified (diff)

See also #2879.

comment:3 Changed 12 years ago by anonymous

Resolution: worksforme
Status: newclosed

After some fidling with the libs I managed to get it working again. It most likely was indeed what cboos mentioned.

comment:4 Changed 12 years ago by anonymous

I didn't quite get what i should do to get trac back up and running. Little help here, please? (also using debian)

comment:5 Changed 12 years ago by Christian Boos

See #2719, in particular this comment and the next ones.

comment:6 Changed 12 years ago by anonymous

Thnx for the rapid answer cboos.

For the tecnology impaired, here's the debian way to do it.

apt-get install libsqlite3-dev
apt-get source python2.3-pysqlite2
cd python-pysqlite2-X.X.X/
python setup.py install

That solved it for me.

comment:7 Changed 12 years ago by sabre2th

As a workaround, you can also (temporarily) install the unstable version of python2.3-pysqlite2 (atm python2.3-pysqlite2_2.2.2-1_i386.deb). This seems to work for me and it's quite easy:

apt-get install python2.3-pysqlite2/unstable

comment:8 Changed 10 years ago by marcus@…

Resolution: worksforme
Status: closedreopened

One year on, and I've just run into exactly the same problem on Ubuntu 6.06, trac broken by a system update with the "more than one statement at once" error. It was all working perfectly. I have (all are current Ubuntu standard packages):

  • Trac 0.9.3
  • pysqlite 2.0.5
  • sqlite 3.2.8
  • python 2.4.2
  • mod_python 3.1.4

I only have one sqlite3.so and one _sqlite.so anywhere on the system. Are the Ubuntu packages broken?

I've tried all the approaches listed above, but no joy. Where are PYTHONPATH and LD_LIBRARY_PATH normally set? I don't have any mention of them in /etc, /usr/share/trac, apache config or my trac env. As I only have one copy of the libraries installed anywhere, I don't see that changing the paths will help.

The only .egg files I have are for setuptools, TracTags and TracAdmin.

It's not very encouraging when #2719 suggests fixing this by downgrading sqlite3 to the version I already have!

Any ideas?

comment:9 in reply to:  8 Changed 10 years ago by Christian Boos

Replying to marcus@synchromedia.co.uk:

  • Trac 0.9.3

Wow, that's pretty old and unsupported ;-) Please have a look at TracDownload for the newer stable version.

  • pysqlite 2.0.5
  • sqlite 3.2.8

Likewise, that's pretty old. Better get a newer PySqlite like 2.3.4 and rebuild it to match your installed sqlite 3.2.8 (that's an old version as well but quite robust, IIRC), by editing the setup.cfg file at the toplevel of the pysqlite package. That will most certainly make the problem go away, see comment:1.

  • python 2.4.2
  • mod_python 3.1.4

If you experience problems in that area, upgrade to 3.3.1, as 3.1.4 is known to have numerous issues.

I only have one sqlite3.so and one _sqlite.so anywhere on the system. Are the Ubuntu packages broken?

Most likely, yes.

comment:10 Changed 10 years ago by anonymous

Thanks for replying. I'm still not clear on this - in setup.py in the ubuntu python-pysqlite2-2.0.5 package source I have:

[build_ext]
define=
include_dirs=/usr/local
library_dirs=/usr/local/lib
libraries=sqlite3

It doesn't like me putting LD_LIBRARY_PATH in this file - what should it look like? I tried changing the paths mentioned to /usr rather than /usr/local as that's where stuff seemed to be, but it's still having the same problem. There are no errors when building this package.

/usr/bin/test-pysqlite reports no errors.

I've also reported this to ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-pysqlite2/+bug/148047

comment:11 Changed 10 years ago by anonymous

I've tried pretty much everything I can think of. I now have a checkout of the 0.10.x-stable branch rather than the old 0.9.3. I've changed my apache vhost to point at the new version, along with a PythonPath. I've removed and purged the original pysqlite2 and libsqlite3 packages, deleted every file relating to them anywhere on the system, rebuilt from source and reinstalled. But I'm still getting the same error, which means the diagnosis of an sqlite version mismatch must be wrong.

If I run python and say "import pysqlite2", it doesn't report any errors, and executing "pysqlite2" says:

<module 'pysqlite2' from '/usr/lib/python2.4/site-packages/pysqlite2/init.pyc'>

Does that look right?

I removed libapache2-mod-python too, but an error-free reinstall does not create a mod_python.so, and the source package has a dependency (not listed in package spec) on apache2-threaded-dev which would break PHP, so now I'm really dead.

Having had no luck on this older OS, I figured I'd try it on a new, clean server running Ubuntu 7.04. It all claimed to install perfectly, but it segfaults with a double-free in pysqlite. Sigh. I seem to be cut off from my project documentation, bug and feature tracking with no solution in sight.

comment:12 Changed 10 years ago by sid

Keywords: needinfo added

Did you ever get this working on your Ubuntu install?

comment:13 Changed 10 years ago by sdobrev

hi, FYI, we got same traceback on a 10.* trac, after fiddling with mod_php5 (!). The problem happened to be the mod_php5 got itself registered in httpd.conf instead of proper mods_enabled/ place, and this somehow screwed up mod_python….

comment:14 Changed 9 years ago by anonymous

Resolution: fixed
Status: reopenedclosed

comment:15 Changed 9 years ago by anonymous

Resolution: fixed
Status: closedreopened

comment:16 Changed 9 years ago by Christian Boos

Keywords: needinfo removed
Resolution: worksforme
Status: reopenedclosed

All of the above seem to be InstallationIssues with broken packages of PySqlite and/or interference between different sqlite shared libraries.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted.
to The owner will be changed from Jonas Borgström 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.