Can't push with HTTPS or SSH #3034

Closed
opened 2025-11-02 04:58:09 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @BloodyRum on GitHub (Mar 10, 2019).

Description

I can't push to any repos I make, this is what happens

error: Cannot access URL https://bloodygit.tejat.net/BloodyRum/ServerOS.git/, return code 22
fatal: git-http-push failed
error: failed to push some refs to 'https://bloodygit.tejat.net/BloodyRum/ServerOS.git'

I have googled the error, but nothing I have found shows me a fix I can use with gitea.

Originally created by @BloodyRum on GitHub (Mar 10, 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): Gitea version 1.7.3 - Git version: 2.11.0 - Operating system: Debian - Database: - [ ] 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: https://gist.github.com/BloodyRum/82370d513d375075c6de4b892a510ffa ## Description I can't push to any repos I make, this is what happens ``` error: Cannot access URL https://bloodygit.tejat.net/BloodyRum/ServerOS.git/, return code 22 fatal: git-http-push failed error: failed to push some refs to 'https://bloodygit.tejat.net/BloodyRum/ServerOS.git' ``` I have googled the error, but nothing I have found shows me a fix I can use with gitea. <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@zeripath commented on GitHub (Mar 10, 2019):

@BloodyRum What's your Nginx configuration look like? I guess you're proxying Gitea through Nginx?

(Could you take a look at https://docs.gitea.io/en-us/reverse-proxies/)

I note that there are some PROPFINDs being requested -- Git doesn't normally request these -- it implies that the git client has fallen back to dumb http from the smart http protocol so there should be an error before those PROPFINDs.

Googling git PROPFIND reveals suggesting using GIT_CURL_VERBOSE=1 however, just ensure that you've got the proxying set up correctly, double check your url in the repository and that you've actually got your username and password correct.

@zeripath commented on GitHub (Mar 10, 2019): @BloodyRum What's your Nginx configuration look like? I guess you're proxying Gitea through Nginx? (Could you take a look at https://docs.gitea.io/en-us/reverse-proxies/) I note that there are some PROPFINDs being requested -- Git doesn't normally request these -- it implies that the git client has fallen back to dumb http from the smart http protocol so there should be an error before those PROPFINDs. Googling git PROPFIND reveals suggesting using `GIT_CURL_VERBOSE=1` however, just ensure that you've got the proxying set up correctly, double check your url in the repository and that you've actually got your username and password correct.
Author
Owner

@BloodyRum commented on GitHub (Mar 10, 2019):

The reverse proxy is setup just like example
I triple checked my username and password, but to no avail.

Output with GIT_CURL_VERBOSE=1

bloodyrum@ravna:~/programming/oc/test$ GIT_CURL_VERBOSE=1 git push -u origin master
* Couldn't find host bloodygit.tejat.net in the .netrc file; using defaults
*   Trying 2607:fa18:8::10...
* TCP_NODELAY set
* Connected to bloodygit.tejat.net (2607:fa18:8::10) port 443 (#0)
* found 133 certificates in /etc/ssl/certs/ca-certificates.crt
* found 401 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
* 	 server certificate verification OK
* 	 server certificate status verification SKIPPED
* 	 common name: bloodygit.tejat.net (matched)
* 	 server certificate expiration date OK
* 	 server certificate activation date OK
* 	 certificate public key: RSA
* 	 certificate version: #3
* 	 subject: CN=bloodygit.tejat.net
* 	 start date: Sat, 09 Mar 2019 02:26:12 GMT
* 	 expire date: Fri, 07 Jun 2019 02:26:12 GMT
* 	 issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
* 	 compression: NULL
* ALPN, server accepted to use http/1.1
> GET /BloodyRum/ServerOS.git/info/refs?service=git-receive-pack HTTP/1.1
Host: bloodygit.tejat.net
User-Agent: git/2.17.1
Accept: */*
Accept-Encoding: gzip
Accept-Language: en-US, en;q=0.9, *;q=0.8
Pragma: no-cache

< HTTP/1.1 200 OK
< Server: nginx/1.10.3
< Date: Sun, 10 Mar 2019 18:32:25 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 0
< 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: Sun, 10 Mar 2019 18:32:25 GMT
< Pragma: no-cache
< Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
< Set-Cookie: i_like_gitea=<Possible censor>; Path=/; HttpOnly
< Set-Cookie: _csrf=<Possible Censor>; Path=/; Expires=Mon, 11 Mar 2019 18:32:25 GMT; HttpOnly
< X-Frame-Options: SAMEORIGIN
< 
* Connection #0 to host bloodygit.tejat.net left intact
* Couldn't find host bloodygit.tejat.net in the .netrc file; using defaults
* Found bundle for host bloodygit.tejat.net: 0x55fab803e290 [can pipeline]
* Re-using existing connection! (#0) with host bloodygit.tejat.net
* Connected to bloodygit.tejat.net (2607:fa18:8::10) port 443 (#0)
> GET /BloodyRum/ServerOS.git/HEAD HTTP/1.1
Host: bloodygit.tejat.net
User-Agent: git/2.17.1
Accept: */*
Accept-Encoding: gzip
Accept-Language: en-US, en;q=0.9, *;q=0.8
Pragma: no-cache

* The requested URL returned error: 404 Not Found
* stopped the pause stream!
* Closing connection 0
* Couldn't find host bloodygit.tejat.net in the .netrc file; using defaults
*   Trying 2607:fa18:8::10...
* TCP_NODELAY set
* Connected to bloodygit.tejat.net (2607:fa18:8::10) port 443 (#0)
* found 133 certificates in /etc/ssl/certs/ca-certificates.crt
* found 401 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
* 	 server certificate verification OK
* 	 server certificate status verification SKIPPED
* 	 common name: bloodygit.tejat.net (matched)
* 	 server certificate expiration date OK
* 	 server certificate activation date OK
* 	 certificate public key: RSA
* 	 certificate version: #3
* 	 subject: CN=bloodygit.tejat.net
* 	 start date: Sat, 09 Mar 2019 02:26:12 GMT
* 	 expire date: Fri, 07 Jun 2019 02:26:12 GMT
* 	 issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
* 	 compression: NULL
* ALPN, server accepted to use http/1.1
> PROPFIND /BloodyRum/ServerOS.git/ HTTP/1.1
Host: bloodygit.tejat.net
User-Agent: git/2.17.1
Accept: */*
Depth: 0
Content-Type: text/xml
Content-Length: 181
Expect: 100-continue

< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* The requested URL returned error: 404 Not Found
* stopped the pause stream!
* Closing connection 0
error: Cannot access URL https://bloodygit.tejat.net/BloodyRum/ServerOS.git/, return code 22
fatal: git-http-push failed
error: failed to push some refs to 'https://bloodygit.tejat.net/BloodyRum/ServerOS.git'
@BloodyRum commented on GitHub (Mar 10, 2019): The reverse proxy is setup just like example I triple checked my username and password, but to no avail. Output with GIT_CURL_VERBOSE=1 ``` bloodyrum@ravna:~/programming/oc/test$ GIT_CURL_VERBOSE=1 git push -u origin master * Couldn't find host bloodygit.tejat.net in the .netrc file; using defaults * Trying 2607:fa18:8::10... * TCP_NODELAY set * Connected to bloodygit.tejat.net (2607:fa18:8::10) port 443 (#0) * found 133 certificates in /etc/ssl/certs/ca-certificates.crt * found 401 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384 * server certificate verification OK * server certificate status verification SKIPPED * common name: bloodygit.tejat.net (matched) * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: CN=bloodygit.tejat.net * start date: Sat, 09 Mar 2019 02:26:12 GMT * expire date: Fri, 07 Jun 2019 02:26:12 GMT * issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3 * compression: NULL * ALPN, server accepted to use http/1.1 > GET /BloodyRum/ServerOS.git/info/refs?service=git-receive-pack HTTP/1.1 Host: bloodygit.tejat.net User-Agent: git/2.17.1 Accept: */* Accept-Encoding: gzip Accept-Language: en-US, en;q=0.9, *;q=0.8 Pragma: no-cache < HTTP/1.1 200 OK < Server: nginx/1.10.3 < Date: Sun, 10 Mar 2019 18:32:25 GMT < Content-Type: text/plain; charset=utf-8 < Content-Length: 0 < 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: Sun, 10 Mar 2019 18:32:25 GMT < Pragma: no-cache < Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647 < Set-Cookie: i_like_gitea=<Possible censor>; Path=/; HttpOnly < Set-Cookie: _csrf=<Possible Censor>; Path=/; Expires=Mon, 11 Mar 2019 18:32:25 GMT; HttpOnly < X-Frame-Options: SAMEORIGIN < * Connection #0 to host bloodygit.tejat.net left intact * Couldn't find host bloodygit.tejat.net in the .netrc file; using defaults * Found bundle for host bloodygit.tejat.net: 0x55fab803e290 [can pipeline] * Re-using existing connection! (#0) with host bloodygit.tejat.net * Connected to bloodygit.tejat.net (2607:fa18:8::10) port 443 (#0) > GET /BloodyRum/ServerOS.git/HEAD HTTP/1.1 Host: bloodygit.tejat.net User-Agent: git/2.17.1 Accept: */* Accept-Encoding: gzip Accept-Language: en-US, en;q=0.9, *;q=0.8 Pragma: no-cache * The requested URL returned error: 404 Not Found * stopped the pause stream! * Closing connection 0 * Couldn't find host bloodygit.tejat.net in the .netrc file; using defaults * Trying 2607:fa18:8::10... * TCP_NODELAY set * Connected to bloodygit.tejat.net (2607:fa18:8::10) port 443 (#0) * found 133 certificates in /etc/ssl/certs/ca-certificates.crt * found 401 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384 * server certificate verification OK * server certificate status verification SKIPPED * common name: bloodygit.tejat.net (matched) * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: CN=bloodygit.tejat.net * start date: Sat, 09 Mar 2019 02:26:12 GMT * expire date: Fri, 07 Jun 2019 02:26:12 GMT * issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3 * compression: NULL * ALPN, server accepted to use http/1.1 > PROPFIND /BloodyRum/ServerOS.git/ HTTP/1.1 Host: bloodygit.tejat.net User-Agent: git/2.17.1 Accept: */* Depth: 0 Content-Type: text/xml Content-Length: 181 Expect: 100-continue < HTTP/1.1 100 Continue * We are completely uploaded and fine * The requested URL returned error: 404 Not Found * stopped the pause stream! * Closing connection 0 error: Cannot access URL https://bloodygit.tejat.net/BloodyRum/ServerOS.git/, return code 22 fatal: git-http-push failed error: failed to push some refs to 'https://bloodygit.tejat.net/BloodyRum/ServerOS.git' ```
Author
Owner

@BloodyRum commented on GitHub (Mar 10, 2019):

I (The server operater because of me) found the problem, it was with the servers proxy_pass config.
As the server operator put it:

proxy_pass http://127.0.0.1:29172; # works
proxy_pass http://127.0.0.1:29172$uri; # does not work
proxy_pass http://127.0.0.1:29172$uri$is_args$args; # works
@BloodyRum commented on GitHub (Mar 10, 2019): I (The server operater because of me) found the problem, it was with the servers proxy_pass config. As the server operator put it: ```nginx proxy_pass http://127.0.0.1:29172; # works proxy_pass http://127.0.0.1:29172$uri; # does not work proxy_pass http://127.0.0.1:29172$uri$is_args$args; # works ```
Author
Owner

@zeripath commented on GitHub (Mar 10, 2019):

Glad you were able to work it out, sorry I wasn't of mutch help.

I suspected the problem was in the proxy set up but couldn't work out a way to prove it.

@zeripath commented on GitHub (Mar 10, 2019): Glad you were able to work it out, sorry I wasn't of mutch help. I suspected the problem was in the proxy set up but couldn't work out a way to prove it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3034