-
Notifications
You must be signed in to change notification settings - Fork 192
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
Error in SQLA (DetachedInstanceError) (in AiiDA v1.5 and newly reported in AiiDA v2.0.1) #4596
Comments
this is caused due to the default user variable set on the This is fixed by: aiida-core/aiida/storage/psql_dos/backend.py Lines 112 to 117 in b57e1b6
(Note, you should never directly close the SQLA session of a |
Thanks @chrisjsewell ! Just to make sure I understood - this is already fixed now in develop, or not yet? Also thanks for the comment on not closing manually - but I think me "as a user" I was not doing it (I think), it was probably some part of AiiDA doing it? |
It should be yes; there is now nowhere that directly closes the sqlalchemy session, except for the actual Pre v2, it was interfacing with the session all over the place (see the diagrams in #5330), so I don't know exactly where it would have been expunged (which is what happens when it is closed) |
But yeh obviously we can re-test with aiida v2, to check for sure that this is no longer occurring |
Closing this for now. Feel free to reopen if you encounter it with v2.0 |
Unfortunately, I encounter this again when I launch > 400 quick calcjobs locally. Here is the traceback. Let me know how can I future debug it.
|
I restart the daemon and restart Postgres backend server, and seems the issue does not show up. |
I am not sure this is due to the The only thing that should help to remedy is, is to reset the daemon, as restarting the daemon workers will recreate the session and it should be in a consistent state again. Now, as for why the session gets to this state, I am not sure. There used to be a similar bug related to the Here it seems to be about the The behavior could be explained if the storage was closed and reopened during the life of a daemon worker. Because if the same Still, I think it probably has something to do with the |
@unkcpz could you please try this branch on your environment: https://github.com/sphuber/aiida-core/tree/fix/4596/db-authinfo-detached It is not relying on the |
@sphuber Sorry for the late reply, I didn't notice your message. I can not reproduce the issues, but once it appears again, I'll check out to your branch and try it. I am using this plugin this and next week, so there is a chance I may encounter the issue again. |
Thanks, I will rebase the branch so it is up to date with |
Describe the bug
Roughly half of my calculations are failing on a SQLA backend:
I'm quite sure this was a production AiiDA 1.4.2 environment where I hadn't done anything and things were working fine until a few weeks ago.
Running yesterday, maybe calculations were pased with 5 consecutive errors and the error above.
I decided to stop the deamon, reinstall AiiDA 1.5.0 and replay them, but they fail again with the same error.
Any idea of what could be causing this?
@sphuber @CasperWA @chrisjsewell
The text was updated successfully, but these errors were encountered: