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

Closed
opened 2025-11-02 05:15:15 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @JKingweb on GitHub (Jun 23, 2019).

  • Gitea version (or commit ref): 1.8.3
  • Git version: 2.22.0 (client), 2.17.1 (server)
  • Operating system: Ubuntu 18.04
  • 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:
[Macaron] 2019-06-23 19:28:11: Started GET /MensBeam/arsse.git/info/refs?service=git-upload-pack for 127.0.0.1
[Macaron] 2019-06-23 19:28:11: Completed GET /MensBeam/arsse.git/info/refs?service=git-upload-pack 200 OK in 9.169103ms
[Macaron] 2019-06-23 19:28:11: Started GET /MensBeam/arsse.git/info/refs?service=git-receive-pack for 127.0.0.1
[Macaron] 2019-06-23 19:28:11: Completed GET /MensBeam/arsse.git/info/refs?service=git-receive-pack 401 Unauthorized in 1.825858ms
[Macaron] 2019-06-23 19:28:11: Started GET /MensBeam/arsse.git/info/refs?service=git-receive-pack for 127.0.0.1
[Macaron] 2019-06-23 19:28:12: Completed GET /MensBeam/arsse.git/info/refs?service=git-receive-pack 200 OK in 446.823637ms
[Macaron] 2019-06-23 19:28:12: Started POST /MensBeam/arsse.git/git-receive-pack for 127.0.0.1
[Macaron] 2019-06-23 19:28:13: Completed POST /MensBeam/arsse.git/git-receive-pack 200 OK in 563.953235ms

Description

I know this issue has cropped up a lot for people, but none of the supposed solutions have worked for me.

Relevant configuration as follows:

[server]
ROOT_URL         = https://code.mensbeam.com:443/
PROTOCOL         = http
HTTP_ADDR        = 127.0.0.1
DOMAIN           = localhost
HTTP_PORT        = 3000

And for Nginx:

server {
	server_name code.mensbeam.com;
	... boilerplate stuff ...

	location / {
	    proxy_buffering off;
	    proxy_set_header Host $http_host;
	    proxy_set_header X-WEBAUTH-USER $remote_user;
	    proxy_pass http://localhost:3000;
	}
}

I've tried numerous variations on the above Gitea configuration (no HTTP_ADDR, DOMAIN set to code.mensbeam.com, no port in ROOT_URL...), but nothing works. This was all working earlier today, and had been for a couple of years, so I'm pretty mystified.

Originally created by @JKingweb on GitHub (Jun 23, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.8.3 - Git version: 2.22.0 (client), 2.17.1 (server) - Operating system: Ubuntu 18.04 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [X] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ``` [Macaron] 2019-06-23 19:28:11: Started GET /MensBeam/arsse.git/info/refs?service=git-upload-pack for 127.0.0.1 [Macaron] 2019-06-23 19:28:11: Completed GET /MensBeam/arsse.git/info/refs?service=git-upload-pack 200 OK in 9.169103ms [Macaron] 2019-06-23 19:28:11: Started GET /MensBeam/arsse.git/info/refs?service=git-receive-pack for 127.0.0.1 [Macaron] 2019-06-23 19:28:11: Completed GET /MensBeam/arsse.git/info/refs?service=git-receive-pack 401 Unauthorized in 1.825858ms [Macaron] 2019-06-23 19:28:11: Started GET /MensBeam/arsse.git/info/refs?service=git-receive-pack for 127.0.0.1 [Macaron] 2019-06-23 19:28:12: Completed GET /MensBeam/arsse.git/info/refs?service=git-receive-pack 200 OK in 446.823637ms [Macaron] 2019-06-23 19:28:12: Started POST /MensBeam/arsse.git/git-receive-pack for 127.0.0.1 [Macaron] 2019-06-23 19:28:13: Completed POST /MensBeam/arsse.git/git-receive-pack 200 OK in 563.953235ms ``` ## Description I know this issue has cropped up a lot for people, but none of the supposed solutions have worked for me. Relevant configuration as follows: ``` [server] ROOT_URL = https://code.mensbeam.com:443/ PROTOCOL = http HTTP_ADDR = 127.0.0.1 DOMAIN = localhost HTTP_PORT = 3000 ``` And for Nginx: ``` server { server_name code.mensbeam.com; ... boilerplate stuff ... location / { proxy_buffering off; proxy_set_header Host $http_host; proxy_set_header X-WEBAUTH-USER $remote_user; proxy_pass http://localhost:3000; } } ``` I've tried numerous variations on the above Gitea configuration (no HTTP_ADDR, DOMAIN set to code.mensbeam.com, no port in ROOT_URL...), but nothing works. This was all working earlier today, and had been for a couple of years, so I'm pretty mystified.
Author
Owner

@JKingweb commented on GitHub (Jun 24, 2019):

Resynchronizing hooks seems to have put things right. Sorry for the noise.

@JKingweb commented on GitHub (Jun 24, 2019): Resynchronizing hooks seems to have put things right. Sorry for the noise.
Author
Owner

@4oo4 commented on GitHub (Aug 16, 2019):

@JKingweb So did you run gitea admin regenerate hooks? I tried that but it didn't seem to help.

@4oo4 commented on GitHub (Aug 16, 2019): @JKingweb So did you run `gitea admin regenerate hooks?` I tried that but it didn't seem to help.
Author
Owner

@JKingweb commented on GitHub (Aug 16, 2019):

I used the Web interface. I wasn't aware there was a CLI command.

@JKingweb commented on GitHub (Aug 16, 2019): I used the Web interface. I wasn't aware there was a CLI command.
Author
Owner

@4oo4 commented on GitHub (Aug 16, 2019):

I'm not sure if it's the same thing? I ran that too from the web interface, but looks like my issue is an artifact that was leftover from migrating it from Gogs, correcting the path here solved it:

git@gitea:~/gitea-repositories/user/arduino-code.git/hooks/pre-receive.d$ cat pre-receive
#!/usr/bin/env bash
"/home/git/gogs/gogs" hook --config='/home/git/gogs/custom/conf/app.ini' pre-receive

Not sure why it got hung up now, since I successfully pushed to it yesterday without any issues. 🤷‍♂️
Looks to be a change in behavior with 1.9.1: https://github.com/go-gitea/gitea/pull/7856, https://github.com/go-gitea/gitea/issues/7754

For anyone else in the same situation, running this from the gitea-repositories directory is a quick fix:
grep -lr 'gogs/gogs' * | xargs sed -i 's/gogs/gitea/g;'

@4oo4 commented on GitHub (Aug 16, 2019): I'm not sure if it's the same thing? I ran that too from the web interface, but looks like my issue is an artifact that was leftover from migrating it from Gogs, correcting the path here solved it: ``` git@gitea:~/gitea-repositories/user/arduino-code.git/hooks/pre-receive.d$ cat pre-receive #!/usr/bin/env bash "/home/git/gogs/gogs" hook --config='/home/git/gogs/custom/conf/app.ini' pre-receive ``` ~~Not sure why it got hung up now, since I successfully pushed to it yesterday without any issues. :man_shrugging:~~ Looks to be a change in behavior with 1.9.1: https://github.com/go-gitea/gitea/pull/7856, https://github.com/go-gitea/gitea/issues/7754 For anyone else in the same situation, running this from the `gitea-repositories` directory is a quick fix: `grep -lr 'gogs/gogs' * | xargs sed -i 's/gogs/gitea/g;'`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3506