Open ghost opened 1 month ago
Hi @andres-chavez-bi, We'll need to investigate more on why there was an exception (reason behind kill). I did spend some time to figure out but didn't find any reason. We could of course add a check to avoid killing of pgAdmin. Regarding the Crypt Key Missing - The reason it is asking because when a user logs in, the users password is used as the crypt key and is stored in-memory. But when the pgAdmin process got killed, the in-memory data is lot along with user logged in session. The user has to log in again to start a new user session. This can be avoided by simply fixing the process killing root cause which will be taken care before next release.
Thanks.
Please note that security bugs or issues should be reported to security@pgadmin.org.
Describe the bug
Whenever a query is consuming resources, it produces an error that makes pgadmin container restart and give an SIGKILL before doing so:
This is for the Crypt Key Missing part:
The pod then is restarted immediately and the user receives an error informing "Crypt Key Missing", because the pgadmin pod doesn't handle the SIGKILL gracefully and doesn't show the master password prompt again.
And the pod is restarted so fast, that pgadmin still shows the query editor, but you have to refresh the whole thing (F5) to make it work again. There's no autorefresh or any disconnection.
To Reproduce
Access a database through the pgadmin container and timeout it. We are trying to query a 90M row query and have 6Gb limit on the pod and 600m core. The query is very bad, yes:
SELECT * from schema.table;
but we're trying to reproduce the error that some users have reporterd recently from different dbs and clusters.Expected behavior
I understand that calculating if a query is going to timeout is extremely complicated (if not impossible) so I would suggest either showing another error (such as query timeout or some other) instead of SIGKILL and killing the app. Because then the container would be killled, then reloaded. Plus the password prompt is not shown once is restarted, it shows the Crypt missing error but you have to manually refresh the tool.
If there is a setting we can use to handle this from a pgadmin perspective, please advise on how to do this (how timeouts are handled or wait time), if not, maybe handling the timout somehow to at least then show a message from the system, such as "Query timed out, session disconnected" and killing the session, not the whole thing.
If you query the db directly from the db, the query takes a long time, but it's doable.
Error message
"Crypt Key is missing" from pgadmin. From the logs, I've attached the messages on the previous sections.
Screenshots
There's no OOM issue, no threshold has been surpassed.
Here's our CPU usage for the pod:
Here's the message:
Additional context
We're deploying the app with helm into Openshift, pgadmin 4 image version is REL-8_12-21-gff838e43d. Please let me know if there's more info you need.
Thank you!