pre-commit [F] retrieve protected branches information failed: EOF #3680

Closed
opened 2025-11-02 05:21:30 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @DannyLee12 on GitHub (Jul 26, 2019).

  • Gitea version (or commit ref):
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Running Gitea on kubernetes:

Intermittent error on push.
Error starts as

remote: 2019/07/25 14:01:25 [...s/setting/setting.go:980 NewContext()] [E] Error saving generated JWT Secret to custom config: open /data/gitea/conf/app.ini: permission denied

Changing the permission of the .ini file changes the error to:

! [remote rejected] master -> master (pre-receive hook declined)

The issue seems to stem from the precommit hook that is returning an EOF error:

2019/07/25 14:21:00 [T] GetProtectedBranchBy: http://0.0.0.0:3000/api/internal/branch/55/DMC120-notifications-testing-proper
2019/07/25 14:21:00 [...io/gitea/cmd/hook.go:109 runHookPreReceive()] [F] retrieve protected branches information failed: EOF
2019/07/25 14:22:34 [T] GetProtectedBranchBy: http://0.0.0.0:3000/api/internal/branch/36/develop
2019/07/25 14:22:34 [...io/gitea/cmd/hook.go:109 runHookPreReceive()] [F] retrieve protected branches information failed: EOF
2019/07/25 14:28:23 [T] GetProtectedBranchBy: http://0.0.0.0:3000/api/internal/branch

...

Screenshots

n/a the UI is unaffected.

Originally created by @DannyLee12 on GitHub (Jul 26, 2019). - Gitea version (or commit ref): - Git version: - Operating system: - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Running Gitea on kubernetes: Intermittent error on push. Error starts as ``` remote: 2019/07/25 14:01:25 [...s/setting/setting.go:980 NewContext()] [E] Error saving generated JWT Secret to custom config: open /data/gitea/conf/app.ini: permission denied ``` Changing the permission of the .ini file changes the error to: ``` ! [remote rejected] master -> master (pre-receive hook declined) ``` The issue seems to stem from the precommit hook that is returning an EOF error: ``` 2019/07/25 14:21:00 [T] GetProtectedBranchBy: http://0.0.0.0:3000/api/internal/branch/55/DMC120-notifications-testing-proper 2019/07/25 14:21:00 [...io/gitea/cmd/hook.go:109 runHookPreReceive()] [F] retrieve protected branches information failed: EOF 2019/07/25 14:22:34 [T] GetProtectedBranchBy: http://0.0.0.0:3000/api/internal/branch/36/develop 2019/07/25 14:22:34 [...io/gitea/cmd/hook.go:109 runHookPreReceive()] [F] retrieve protected branches information failed: EOF 2019/07/25 14:28:23 [T] GetProtectedBranchBy: http://0.0.0.0:3000/api/internal/branch ``` ... ## Screenshots n/a the UI is unaffected.
GiteaMirror added the type/questionissue/stale labels 2025-11-02 05:21:30 -06:00
Author
Owner

@DannyLee12 commented on GitHub (Jul 30, 2019):

Again:

(venv) Richards-MacBook-Pro:connector-notification-lib richard$ git push
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 12 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 1.15 KiB | 1.15 MiB/s, done.
Total 6 (delta 5), reused 0 (delta 0)
remote: Gitea: Internal error
remote: retrieve protected branches information failed: EOF
To https://gitea-tooling.az.connectors.gdpdentsu.net/connectors/connector-notification-lib
 ! [remote rejected] feature/job_messages -> feature/job_messages (pre-receive hook declined)
error: failed to push some refs to 'https://gitea-tooling.az.connectors.gdpdentsu.net/connectors/connector-notification-lib'
@DannyLee12 commented on GitHub (Jul 30, 2019): Again: ``` (venv) Richards-MacBook-Pro:connector-notification-lib richard$ git push Enumerating objects: 11, done. Counting objects: 100% (11/11), done. Delta compression using up to 12 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 1.15 KiB | 1.15 MiB/s, done. Total 6 (delta 5), reused 0 (delta 0) remote: Gitea: Internal error remote: retrieve protected branches information failed: EOF To https://gitea-tooling.az.connectors.gdpdentsu.net/connectors/connector-notification-lib ! [remote rejected] feature/job_messages -> feature/job_messages (pre-receive hook declined) error: failed to push some refs to 'https://gitea-tooling.az.connectors.gdpdentsu.net/connectors/connector-notification-lib' ```
Author
Owner

@lunny commented on GitHub (Jul 30, 2019):

Could you try to change LOCAL_ROOT_URL to http://127.0.0.1:3000/?

@lunny commented on GitHub (Jul 30, 2019): Could you try to change `LOCAL_ROOT_URL` to `http://127.0.0.1:3000/`?
Author
Owner

@DannyLee12 commented on GitHub (Aug 2, 2019):

Waiting for the error to come back and I'll try this.

@DannyLee12 commented on GitHub (Aug 2, 2019): Waiting for the error to come back and I'll try this.
Author
Owner

@zeripath commented on GitHub (Aug 2, 2019):

You should run the admin task: Update the '.ssh/authorized_keys' file with Gitea SSH keys.

Also ensure that there is not a key not controlled by Gitea in that file.

@zeripath commented on GitHub (Aug 2, 2019): You should run the admin task: Update the '.ssh/authorized_keys' file with Gitea SSH keys. Also ensure that there is not a key not controlled by Gitea in that file.
Author
Owner

@DannyLee12 commented on GitHub (Aug 5, 2019):

@zeripath is there a script to run this admin task? Or how should I update these keys? If it's important, we clone the repos via https as ssh just hangs and never works.

@DannyLee12 commented on GitHub (Aug 5, 2019): @zeripath is there a script to run this admin task? Or how should I update these keys? If it's important, we clone the repos via https as ssh just hangs and never works.
Author
Owner

@zeripath commented on GitHub (Aug 6, 2019):

It's on the admin users administrator settings page.

@zeripath commented on GitHub (Aug 6, 2019): It's on the admin users administrator settings page.
Author
Owner

@randyesq commented on GitHub (Sep 20, 2019):

Which version of Gitea was this issue seen on?

@randyesq commented on GitHub (Sep 20, 2019): Which version of Gitea was this issue seen on?
Author
Owner

@stale[bot] commented on GitHub (Nov 19, 2019):

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.

@stale[bot] commented on GitHub (Nov 19, 2019): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3680