albertodonato / query-exporter

Export Prometheus metrics from SQL queries
GNU General Public License v3.0
436 stars 101 forks source link

failed: (psycopg2.InterfaceError) cursor already closed #193

Open nirmaljani opened 2 months ago

nirmaljani commented 2 months ago

Describe the bug we updated the query exporter config.yaml file about changes in the metrics section for some of the queries and names & labels were changed in the databases section. Post that, we are facing below errors:

failed: (psycopg2.InterfaceError) cursor already closed

2024-06-21T12:49:07.278Z | (Background on this error at: http://sqlalche.me/e/13/rvf5) 2024-06-21T12:49:07.377Z | 2024-06-21 12:49:07,377 - ERROR - query-exporter - query "qe_pg_nonidle_connections" on database "db01_pg2" failed: (psycopg2.InterfaceError) cursor already closed 2024-06-21T12:49:07.377Z | (Background on this error at: http://sqlalche.me/e/13/rvf5) 2024-06-21T12:49:07.378Z | 2024-06-21 12:49:07,378 - ERROR - query-exporter - query "qe_pg_dbsize" on database "db01_pg2" failed: (psycopg2.InterfaceError) cursor already closed 2024-06-21T12:49:07.378Z | (Background on this error at: http://sqlalche.me/e/13/rvf5) 2024-06-21T12:49:07.378Z | 2024-06-21 12:49:07,378 - ERROR - query-exporter - query "qe_pg_wals" on database "db02_pg2" failed: (psycopg2.InterfaceError) cursor already closed 2024-06-21T12:49:07.378Z | (Background on this error at: http://sqlalche.me/e/13/rvf5) 2024-06-21T12:49:07.379Z | 2024-06-21 12:49:07,378 - ERROR - query-exporter - query "qe_pg_sqlstats" on database "db02_pg2" failed: (psycopg2.InterfaceError) cursor already closed 2024-06-21T12:49:07.379Z | (Background on this error at: http://sqlalche.me/e/13/rvf5) 2024-06-21T12:49:09.677Z | 2024-06-21 12:49:09,676 - ERROR - query-exporter - query "qe_pg_sqlstats" on database "db01_pg2" failed: AlreadyQuit 2024-06-21T12:49:09.677Z | 2024-06-21 12:49:09,677 - ERROR - query-exporter - query "qe_pg_topq_by_calls" on database "db03_pg2" failed: AlreadyQuit

nirmaljani commented 2 months ago

Anyone please suggest about these errors.