-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Gitea interface unavailable after deleting member of Org "Owners" team #4362
Comments
Could you please post |
I already was running in
|
Change log |
Maybe #4282 can help us finding the problem. |
Some new information: Changing to The moment the error ocurrs:
It seems to rollback a transaction after 30 seconds which leaves the database in a non-functional state. After that, pretty much every request to the web interface will lead to the HTTP 500.
|
I was puzzled how a transaction that is cleanly rolled back both transactions can cause this issue and did the obvious test I missed before: Restarting the service after the error ocurred. And sure enough the server seems to come up without any errors. So the issue is "runtime only". It seems that some internal component does not handle the rolled back transaction gracefully, maybe some kind of cache corruption. The question remains of course why the Transaction timeout/rollback is ocurring in the first place. |
And another update: I talked to someone more familiar with MSSQL transaction handling than myself and it seems that the reason for this is the following: Default transaction isolation level for MSSQL is SERIALIZABLE (https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-2016).
But Gita tries to do that:
The row for "Owners" in the team table is updated and then read within the same transaction. It cannot be read due to the lock on the record which leads the whole transaction to time out and being rolled back. So it seems there are two issues:
|
[x]
):Description
I am using Gitea on Windows with MSSQL as DB backend. By chance I found out that removing the first owner of an organization brings down the whole gitea web interface for us.
Steps to reproduce in our environment:
What happes is that the page does not refresh for about 30 seconds and then shows an 500 error.
All subsequent requests to the gitea webinterface then fail with this 500 error, no matter if using an existing session or accessing it without being logged in.
I was only able to get it to work again by restoring a DB backup previous to the deletion.
When deleting UserA the following entries are written to the gitea.log:
each subsequent request to the web interface generates an entry similar to this in the log file:
I've used SQL profiler to see which queries are executed against the DB when the user is deleted, and there are only two queries that modify the database (all others are SELECT statements):
The SQL profiler does not pick up any queries with errors or warnings, timeouts or high load when the deletion is performed. As all other queries are exeuted in in less than 10 milliseconds and given that I can reproduce this reliably on each try I do not think this is in any way load or network related, the i/o timeout message might be more of a red herring.
Let me know if you need anything else.
The text was updated successfully, but these errors were encountered: