-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Sometimes push to gitea will fail #5612
Comments
Do you see any errors in gitea.log? |
Yes, I updated it to https://gist.github.com/gslin/1267f3f0fc3675f345a149246b9ce14a and mostly it included "MirrorUpdate: invalid connection". |
This error is when connection to database is broken but it's hard to tell reason for this |
I enabled https://gist.github.com/gslin/c5aa707b7900ffe8223df47c878bf8ad Since 1.5.x is fine, is MySQL library in 1.6.x different from 1.5.x? |
The error is
|
Have a same error even on navigation inside Gitea (1.6.3 and 1.7.0-rc2):
In mysql.log:
|
I've reproduced this on https://test-gitea.404.tw, a brand new setup with Ubuntu 18.04 + Percona Server 5.7.24 + Gitea 1.6.4 + nginx 1.14.0. I would love to provide this instance for debugging. |
Is it related to #5736? |
Possibly, however another option is that we're causing a deadlock in gitea serv when we check and update the public key to say it's used, mysql is then detecting the deadlock and just killing the connection. https://github.com/go-gitea/gitea/blob/master/models/ssh_key.go#L503 Looking at that code if we really want to update the public key entry every time it's used, this should be done in a transaction. |
@zeripath I see. I wonder if it's possible to replace the global |
It's not definitely the issue - I'm just suspicious. I think the global x is too tempting really. In other languages, they allow that style by adding threadlocals and a handler that opens a transaction per http request or alike. In go you can't set a threadlocal, and you're meant to put the context into every call. To get rid of the global x would mean restructuring all our functions to force the passing in of a session, as appropriate - thus it's not hidden anymore and anyone that uses them has to think about it. |
@typeless I don't think the |
@lunny Not sure if I understand you correctly. But I was not talking about replacing the database engine of My rule of thumb is that global variables make multi-threading harder. But I agree, this particular issue is not necessarily caused by it. I just imagined that, if the database connection handle were not global, would it be less error-prone in the first place? |
@typeless I tried
|
@gslin I grepped the codebase and found this https://github.com/go-gitea/gitea/blob/master/docs/content/doc/help/troubleshooting.en-us.md. It might be helpful. Also, if this used to work, what is the working version? |
@typeless that's a good article. It discussed serval different database codes organization methods. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
The last version working without issue is 1.5.3. |
@gslin I used to encounter a similar problem. It turned out that I have to create a team with proper access rights within the organization and add the accounts to it. The team feature was added in later versions. You could have a look at it. Edit: This looks like a randomly happened problem. Probably not related to what I said. |
My issue happens in all pages (randomly), including login page 500. |
@gslin I suggest upgrading to a newer version to find if it would still happen. |
@gslin - we never did get to the bottom of this. There are several possible causes for this issue:
If its the first case, it should be fixable through already configurable by adding more connections to the pool and probably on the Mysql side of things. 2 and 3 are the main worries for me. I am not confident that we're doing things properly. The final case would technically be a problem with Xorm. I'm not sure how to proceed. First things first though - if you're still getting this - what version are you on? Could you test on the 1.8-rcs? |
[x]
):Description
When I upgraded Gitea from 1.5.x to 1.6.0, sometimes
git push
would fail with different reasons. Usually rerungit push
will be successful (but not always).The text was updated successfully, but these errors were encountered: