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

"Index Suggestions" errors when hypopg is not installed #243

Open
pgiraud opened this issue Dec 20, 2024 · 0 comments
Open

"Index Suggestions" errors when hypopg is not installed #243

pgiraud opened this issue Dec 20, 2024 · 0 comments

Comments

@pgiraud
Copy link
Member

pgiraud commented Dec 20, 2024

In the query overview, if hypopg is not installed for the given database, the "Index Suggestions" in "Predicates" tab loads indefinitely . The corresponding XHR request actually returns a 500 error:

/server/1/metrics/database/obvious/query/9191891907659356179/indexes/?from=2024-12-20%2008%3A28%3A07%2B0100&to=2024-12-20%2009%3A28%3A07%2B0100

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/tornado/web.py", line 1711, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/usr/local/src/powa-web-dev/powa/query.py", line 583, in get
    ind.name = self.execute(
  File "/usr/local/src/powa-web-dev/powa/framework.py", line 653, in execute
    raise e
  File "/usr/local/src/powa-web-dev/powa/framework.py", line 641, in execute
    cur.execute(query, params)
  File "/usr/local/src/powa-web-dev/powa/framework.py", line 64, in execute
    query = resolve_nsps(query, self.connection)
  File "/usr/local/src/powa-web-dev/powa/framework.py", line 91, in resolve_nsps
    return query.format(**connection._nsps)
KeyError: 'hypopg'

Actually the flash message cannot be displayed since it's a KeyError not a psycopg2.Error.

Steps to reproduce:

  • run the powa-dev-demo.yml podman compose file,
  • drop the extension in obvious database:
    • podman exec -it powa-dev-remote-primary bash)
    • su postgres,
    • psql -d obvious
    • DROP extension hypopg;
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