-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Removing tenant with SQLite DB fails due to the DB file being locked #16849
Comments
If you want to try resolving the issue, maybe try running the logic in ShellDbTablesRemovingHandler.RemovingAsync in a background task. specially these lines
or dispose |
I noticed that this only happens after a fresh setup. So, if you restart the app after a setup, then even if you open the tenant and disable it after that, the removal will succeed. So, I don't think a bg task would help. Somehow the setup is locking the file. |
If you run it as a background task, the task will run at the end of the request. This should be executed after the file is released. Worth trying |
The DB file remains locked even after many requests afterward. So, something is locking it across requests (but that's released and not locked again when the whole app is restarted). |
Try disabling pooling. Please try adding this code and see if this will fix the issue
more info
|
Yeah, thanks, that helps, as does |
Hmm yeah, for the same tenant/DB there are three pools:
|
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
Describe the bug
When trying to delete a tenant that uses SQLite, you'll get an error along the lines of:
Orchard Core version
2.0.1 but reproduces with 8de0e71 too.
This used to work with 1.8.x, so it's a regression
To Reproduce
TenantRemovalAllowed
is needed for this).I suppose the tenant is not actually disabled and keeps running, or at least some part of it.
Expected behavior
The tenant is removed without issues.
Logs and screenshots
2024-10-08_22h14_35.mp4
The text was updated successfully, but these errors were encountered: