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

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

Closed
2 of 7 tasks
JKingweb opened this issue Jun 23, 2019 · 4 comments
Closed
2 of 7 tasks

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

JKingweb opened this issue Jun 23, 2019 · 4 comments

Comments

@JKingweb
Copy link

JKingweb commented 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.

@JKingweb
Copy link
Author

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

@4oo4
Copy link

4oo4 commented Aug 16, 2019

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

@JKingweb JKingweb reopened this Aug 16, 2019
@JKingweb
Copy link
Author

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

@4oo4
Copy link

4oo4 commented 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: #7856, #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 up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants