here is the full traceback, just in case:

Version
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.

Traceback (most recent call last):
  File "/home/vladtseytkin/web2py/gluon/restricted.py", line 219, in restricted
    exec(ccode, environment)
  File "/home/vladtseytkin/web2py/applications/test/controllers/default.py" 
<https://www.ladore.me/admin/edit/test/controllers/default.py>, line 72, in 
<module>
  File "/home/vladtseytkin/web2py/gluon/globals.py", line 421, in <lambda>
    self._caller = lambda f: f()
  File "/home/vladtseytkin/web2py/applications/test/controllers/default.py" 
<https://www.ladore.me/admin/edit/test/controllers/default.py>, line 19, in 
index
    check_reserved=['all'])
  File "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/base.py", line 171, 
in __call__
    obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/base.py", line 477, 
in __init__
    "Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/base.py", line 457, 
in __init__
    self._adapter = adapter(**kwargs)
  File 
"/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
27, in __call__
    return AdapterMeta.__call__(cls, *args, **kwargs)
  File 
"/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 
39, in __call__
    obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File 
"/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
54, in __init__
    driver_args, adapter_args, do_connect, after_connection)
  File "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 369, in __init__
    super(SQLAdapter, self).__init__(*args, **kwargs)
  File "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 53, in __init__
    self.reconnect()
  File "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/helpers/classes.py", 
line 181, in _reconnect_and_configure
    self._connection_reconnect()
  File "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/connection.py", line 
174, in reconnect
    self.connection = self.connector()
  File 
"/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
118, in connector
    return self.driver.connect(**self.driver_args)
  File 
"/home/vladtseytkin/.local/lib/python3.7/site-packages/psycopg2/__init__.py", 
line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  password authentication failed for user 
"test"


On Sunday, June 16, 2019 at 5:47:57 PM UTC-4, Vlad wrote:
>
> I'm bringing this from another post, because I've narrowed down the 
> problem considerably, and it no longer corresponds neither to the headline 
> nor to the content of that post. 
>
> the following works fine, creating a valid connection:
>
> connection = psycopg2.connect(database="test_db", user="test", 
> password="xxxxxx", host="xxxx-994.postgres.pythonanywhere-services.com", 
> port=10994)
>
> the following fails: 
>
> db = DAL("postgres://test:xxxxxx?!@
> xxxx-994.postgres.pythonanywhere-services.com:10994/test_db",
>              pool_size=configuration.get('db.pool_size'),
>              migrate_enabled=configuration.get('db.migrate'),
>              check_reserved=['all'])
>
> <class 'RuntimeError'> Failure to connect, tried 5 times: Traceback (most 
> recent call last): File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/base.py", line 457, in 
> __init__ self._adapter = adapter(**kwargs) File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/postgres.py", 
> line 27, in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/__init__.py", 
> line 39, in __call__ obj = super(AdapterMeta, cls).__call__(*args, 
> **kwargs) File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/postgres.py", 
> line 54, in __init__ driver_args, adapter_args, do_connect, 
> after_connection) File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 369, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 53, in __init__ self.reconnect() File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/helpers/classes.py", 
> line 181, in _reconnect_and_configure self._connection_reconnect() File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/connection.py", line 
> 174, in reconnect self.connection = self.connector() File 
> "/home/vladtseytkin/web2py/gluon/packages/dal/pydal/adapters/postgres.py", 
> line 118, in connector return self.driver.connect(**self.driver_args) File 
> "/home/vladtseytkin/.local/lib/python3.7/site-packages/psycopg2/__init__.py", 
> line 126, in connect conn = _connect(dsn, 
> connection_factory=connection_factory, **kwasync) 
> psycopg2.OperationalError: FATAL: password authentication failed for user 
> "test"
>
> The password is correct. It can't possibly fail. Besides the password 
> working in the db itself, t's the same very password that also works in 
> psycopg2.connect() call above. 
>
> How can I debug it further? What am I missing? What could be the reason?
>
> I am getting exactly same problem (working for psycopg2.connect and not 
> working for DAL constructor with exactly same error) when 1) doing it from 
> web2py under PythonAnywhere and 2) web2py under my local windows PC (when 
> local, running the ssh tunnel, as prescribed elsewhere). 
>
> Please help! 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9b75e8a3-489e-441b-9377-52aff3864adc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to