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

crash on missing pg_qualstats #25

Open
jw1u1 opened this issue Feb 19, 2025 · 5 comments
Open

crash on missing pg_qualstats #25

jw1u1 opened this issue Feb 19, 2025 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jw1u1
Copy link

jw1u1 commented Feb 19, 2025

powa-collector 1.3.0-1.pgdg110+1

if pg_qualstats is not installed in the primary DB, the colector crashes:

Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: Exception in thread db.server.lan:5432:
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: Traceback (most recent call last):
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: self.run()
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3/dist-packages/powa_collector/powa_worker.py", line 952, in run
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: self.__worker_main()
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3/dist-packages/powa_collector/powa_worker.py", line 506, in __worker_main
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: self.__take_snapshot()
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3/dist-packages/powa_collector/powa_worker.py", line 878, in __take_snapshot
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: errors = self.__get_global_src_data(powa_ver, ins)
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3/dist-packages/powa_collector/powa_worker.py", line 603, in __get_global_src_data
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: errors.extend(copy_remote_data_to_repo(self, kind_name, data_src,
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3/dist-packages/powa_collector/snapshot.py", line 127, in copy_remote_data_to_repo
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: data_src.execute(cleanup_sql)
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3/dist-packages/powa_collector/customconn.py", line 58, in execute
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: query = resolve_nsps(query, self.connection)
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: File "/usr/lib/python3/dist-packages/powa_collector/customconn.py", line 72, in resolve_nsps
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: return query.format(**connection._nsps)
Feb 19 16:37:57 powa-prod-bap01 powa-collector[2331522]: KeyError: 'pg_qualstats'

@rjuju
Copy link
Member

rjuju commented Feb 20, 2025

Hi,

what do you mean by primary db, the repository server? Do you have pg_qualstats enabled on any of the remote servers?

@rjuju rjuju self-assigned this Feb 20, 2025
@jw1u1
Copy link
Author

jw1u1 commented Feb 20, 2025

what do you mean by primary db, the repository server?

No, the database name parameter for powa_register_server()

@rjuju
Copy link
Member

rjuju commented Feb 20, 2025

ah I see, thanks for the clarification.

is it a configuration mismatch? ie you declared pg_qualstats when calling powa_register_server but pg_qualstats is not installed? otherwise I'm not sure what could be the problem as I frequently test remote servers without extra extensions.

@rjuju rjuju added the bug Something isn't working label Feb 20, 2025
@jw1u1
Copy link
Author

jw1u1 commented Feb 24, 2025

Yes, pg_qualstats was declaired as extension

@rjuju
Copy link
Member

rjuju commented Feb 28, 2025

ok, that explains the bug then.

you need to install on the repository server all the extensions that you use on any remote server as the snapshot code relies on it. installing it should fix that problem.

Of course clearly the collector is currently failing to check that prerequirement, I will fix it. but all that will do will be to emit a better error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants