Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269707 - www-apps/trac-0.11.2 needs dev-python/pypgsql
Summary: www-apps/trac-0.11.2 needs dev-python/pypgsql
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Dirkjan Ochtman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-13 14:07 UTC by Ciprian Ciubotariu
Modified: 2009-10-19 12:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ciprian Ciubotariu 2009-05-13 14:07:57 UTC
So, updated world and trac misfires with:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 367, in send_error
    'text/html')
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 688, in render_template
    data = self.populate_data(req, data)
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 596, in populate_data
    d['chrome'].update(req.chrome)
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 194, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 464, in prepare_request
    for category, name, text in contributor.get_navigation_items(req):
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 162, in get_navigation_items
    if 'TICKET_CREATE' in req.perm:
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 194, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 261, in _get_perm
    return PermissionCache(self.env, self.authenticate(req))
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 132, in authenticate
    authname = authenticator.authenticate(req)
  File "/usr/lib/python2.5/site-packages/trac/web/auth.py", line 70, in authenticate
    authname = self._get_name_for_cookie(req, req.incookie['trac_auth'])
  File "/usr/lib/python2.5/site-packages/trac/web/auth.py", line 184, in _get_name_for_cookie
    db = self.env.get_db_cnx()
  File "/usr/lib/python2.5/site-packages/trac/env.py", line 264, in get_db_cnx
    return DatabaseManager(self).get_connection()
  File "/usr/lib/python2.5/site-packages/trac/db/api.py", line 76, in get_connection
    return self._cnx_pool.get_cnx(self.timeout or None)
  File "/usr/lib/python2.5/site-packages/trac/db/pool.py", line 174, in get_cnx
    return _backend.get_cnx(self._connector, self._kwargs, timeout)
  File "/usr/lib/python2.5/site-packages/trac/db/pool.py", line 107, in get_cnx
    cnx = connector.get_connection(**kwargs)
  File "/usr/lib/python2.5/site-packages/trac/db/postgres_backend.py", line 46, in get_connection
    cnx = PostgreSQLConnection(path, user, password, host, port, params)
  File "/usr/lib/python2.5/site-packages/trac/db/postgres_backend.py", line 118, in __init__
    from pyPgSQL import PgSQL
ImportError: No module named pyPgSQL

After reading on a previous bug about trac-0.10 not needing pypgsql, since dev-python/psycopg should do enough, I decided to re-emerge pypgsql and ... well, trac started working again.

I assume that (a) after a trac upgrade from a version depending on pypgsql to one not needing it I had pypgsql depcleaned out. However, reemerging trac only with psycopg installed didn't make it function again.

My config is fastcgi trac on vhost, using www-apps/trac-0.11.2, dev-lang/python-2.5.4-r2, www-apache/mod_fcgid-2.2, www-servers/apache-2.2.11 on a hardened gentoo server.

Reproducible: Always

Steps to Reproduce:
1.Install trac using posgresql as backend (perhaps try an older version depending on pypgsql and upgrade to latest?)
2.Remove pypgsql (emerge -C or a perhaps a depclean)
3.Try use trac

Actual Results:  
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 367, in send_error
    'text/html')
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 688, in render_template
    data = self.populate_data(req, data)
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 596, in populate_data
    d['chrome'].update(req.chrome)
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 194, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 464, in prepare_request
    for category, name, text in contributor.get_navigation_items(req):
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 162, in get_navigation_items
    if 'TICKET_CREATE' in req.perm:
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 194, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 261, in _get_perm
    return PermissionCache(self.env, self.authenticate(req))
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 132, in authenticate
    authname = authenticator.authenticate(req)
  File "/usr/lib/python2.5/site-packages/trac/web/auth.py", line 70, in authenticate
    authname = self._get_name_for_cookie(req, req.incookie['trac_auth'])
  File "/usr/lib/python2.5/site-packages/trac/web/auth.py", line 184, in _get_name_for_cookie
    db = self.env.get_db_cnx()
  File "/usr/lib/python2.5/site-packages/trac/env.py", line 264, in get_db_cnx
    return DatabaseManager(self).get_connection()
  File "/usr/lib/python2.5/site-packages/trac/db/api.py", line 76, in get_connection
    return self._cnx_pool.get_cnx(self.timeout or None)
  File "/usr/lib/python2.5/site-packages/trac/db/pool.py", line 174, in get_cnx
    return _backend.get_cnx(self._connector, self._kwargs, timeout)
  File "/usr/lib/python2.5/site-packages/trac/db/pool.py", line 107, in get_cnx
    cnx = connector.get_connection(**kwargs)
  File "/usr/lib/python2.5/site-packages/trac/db/postgres_backend.py", line 46, in get_connection
    cnx = PostgreSQLConnection(path, user, password, host, port, params)
  File "/usr/lib/python2.5/site-packages/trac/db/postgres_backend.py", line 118, in __init__
    from pyPgSQL import PgSQL
ImportError: No module named pyPgSQL
Comment 1 Dirkjan Ochtman (RETIRED) gentoo-dev 2009-10-17 08:34:26 UTC
Has this happened with 0.11.5 as well? It looks like Trac is trying psycopg2 first, and only falling back to PyPgSQL if that fails.
Comment 2 Ciprian Ciubotariu 2009-10-19 11:53:18 UTC
(In reply to comment #1)
> Has this happened with 0.11.5 as well? It looks like Trac is trying psycopg2
> first, and only falling back to PyPgSQL if that fails.
> 

Indeed, I did a webapp-config -U to trac-0.11.5 and unmerged pypgsql. Trac seems to be working afterwards.
Comment 3 Dirkjan Ochtman (RETIRED) gentoo-dev 2009-10-19 12:12:38 UTC
Cool, I'll close this bug.