Another weird stuff I noticed: in my server, if I open a terminal, run
python and try to import psycopg2, I receive an error:
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/psycopg2/__init__.py", line 50,
in <module>
from psycopg2._psycopg import ( # noqa
ImportError: /usr/lib64/python2.7/site-packages/psycopg2/_psycopg.so:
undefined symbol: PQconninfo
Does it mean that psycopg2 is broken? If that's the case, how can my
application still be running? I'm pretty lost.
El miércoles, 23 de enero de 2019, 6:58:57 (UTC-3), Lisandro escribió:
>
> Thanks Massimiliano.
>
> Apparently psycopg2 is already installed (of course it was already
> installed, maybe something broke during the packages upgrade).
> Something weird is that I see psycopg2 installed twice, is this correct?
>
> ~$ pip freeze | grep psycopg2
> psycopg2==2.7.5
> psycopg2-binary==2.7.5
>
> Could this be the source of the problem?
> I don't see how. For what I understand, using or not using pgBouncer in
> the middle is transparent to the web2py application: it always connects in
> the same way, the application doesn't know if its connecting to PostgreSQL
> or pgBouncer. I think that's the whole idea of pgBouncer, to act as a
> middle man, pooling connections, behaving as if the application was
> connected directly to PostgreSQL.
>
> Any comment or suggestion will be much appreciated.
>
> El miércoles, 23 de enero de 2019, 6:51:06 (UTC-3), Massimiliano escribió:
>>
>> Have you tried to install psycopg2? Is the standard de facto postgresql
>> driver.
>> The pip package should be psycopg2-binary
>>
>> On Wed, Jan 23, 2019 at 10:39 AM Lisandro <[email protected]> wrote:
>>
>>> Hi there! Yesterday I had a MAJOR downtime and I would need your help to
>>> understand what happened.
>>>
>>> The team that is in charge of upgrading security packages at my server
>>> (CentOS 7 at Linode) did an update that involved an upgrade to pgBouncer.
>>> Accordingly to what they said, they noticed pgBouncer was throwing errors
>>> after the upgrade, so they downgraded to the previous version that was
>>> installed. But sadly the problem remained. After this upgrade/downgrade of
>>> pgBouncer, all the attempts of connecting from my web2py app to pgBouncer
>>> fail.
>>>
>>> Inside of postgresql.log I can see lot of this:
>>> 2019-01-22 14:39:37 -03 ERROR: prepared statement «pg8000_statement_0»
>>> already exists
>>> 2019-01-22 14:39:37 -03 SENTENCIA: begin transaction
>>> 2019-01-22 14:39:38 -03 ERROR: prepared statement «pg8000_statement_0»
>>> already exists
>>> 2019-01-22 14:39:38 -03 SENTENCIA: begin transaction
>>>
>>> I've noticed that "pg8000_statement_0" is referenced at line 1894 in
>>> gluon/contrib/pg8000/core.py, but I can't realise if there is something I
>>> could do to avoid the error.
>>> I'm using web2py Version 2.16.1-stable+timestamp.2017.11.14.05.54.25,
>>> and I've noticed that gluon/contrib/pg8000/core.py isn't anymore in version
>>> 2.17.1.
>>>
>>> Of course I've tried restarting al the involved services, but nothing
>>> worked. Every time my web2py application tries to connect to the database,
>>> if pgBouncer is at the middle, the 5 attempts fail and those lines are
>>> printed to the postgresql.log. Right now I've bypassed pgbouncer and my
>>> application is connecting directly to postgresql.
>>>
>>> Could you put some lights into this? What can I do to avoid that error
>>> and still connect to pgBouncer with web2py 2.16.1?
>>>
>>> Thank you very much in advance.
>>> Regards, Lisandro.
>>>
>>> --
>>> 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 [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Massimiliano
>>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.