Skip to content
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

Pushing many commits with 'Require Signed Commits' enabled fails with 'Gitea: Internal Server Connection Error' #32663

Open
Mik4sa opened this issue Nov 28, 2024 · 0 comments
Labels

Comments

@Mik4sa
Copy link

Mik4sa commented Nov 28, 2024

Description

On a private repo / gitea instance I merged our default branch into a fairly old feature branch resulting into 1938 commits to be pushed at once. When pushing I get an error after about 64 seconds, so roughly after a minute.
This is what I get in my console:

$ git push
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 16 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 826 bytes | 413.00 KiB/s, done.
Total 7 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0)
remote:
remote: Gitea: Internal Server Connection Error
remote: * Checking 1 references
To https://gitea.[...].de/[OWNER]/[REPO]
 ! [remote rejected]       test-push-many-commits -> test-push-many-commits (pre-receive hook declined)
error: failed to push some refs to 'https://gitea.[...].de/[OWNER]/[REPO]'

In the logs from gitea I've found these messages:

2024/11/28 09:44:43 ...hook_verification.go:50:func2() [E] readAndVerifyCommitsFromShaReader failed: Unverified commit: 5e282dc2d42e2376b183e2f8fb432e0eff9769a3
2024/11/28 09:44:43 .../hook_pre_receive.go:216:preReceiveBranch() [W] Forbidden: Branch: test-push-many-commits in <Repository 10055:[OWNER]/[REPO]> is protected from unverified commit 5e282dc2d42e2376b183e2f8fb432e0eff9769a3
2024/11/28 09:44:43 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/[OWNER]/[REPO] for 127.0.0.1:0, 403 Forbidden in 60995.7ms @ private/hook_pre_receive.go:105(private.HookPreReceive)

I tried the push several times, so I found this error for every try:

2024/11/28 08:17:51 ...hook_verification.go:50:func2() [E] readAndVerifyCommitsFromShaReader failed: Unverified commit: 9d7b64edd639a30b8a9210b514637ae0b1b2c584
2024/11/28 08:17:51 .../hook_pre_receive.go:216:preReceiveBranch() [W] Forbidden: Branch: test-push-many-commits in <Repository 10055:[OWNER]/[REPO]> is protected from unverified commit 9d7b64edd639a30b8a9210b514637ae0b1b2c584
2024/11/28 08:17:51 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/[OWNER]/[REPO] for 127.0.0.1:0, 403 Forbidden in 60995.2ms @ private/hook_pre_receive.go:105(private.HookPreReceive)
2024/11/28 08:23:09 ...hook_verification.go:50:func2() [E] readAndVerifyCommitsFromShaReader failed: Unverified commit: f33b08cfb9b2f6dd7c9324ded61c189a85d46a52
2024/11/28 08:23:09 .../hook_pre_receive.go:216:preReceiveBranch() [W] Forbidden: Branch: test-push-many-commits in <Repository 10055:[OWNER]/[REPO]> is protected from unverified commit f33b08cfb9b2f6dd7c9324ded61c189a85d46a52
2024/11/28 08:23:09 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/[OWNER]/[REPO] for 127.0.0.1:0, 403 Forbidden in 60998.5ms @ private/hook_pre_receive.go:105(private.HookPreReceive)
2024/11/28 08:26:51 ...hook_verification.go:50:func2() [E] readAndVerifyCommitsFromShaReader failed: Unverified commit: c201bae87cc121be48437940ca59c0b76c0948e1
2024/11/28 08:26:51 .../hook_pre_receive.go:216:preReceiveBranch() [W] Forbidden: Branch: test-push-many-commits in <Repository 10055:[OWNER]/[REPO]> is protected from unverified commit c201bae87cc121be48437940ca59c0b76c0948e1
2024/11/28 08:26:51 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/[OWNER]/[REPO] for 127.0.0.1:0, 403 Forbidden in 60996.2ms @ private/hook_pre_receive.go:105(private.HookPreReceive)
2024/11/28 08:30:49 ...hook_verification.go:50:func2() [E] readAndVerifyCommitsFromShaReader failed: Unverified commit: 6292dbd965c3ee366f29e2baf86d4770bea70801
2024/11/28 08:30:49 .../hook_pre_receive.go:216:preReceiveBranch() [W] Forbidden: Branch: test-push-many-commits in <Repository 10055:[OWNER]/[REPO]> is protected from unverified commit 6292dbd965c3ee366f29e2baf86d4770bea70801
2024/11/28 08:30:49 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/[OWNER]/[REPO] for 127.0.0.1:0, 403 Forbidden in 61006.1ms @ private/hook_pre_receive.go:105(private.HookPreReceive)
2024/11/28 08:57:02 ...hook_verification.go:50:func2() [E] readAndVerifyCommitsFromShaReader failed: Unverified commit: 25f3e9316c75df247f342ffef7cd68f6287d4f06
2024/11/28 08:57:02 .../hook_pre_receive.go:216:preReceiveBranch() [W] Forbidden: Branch: test-push-many-commits in <Repository 10055:[OWNER]/[REPO]> is protected from unverified commit 25f3e9316c75df247f342ffef7cd68f6287d4f06
2024/11/28 08:57:02 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/[OWNER]/[REPO] for 127.0.0.1:0, 403 Forbidden in 61006.9ms @ private/hook_pre_receive.go:105(private.HookPreReceive)

Note that branch protection for this branch (all branches) is enabled. The only enabled setting is 'Require Signed Commits'.

The log states that there are unverified commits. Which isnt true. Looking into the default branch I can see that the commit is signed and verified by Gitea. All of them. Interestingly it's always a different commit which should be unverified, according to the logs. Also this error always appear after 61 seconds which is very close to 60 seconds. Sounds like a timeout or something.
The push was successful after I disabled the requirement for signed commits.

Is there a timeout for the pre_receive hook I can adjust or for the signature check? I couldn't find any.
Also I tried to quickly check the source code but couldn't find any timeout, directly. But note that I'm not firm with go nor with the code of Gitea.

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.39.1.windows.1

Operating System

Windows Server 2016 - Version 1607 (Build 14393.6452)

How are you running Gitea?

  • Using gitea-1.22.3-windows-4.0-amd64.exe from your download page
  • Registered as a Windows service with the following command line: D:\gitea\gitea.exe web --config D:\gitea\custom\conf\app.ini

Database

MSSQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant