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 <rostagno...@gmail.com 
> <javascript:>> 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 web2py+un...@googlegroups.com <javascript:>.
>> 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to