was fixed trunk.
self.driver = drivers.get('pg8000')
should be
self.driver = self.drivers.get('pg8000')
On Saturday, 19 May 2012 17:37:54 UTC-5, weheh wrote:
>
> We just migrated a web2py app to a new server running ubuntu 11.10 LTS. We
> are running with ngingx. We are supposed to have psycopg2 installed. Yet,
> the app that used to work with postgres is now complaining that it can't
> connect. Here's the ticket:
>
> Traceback (most recent call last):
> File "/home/www-data/web2py/gluon/restricted.py", line 205, in restricted
> exec ccode in environment
> File "/home/www-data/web2py/applications/myapp/models/0_db.py", line 25,
> in <module>
> db = DAL('postgres://foobar:[email protected]:5432/foobar',
> pool_size=20)
> File "/home/www-data/web2py/gluon/dal.py", line 5968, in __init__
> raise RuntimeError, "Failure to connect, tried %d times:\n%s" %
> (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
> File "/home/www-data/web2py/gluon/dal.py", line 5955, in __init__
> self._adapter = ADAPTERS[self._dbname](*args)
> File "/home/www-data/web2py/gluon/dal.py", line 1999, in __init__
> self.driver = drivers.get('pg8000')
> AttributeError: 'list' object has no attribute 'get'
>
> I've tried various things, including changing the DAL connector:
>
> db = DAL('postgres://foobar ...')
> db = DAL('postgres:psycopg2://foobar ...')
> db = DAL('postgres:pg8000://foobar ...')
>
> but they all fail to connect.
>
> I know this has been reported in other threads, such as
> http://www.web2py.com/examples/static/epydoc/web2py.gluon.dal-pysrc.html,
> but I'm unable to get a connection to work. Any help is much appreciated.
> Thanks.
>
>