Repository default hook pre-receive.bak not able to resolve localhost #13124

Closed
opened 2025-11-02 10:31:49 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @Linkyrex on GitHub (Jun 10, 2024).

Description

Having set LOCAL_ROOT_URL = http://localhost:3000/ in the app.ini will result in the error: "The change was rejected by the server. Please check Git Hooks. Full Rejection Message: Gitea: Internal Server Connection Error" when pushing to a repository. According to the logs the hook pre-receive.bak was declined.
remote: Gitea: Internal Server Connection Error To /var/lib/gitea/data/gitea-repositories/org/myrepo.git ! [remote rejected] aae73a9fef44476b0666fff9f238472213057df7 -> main (pre-receive hook declined) error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/myrepo'

This Issue went away after setting: LOCAL_ROOT_URL = http://127.0.0.1:3000/

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

CentOS9

How are you running Gitea?

Build from Source and as a service.

Database

PostgreSQL

Originally created by @Linkyrex on GitHub (Jun 10, 2024). ### Description Having set `LOCAL_ROOT_URL = http://localhost:3000/` in the app.ini will result in the error: "The change was rejected by the server. Please check Git Hooks. Full Rejection Message: Gitea: Internal Server Connection Error" when pushing to a repository. According to the logs the hook pre-receive.bak was declined. `remote: Gitea: Internal Server Connection Error To /var/lib/gitea/data/gitea-repositories/org/myrepo.git ! [remote rejected] aae73a9fef44476b0666fff9f238472213057df7 -> main (pre-receive hook declined) error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/myrepo'` This Issue went away after setting: `LOCAL_ROOT_URL = http://127.0.0.1:3000/` ### Gitea Version 1.22.0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System CentOS9 ### How are you running Gitea? Build from Source and as a service. ### Database PostgreSQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 10:31:49 -06:00
Author
Owner

@lunny commented on GitHub (Jun 10, 2024):

Please test you can visit localhost from the shell of git.

@lunny commented on GitHub (Jun 10, 2024): Please test you can visit `localhost` from the shell of git.
Author
Owner

@Linkyrex commented on GitHub (Jun 10, 2024):

localhost itself resolved fine. Other aspects of Gitea were also working as expected. The issue seemed to be unique for the hook pre-receive.bak.

@Linkyrex commented on GitHub (Jun 10, 2024): localhost itself resolved fine. Other aspects of Gitea were also working as expected. The issue seemed to be unique for the hook pre-receive.bak.
Author
Owner

@techknowlogick commented on GitHub (Jun 10, 2024):

The .bak is suspicious as by default hooks don't have that as an extension. I'm wondering if maybe someone edited a hook and made a backup and now it is still being run. Could you try removing that file from the hooks directory for that repo?

@techknowlogick commented on GitHub (Jun 10, 2024): The .bak is suspicious as by default hooks don't have that as an extension. I'm wondering if maybe someone edited a hook and made a backup and now it is still being run. Could you try removing that file from the hooks directory for that repo?
Author
Owner

@GiteaBot commented on GitHub (Jul 11, 2024):

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot commented on GitHub (Jul 11, 2024): We close issues that need feedback from the author if there were no new comments for a month. :tea:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13124