Currently having a problem with my pgbouncer setup.
I am using pgbouncer with Odoo and Odoo requires connecting to postgres database for framework purposes.
Below is the log I received from pgbouncer. It said that there were no such database.
2024-01-07 19:19:38.080 UTC [1] LOG C-0x7f19b3eeb3d0: (nodb)/odoo@172.10.0.8:37798 login attempt: db=postgres user=odoo tls=no
2024-01-07 19:19:38.080 UTC [1] LOG C-0x7f19b3eeb3d0: (nodb)/odoo@172.10.0.8:37798 login failed: db=postgres user=odoo
2024-01-07 19:19:38.080 UTC [1] LOG C-0x7f19b3eeb3d0: (nodb)/odoo@172.10.0.8:37798 closing because: no such database: postgres (age=0s)
2024-01-07 19:19:38.080 UTC [1] WARNING C-0x7f19b3eeb3d0: (nodb)/odoo@172.10.0.8:37798 pooler error: no such database: postgres
While connecting to the application database had no problem.
2024-01-07 19:14:23.733 UTC [1] LOG S-0x7f19b3e76b00: mandaladb/odoo@172.17.221.210:5432 new connection to server (from 172.10.0.7:36534)
2024-01-07 19:14:23.738 UTC [1] LOG S-0x7f19b3e76b00: mandaladb/odoo@172.17.221.210:5432 SSL established: TLSv1.3/TLS_AES_256_GCM_SHA384/ECDH=prime256v1
2024-01-07 19:14:24.806 UTC [1] LOG S-0x7f19b3e76850: mandaladb/odoo@172.17.221.210:5432 new connection to server (from 172.10.0.7:48656)
2024-01-07 19:14:24.811 UTC [1] LOG S-0x7f19b3e76850: mandaladb/odoo@172.17.221.210:5432 SSL established: TLSv1.3/TLS_AES_256_GCM_SHA384/ECDH=prime256v1
I have tested connecting to my database server from my server terminal (that has pgbouncer on top) and there was no issue.
devops@id-dcvs-oddo-prod:~/clinicmandala$ psql -h fhcaredb -U odoo -d postgres
Password for user odoo:
psql (14.10 (Ubuntu 14.10-0ubuntu0.22.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
postgres=#
This is problematic, I can't access the application without successful postgres database connection.
What should I change in my setup? What should I check?
It turns out * is the way to go. If you use docker, it means do not set db_name environment variable.
And just use dbfilter configuration so user does not have to know which database to select.