Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After update to 3.0: error preparing SQL queries #1942

Closed
mzurborg-scopevisio opened this issue Jul 17, 2024 · 0 comments
Closed

After update to 3.0: error preparing SQL queries #1942

mzurborg-scopevisio opened this issue Jul 17, 2024 · 0 comments

Comments

@mzurborg-scopevisio
Copy link

mzurborg-scopevisio commented Jul 17, 2024

Version:

  • listmonk: 3.0 (updating from 2.5)
  • OS: Debian 12

Description of the bug and steps to reproduce:
After updating the binary to 3.0 and running listmonk --config config.toml --upgrade which seems to successfully perform the migrations, listmonk starts successfully but only once.
http server started on 127.0.0.1:9642

Gracefully shutting listmonk down and running it again will however end up in the following error:
error preparing SQL queries: Error preparing query 'get-dashboard-charts': pq: prepared statement "1" already exists

Now it refuses to start anymore.

I've also tried reverting to a db backup and running the migrations in internal/migrations/v3.0.0.go manually, same start-up error.

Update: Forcefully closing all active db sessions via SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'listmonk' AND pid <> pg_backend_pid(); will allow listmonk to start again. But still, only once. Next start up, same error.

Most likely a db issue so I'll post db info as well:

Postgresql version: 14.12 (Debian 14.12-1.pgdg120+1)
listmonk user has grant all on listmonk db
DB runs via ssl verify-full with valid domain and cert

Update 2: OK found it out myself, db had a connection pooler in front of it which was configured in transaction mode. Listmonk only supports session mode, I changed it and now it works.

Closing ticket. Maybe people with similar problems will find this helpful info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant