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

404 Not Found when doing git push ( return code 22 ) #7379

Closed
5 tasks
dtouzeau opened this issue Jul 8, 2019 · 13 comments
Closed
5 tasks

404 Not Found when doing git push ( return code 22 ) #7379

dtouzeau opened this issue Jul 8, 2019 · 13 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@dtouzeau
Copy link

dtouzeau commented Jul 8, 2019

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

Description

I have created the first repository but when i want to push the nginx return a 404

NgInx events:
176.187.150.8 - - [08/Jul/2019:13:58:37 +0000] "GET /ArticaTech/artica3x.git/info/refs?service=git-receive-pack HTTP/1.1" 401 0 "-" "git/1.7.0.4"
176.187.150.8 - - [08/Jul/2019:13:58:38 +0000] "GET /ArticaTech/artica3x.git/info/refs HTTP/1.1" 200 59 "-" "git/1.7.0.4"
176.187.150.8 - - [08/Jul/2019:13:58:38 +0000] "GET /ArticaTech/artica3x.git/HEAD HTTP/1.1" 404 8146 "-" "git/1.7.0.4"
176.187.150.8 - - [08/Jul/2019:13:58:38 +0000] "PROPFIND /ArticaTech/artica3x.git/ HTTP/1.1" 404 8058 "-" "git/1.7.0.4"

Log on Client :

GIT_CURL_VERBOSE=1 git push origin master --force

  • Couldn't find host git.artica.center in the .netrc file; using defaults
  • About to connect() to git.artica.center port 443 (#0)
  • Trying 46.105.190.45... * Connected to git.artica.center (46.105.190.45) port 443 (#0)
  • found 173 certificates in /etc/ssl/certs/ca-certificates.crt
  • server certificate verification OK
  • common name: git.artica.center (matched)
  • server certificate expiration date OK
  • server certificate activation date OK
  • certificate public key: RSA
  • certificate version: Use proper url for libravatar dep #3
  • subject: CN=git.artica.center
  • start date: Sun, 07 Jul 2019 18:26:00 GMT
  • expire date: Sat, 05 Oct 2019 18:26:00 GMT
  • issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
  • compression: NULL
  • cipher: AES-128-CBC
  • MAC: SHA1

GET /ArticaTech/artica3x.git/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.7.0.4
Host: git.artica.center
Accept: /
Pragma: no-cache

  • The requested URL returned error: 401
  • Closing connection #0
  • Couldn't find host git.artica.center in the .netrc file; using defaults
  • About to connect() to git.artica.center port 443 (#0)
  • Trying 46.105.190.45... * Connected to git.artica.center (46.105.190.45) port 443 (#0)
  • found 173 certificates in /etc/ssl/certs/ca-certificates.crt
  • SSL re-using session ID
  • server certificate verification OK
  • common name: git.artica.center (matched)
  • server certificate expiration date OK
  • server certificate activation date OK
  • certificate public key: RSA
  • certificate version: Use proper url for libravatar dep #3
  • subject: CN=git.artica.center
  • start date: Sun, 07 Jul 2019 18:26:00 GMT
  • expire date: Sat, 05 Oct 2019 18:26:00 GMT
  • issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
  • compression: NULL
  • cipher: AES-128-CBC
  • MAC: SHA1

GET /ArticaTech/artica3x.git/info/refs HTTP/1.1
User-Agent: git/1.7.0.4
Host: git.artica.center
Accept: /
Pragma: no-cache

< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 08 Jul 2019 14:04:42 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 59
< Connection: keep-alive
< Accept-Ranges: bytes
< Cache-Control: no-cache, max-age=0, must-revalidate
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Last-Modified: Mon, 08 Jul 2019 14:04:42 GMT
< Pragma: no-cache
< Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
< Set-Cookie: i_like_gitea=165a249097ea918c; Path=/; HttpOnly
< Set-Cookie: _csrf=W9W7ymz6Lm9poyvkQ9BluxMyNNM6MTU2MjU5NDY4Mjk4NjEzNjU4MA%3D%3D; Path=/; Expires=Tue, 09 Jul 2019 14:04:42 GMT; HttpOnly
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
<

  • Expire cleared
  • Connection #0 to host git.artica.center left intact
  • Couldn't find host git.artica.center in the .netrc file; using defaults
  • Re-using existing connection! (#0) with host git.artica.center
  • Connected to git.artica.center (46.105.190.45) port 443 (#0)

GET /ArticaTech/artica3x.git/HEAD HTTP/1.1
User-Agent: git/1.7.0.4
Host: git.artica.center
Accept: /
Pragma: no-cache

  • The requested URL returned error: 404
  • Expire cleared
  • Closing connection #0
  • Couldn't find host git.artica.center in the .netrc file; using defaults
  • About to connect() to git.artica.center port 443 (#0)
  • Trying 46.105.190.45... * Connected to git.artica.center (46.105.190.45) port 443 (#0)
  • found 173 certificates in /etc/ssl/certs/ca-certificates.crt
  • server certificate verification OK
  • common name: git.artica.center (matched)
  • server certificate expiration date OK
  • server certificate activation date OK
  • certificate public key: RSA
  • certificate version: Use proper url for libravatar dep #3
  • subject: CN=git.artica.center
  • start date: Sun, 07 Jul 2019 18:26:00 GMT
  • expire date: Sat, 05 Oct 2019 18:26:00 GMT
  • issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
  • compression: NULL
  • cipher: AES-128-CBC
  • MAC: SHA1

PROPFIND /ArticaTech/artica3x.git/ HTTP/1.1
User-Agent: git/1.7.0.4
Host: git.artica.center
Accept: /
Depth: 0
Content-Type: text/xml
Content-Length: 180
Expect: 100-continue

< HTTP/1.1 100 Continue

@Cherrg
Copy link
Contributor

Cherrg commented Jul 8, 2019

is it possible to update to a newer version of gitea?

@zeripath
Copy link
Contributor

zeripath commented Jul 8, 2019

Please do not use Gitea <1.7.6 as there are serious security vulnerabilities in those early versions

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jul 8, 2019
@dtouzeau
Copy link
Author

dtouzeau commented Jul 8, 2019

Upgraded to 1.10.0+dev built with GNU Make 4.1, go1.12.6 : bindata, sqlite, sqlite_unlock_notify
But same 404 not found error

@techknowlogick
Copy link
Member

You've provided the nginx log, but what does Gitea say?

@lunny
Copy link
Member

lunny commented Jul 8, 2019

Maybe you should check your file system permission on this repository because /ArticaTech/artica3x.git/info/refs return 200, but /ArticaTech/artica3x.git/HEAD return 404.

@dtouzeau
Copy link
Author

dtouzeau commented Jul 9, 2019

The nGNIX run as the same git user to avoid permissions issues:

git      23676  0.0  0.3 211084  3220 ?        S    07:32   0:00 nginx: worker process
git      23677  0.0  0.3 211084  3220 ?        S    07:32   0:00 nginx: worker process
git      23678  0.0  0.3 211084  3220 ?        S    07:32   0:00 nginx: worker process
git      23679  0.0  0.3 211084  3220 ?        S    07:32   0:00 nginx: worker process
git      23680  0.0  0.3 211084  3220 ?        S    07:32   0:00 nginx: worker process
git      23681  0.0  0.6 211156  6960 ?        S    07:32   0:00 nginx: worker process
git      23682  0.0  0.3 211084  3220 ?        S    07:32   0:00 nginx: worker process
git      23683  0.0  0.3 211084  3220 ?        S    07:32   0:00 nginx: worker process
git      23685  0.0  0.3 211084  3224 ?        S    07:32   0:00 nginx: worker process
git      23686  0.0  0.3 211084  3224 ?        S    07:32   0:00 nginx: worker process
git      23690  0.0  0.5 211084  5276 ?        S    07:32   0:00 nginx: worker process
git      23691  0.0  0.6 211424  6976 ?        S    07:32   0:00 nginx: worker process
git      23803  0.0 11.7 898632 123276 ?       Ssl  07:32   0:00 /home/git/gitea web -c /etc/gitea/app.ini

Here the gita in debug mode when trying to push

2019/07/09 07:39:52 models/models.go:305:NewEngine() [W] Table protected_branch Column can_push db default is 0, struct default is false
2019/07/09 07:39:52 models/models.go:305:NewEngine() [W] Table protected_branch Column enable_merge_whitelist db default is 0, struct default is false
2019/07/09 07:39:52 models/models.go:305:NewEngine() [W] Table user_open_id Column show db default is 0, struct default is false
2019/07/09 07:39:52 models/models.go:305:NewEngine() [W] Table review column type db type is VARCHAR(255), struct type is INT
2019/07/09 07:39:52 models/models.go:305:NewEngine() [W] Table comment has column old_assignee_id but struct has not related field
2019/07/09 07:39:52 routers/init.go:84:GlobalInit() [I] ORM engine initialization successful!
2019/07/09 07:39:52 routers/init.go:106:GlobalInit() [I] SQLite3 Supported
2019/07/09 07:39:52 routers/init.go:37:checkRunMode() [I] Run Mode: Production
2019/07/09 07:39:52 cmd/web.go:151:runWeb() [I] Listen: unix:///home/git/run/gitea.sock
2019/07/09 07:39:52 cmd/web.go:154:runWeb() [I] LFS server enabled
2019/07/09 07:40:27 ...s/context/context.go:315:func1() [D] Session ID: 671307434f255abe
2019/07/09 07:40:27 ...s/context/context.go:316:func1() [D] CSRF Token: AQLp6iN9Sw0C5XSmSU4frXp_2co6MTU2MjY1ODAyNzkyNDQ0OTk3OQ==
2019/07/09 07:40:28 ...s/context/context.go:315:func1() [D] Session ID: 7e9a2f9edcf9fcea
2019/07/09 07:40:28 ...s/context/context.go:316:func1() [D] CSRF Token: dnGU2lx4dGAYIaDbfznD_z5GSvc6MTU2MjY1ODAyODI5NzcxNDUwMQ==
2019/07/09 07:40:28 ...s/context/context.go:315:func1() [D] Session ID: b79278bd8c4fa723
2019/07/09 07:40:28 ...s/context/context.go:316:func1() [D] CSRF Token: -RlF7l5EeXyq_vb_4P8Ha8YPBxs6MTU2MjY1ODAyODM4NDI1OTI2Mg==
2019/07/09 07:40:28 ...s/context/context.go:137:HTML() [D] Template: status/404
2019/07/09 07:40:29 ...s/context/context.go:315:func1() [D] Session ID: 9bdae8a1e0e33b62
2019/07/09 07:40:29 ...s/context/context.go:316:func1() [D] CSRF Token: -d78qd3TZq_R5hu_qsz7EIlS6qk6MTU2MjY1ODAyOTE1MTYyNzE5Mw==
2019/07/09 07:40:29 ...s/context/context.go:137:HTML() [D] Template: status/404

@dtouzeau
Copy link
Author

Any help ?

@zeripath
Copy link
Contributor

Have you checked your filesystem permissions?

@dtouzeau
Copy link
Author

The nginx service and gita run on the same user

Here permissions on the folder

total 40K
drwxr-xr-x 7 git git 4.0K Jul  8 15:27 .
drwxr-xr-x 4 git git 4.0K Jul  8 15:27 ..
-rwxr-xr-x 1 git git   23 Jul  8 15:27 HEAD
drwxr-xr-x 2 git git 4.0K Jul  8 15:27 branches
-rwxr-xr-x 1 git git   66 Jul  8 15:27 config
-rwxr-xr-x 1 git git   73 Jul  8 15:27 description
drwxr-xr-x 5 git git 4.0K Jul  8 15:27 hooks
drwxr-xr-x 2 git git 4.0K Jul  9 07:40 info
drwxr-xr-x 7 git git 4.0K Jul  8 15:27 objects
drwxr-xr-x 4 git git 4.0K Jul  8 15:27 refs

@zeripath
Copy link
Contributor

Ah. Ok so I see you're sending propfind messages - that makes me suspicious. What version of git is your client and on the server?

@dtouzeau
Copy link
Author

Client: 1.7.0.4
Server: 1.10.0+dev

@zeripath
Copy link
Contributor

Ok if you're sure you have the URLs correct could you try with a more up to date version of git. PROPFIND implies that you're trying to use WebDAV to get over http rather than smart git.

@dtouzeau
Copy link
Author

Upgraded the Git client to : 2.3.7

Working like a charme..

Thanks to all.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

5 participants