Raspberry pi cannot connect to postgreSQL

45 views
Skip to first unread message

Annet

unread,
Feb 6, 2020, 6:01:34 AM2/6/20
to web2py-users
I just installed psycopg2 to connect to my PostgreSQl database
on Raspberry Pi 4. When starting web2py I get the following error
ticket:


Traceback (most recent call last):
File "/home/pi/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/home/pi/web2py/applications/init/models/00_init_db.py", line 42, in <module>
ignore_field_case = myconf.get('db.ignore_field_case'))
File "/home/pi/web2py/gluon/packages/dal/pydal/base.py", line 174, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
File "/home/pi/web2py/gluon/packages/dal/pydal/base.py", line 473, 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/pi/web2py/gluon/packages/dal/pydal/base.py", line 446, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File "/home/pi/web2py/gluon/packages/dal/pydal/adapters/base.py", line 60, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
File "/home/pi/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 155, in __init__
self.reconnect()
File "/home/pi/web2py/gluon/packages/dal/pydal/connection.py", line 104, in reconnect
self.connection = f()
File "/home/pi/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 152, in connector
return self.driver.connect(**driver_args)
File "/usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
OperationalError: FATAL: password authentication failed for user "posgres"
FATAL: password authentication failed for user "posgres"


This is the connection string:

uri       = postgres://posgres:password@localhost:5432/database_name


Kind regards,

Annet

Christian Varas

unread,
Feb 6, 2020, 8:40:56 AM2/6/20
to web...@googlegroups.com
Hi, looks like the problem is the password...
The error says:
FATAL:  password authentication failed for user "posgres

Doble check the password for the user, try to connect manually to pg to ensure you have the correct password. If password is ok, maybe is a bug or something else, I think I saw a issue like this in older mails.

Cheers.

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/c677044e-7bc0-432b-a700-0af961ebfc82%40googlegroups.com.

Massimiliano

unread,
Feb 6, 2020, 9:53:31 AM2/6/20
to web...@googlegroups.com
Are you sure the user is posgres and not postgres? :-D 

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/c677044e-7bc0-432b-a700-0af961ebfc82%40googlegroups.com.


--
Massimiliano

Annet

unread,
Feb 6, 2020, 11:28:16 AM2/6/20
to web2py-users
Thank you both for your replies.

@Massimiliano

Are you sure the user is posgres and not postgres? :-D

 
I've checked the connection string over and over again
and just did not spot the missing 't'

Thank you so much for your help!


Best,

Annet
Reply all
Reply to author
Forward
0 new messages