Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#8765 closed defect (fixed)

trac killed after installation of the 3 plugins

Reported by: podskalsky Owned by: Roberto Longobardi
Priority: highest Component: TestManagerForTracPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

After the installation of the 3 plugins and the database update of "Test Manager" plugin the trac is broken ...

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 440, in send_error
    data, 'text/html')
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 827, in render_template
    message = req.session.pop('chrome.%s.%d' % (type_, i))
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 216, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 300, in _get_session
    return Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 192, in __init__
    if req.authname == 'anonymous':
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 216, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 159, in authenticate
    authname = authenticator.authenticate(req)
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 83, in authenticate
    authname = self._get_name_for_cookie(req, req.incookie['trac_auth'])
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/web/", line 209, in _get_name_for_cookie
    db = self.env.get_db_cnx()
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/", line 328, in get_db_cnx
    return get_read_db(self)
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/db/", line 90, in get_read_db
    return _transaction_local.db or DatabaseManager(env).get_connection()
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/db/", line 152, in get_connection
    return self._cnx_pool.get_cnx(self.timeout or None)
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/db/", line 226, in get_cnx
    return _backend.get_cnx(self._connector, self._kwargs, timeout)
  File "/usr/lib/python2.7/site-packages/Trac-0.12.2-py2.7.egg/trac/db/", line 146, in get_cnx
    raise TimeoutError(errmsg)
TimeoutError: Unable to get database connection within 0 seconds. (TracError(u'Database "/data/trac/Nexus/db/trac.db" not found.',))

Attachments (1)

TestManagerErrors.txt (7.1 KB) - added by podskalsky 6 years ago.
included Error Message and trac.ini

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by Roberto Longobardi

Hi Andreas, I see you're using Python 2.7 on your system.

Actually the plugins have only been tested with Python 2.5 and 2.6, so this may be part of the problem.

I will try to install a virtual machine with Python 2.7 as soon as possible, and see if I can reproduce your problem.

In the meantime, please try the following:

  • Verify that the file /data/trac/Nexus/db/trac.db really exists and that the user running tracd has read/write permissions on it.
  • Provide some details about your running environment:
    • Operating system version
    • Are you using Apache or tracd, which apache module for Python, with what User are you running
  • Attach your trac.ini file to this ticket so I can understand with which configuration you're running. In particular, what other plugins are you using.
  • If you can, please set the logging level to debug and to write on file, do the installation of the plugins again and attach the log file to this ticket.

Ciao, Roberto

comment:2 Changed 6 years ago by podskalsky

thanks for your quick answer.

the file /data/trac/Nexus/db/trac.db is missing on my system, I'm using PostreSQL 8.4.8 and apache with fastcgi configuration. In that directory I can only find postgres.*.bak.gz dump backup files form the trac database upgrade.

are you sure that your plugin is running well wit PostgrSQL.

the trac system is fresh installed (it's a test system on fedora 14) and that's why there are also no changes in the trac.ini

I will now install Fedora 13 with included Python 2.6 - I will send you my test results of your plugin.

comment:3 Changed 6 years ago by Roberto Longobardi

Hi Andreas, there were problems with PosgreSQL with Trac 0.11, since Trac itself did not well support the int64 data type, but I'm not aware of any problem with 0.12.

Anyway, from your trace it looks like Trac is configured to use SQLite, not PosgreSQL. In fact, trac.db is the SQLite DB file:

TimeoutError?: Unable to get database connection within 0 seconds. (TracError?(u'Database "/data/trac/Nexus/db/trac.db" not found.',))

Changed 6 years ago by podskalsky

Attachment: TestManagerErrors.txt added

included Error Message and trac.ini

comment:4 Changed 6 years ago by podskalsky

Hello Roberto,

now I've installed a new Fedora 13 (incuding Python 2.6 + PostgreSQL).

But the Error is still the same''' Loggin was enabled, bu no additional info was given.

Here is my trac.ini database configuration:

database = postgres://postgres:00000@localhost:5432/nexus?schema=nexus

Attached you can find the latest error log and my trac.ini

Regards Andy

comment:5 Changed 6 years ago by Roberto Longobardi

Hi Andreas, just FYI, during the w/e I upgraded my Ubuntu box to 11.04, which comes with Python 2.7. I tried a fresh installation of Trac 0.12.2 (using virtualenv, very useful tool, I suggest you to try it), and put the three Test Manager plugins on top of it.

With tracd it worked without any problem.

Your new updates confirm that your initial problem was not related to Python 2.7. So, let's try to understand what's going wrong.

I've looked at your trac.ini file, and it looks ok. It still puzzles me why the log file complains about not finding the SQLite database file, while you have configured PostgreSQL. I've found a similar topic in Trac's forum:

but unfortunately there's no anwer to my same question: is Trac really using PosgreSQL?

The forum's topic also shows some configuration that has been added for apache wsgi:


import os 
import trac.db.postgres_backend 
trac.db.postgres_backend.PostgreSQLConnection.poolable = False 
os.environ['TRAC_ENV'] = '/home/project-home/trac/' 
os.environ['PYTHON_EGG_CACHE'] = '/home/project-home/trac/eggs' 
import trac.web.main 
application = trac.web.main.dispatch_request 


WSGIScriptAlias /trac  /home/project-home/deploy/cgi-bin/trac.wsgi 
<Directory /home/project-home/deploy/cgi-bin> 
    WSGIApplicationGroup %{GLOBAL} 
    Order deny,allow 
    Allow from all 

And something about the trac.ini (in this case called conf.ini, since probably the problem):


database = postgres://user:pass@localhost:5432/trac-db
debug_sql = False

I have a couple of questions:

  • Can you confirm trac is using PosgreSQL (using some PosgreSQL specific tool, showing connectins, activity or so)?
  • Are you using Apache configuration or only tracd?
  • Since you also say that logging was enabled, but no additional info was given, I suspect that your trac environment is not getting the updated trac.ini file. Did you restart apache (if applicable)?
  • Just to be sure, did you install all of the three Test Manager plugins (TracGenericClass as the first, TracGenericWorkflow next and TestManager last)?

Ciao, Roberto

comment:6 Changed 6 years ago by podskalsky

Resolution: fixed
Status: newclosed

hello - problem found and fixed - thanks for your support

hints found at:

It was necessary to add read access to trac.ini for the database user (postgres).

comment:7 Changed 6 years ago by Roberto Longobardi

Cool! No problem, glad to be helpful.

Feel free to open enhancement tickets if you think of something that may be useful to add.

Ciao, Roberto

comment:9 Changed 4 years ago by Ryan J Ollos

Description: modified (diff)

Modify Ticket

as closed The owner will remain Roberto Longobardi.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.