repo manifest with clone-depth="1". Server error Log:fatal:The remote end hung up unexpectedly

55 views
Skip to first unread message

Lucky Small Jian

unread,
Dec 26, 2017, 12:53:53 PM12/26/17
to Repo and Gerrit Discussion
  repo manifest with  clone-depth="1". when run "repo sync" our server have this error Log: fatal:The remote end hung up unexpectedly
  View access log,we find have the following correspondence:
  If the manifest with  clone-depth="1", even if there is no update, there will be two POST and correspond to the error time in Error_log.

 How can i solve it, thanks!!

access_log:
our IP - user1 [15/Dec/2017:13:01:51 +0900] "POST /repos/libfaad/git-upload-pack HTTP/1.1" 200 4 "-" "git/1.9.1" "user1 " 890 555
our IP - user1 [15/Dec/2017:13:01:52 +0900] "POST /repos/libfaad/git-upload-pack HTTP/1.1" 200 211 "-" "git/1.9.1" "user1" 901 1207
our IP - user1 [15/Dec/2017:13:02:03 +0900] "POST /repos/ibnl/git-upload-pack HTTP/1.1" 200 4 "-" "git/1.9.1" "user1"1130 778
our IP - user1 [15/Dec/2017:13:02:03 +0900] "POST /repos/libnl/git-upload-pack HTTP/1.1" 200 211 "-" "git/1.9.1" "user1 " 757 2019

error_log:
[Fri Dec 15 13:01:52 2017] [error] [client our IP] fatal: The remote end hung up unexpectedly
[Fri Dec 15 13:02:03 2017] [error] [client our IP] fatal: The remote end hung up unexpectedly

repolog:(GIT_CURL_VERBOSE=1)
> GET /repos/libfaad/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.9.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 401 Authorization Required
< Date: Fri, 15 Dec 2017 04:01:51 GMT
* Server Apache is not blacklisted
< Server: Apache
< WWW-Authenticate: Basic realm="Redmine Git Repository"
< Content-Length: 401
< Content-Type: text/html; charset=iso-8859-1
* Ignoring the response-body
* Connection #0 to host our.sourcecode.com left intact
* Found bundle for host our.sourcecode.com: 0x18d3cd0
* Re-using existing connection! (#0) with host our.sourcecode.com
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#0)
* Server auth using Basic with user 'user1'
> GET /repos/libfaad/info/refs?service=git-upload-pack HTTP/1.1
Authorization: Basic YmFpeGs6cWF6d3N4MTIzQlhLLg==
User-Agent: git/1.9.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 200 OK
< Date: Fri, 15 Dec 2017 04:01:51 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Transfer-Encoding: chunked
< Content-Type: application/x-git-upload-pack-advertisement
* Connection #0 to host our.sourcecode.com left intact
* Hostname was NOT found in DNS cache
*   Trying *.*.*.*...
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#1)
* found 1 certificates in /home/dtv16/ssl_key/private_ca.crt
* SSL re-using session ID
* server certificate verification SKIPPED
* common name: our.sourcecode.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: C=JP,ST=Kanagawa,L=Yokohama,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* start date: Thu, 24 Nov 2016 02:04:53 GMT

* expire date: Sun, 22 Nov 2026 02:04:53 GMT

* issuer: C=JP,ST=Kanagawa,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* compression: NULL
* cipher: AES-256-CBC
* MAC: SHA256
* Server auth using Basic with user 'user1'
> POST /repos/libfaad/git-upload-pack HTTP/1.1
Authorization: Basic YmFpeGs6cWF6d3N4MTIzQlhLLg==
User-Agent: git/1.9.1
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 207

* upload completely sent off: 207 out of 207 bytes
< HTTP/1.1 200 OK
< Date: Fri, 15 Dec 2017 04:01:51 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Content-Length: 4
< Content-Type: application/x-git-upload-pack-result
* Connection #1 to host our.sourcecode.com left intact
* Found bundle for host our.sourcecode.com: 0x18db930
* Re-using existing connection! (#1) with host our.sourcecode.com
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#1)
* Server auth using Basic with user 'user1'
> POST /repos/libfaad/git-upload-pack HTTP/1.1
Authorization: Basic YmFpeGs6cWF6d3N4MTIzQlhLLg==
User-Agent: git/1.9.1
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 316

* upload completely sent off: 316 out of 316 bytes
< HTTP/1.1 200 OK
< Date: Fri, 15 Dec 2017 04:01:52 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Transfer-Encoding: chunked
< Content-Type: application/x-git-upload-pack-result
* Connection #1 to host our.sourcecode.com left intact
* Hostname was NOT found in DNS cache
*   Trying *.*.*.*...
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#0)
* found 1 certificates in /home/dtv16/ssl_key/private_ca.crt
* server certificate verification SKIPPED
* common name: our.sourcecode.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: C=JP,ST=Kanagawa,L=Yokohama,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* start date: Thu, 24 Nov 2016 02:04:53 GMT

* expire date: Sun, 22 Nov 2026 02:04:53 GMT

* issuer: C=JP,ST=Kanagawa,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* compression: NULL
* cipher: AES-256-CBC
* MAC: SHA256
> GET /repos/libnl/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.9.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 401 Authorization Required
< Date: Fri, 15 Dec 2017 04:02:02 GMT
* Server Apache is not blacklisted
< Server: Apache
< WWW-Authenticate: Basic realm="Redmine Git Repository"
< Content-Length: 401
< Content-Type: text/html; charset=iso-8859-1
* Ignoring the response-body
* Connection #0 to host our.sourcecode.com left intact
* Found bundle for host our.sourcecode.com: 0x1f22cb0
* Re-using existing connection! (#0) with host our.sourcecode.com
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#0)
* Server auth using Basic with user 'user1'
> GET /repos/libnl/info/refs?service=git-upload-pack HTTP/1.1
Authorization: Basic YmFpeGs6cWF6d3N4MTIzQlhLLg==
User-Agent: git/1.9.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 200 OK
< Date: Fri, 15 Dec 2017 04:02:02 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Transfer-Encoding: chunked
< Content-Type: application/x-git-upload-pack-advertisement
* Connection #0 to host our.sourcecode.com left intact
* Hostname was NOT found in DNS cache
*   Trying *.*.*.*...
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#1)
* found 1 certificates in /home/dtv16/ssl_key/private_ca.crt
* SSL re-using session ID
* server certificate verification SKIPPED
* common name: our.sourcecode.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: C=JP,ST=Kanagawa,L=Yokohama,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* start date: Thu, 24 Nov 2016 02:04:53 GMT

* expire date: Sun, 22 Nov 2026 02:04:53 GMT

* issuer: C=JP,ST=Kanagawa,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* compression: NULL
* cipher: AES-256-CBC
* MAC: SHA256
* Server auth using Basic with user 'user1'
> POST /repos/libnl/git-upload-pack HTTP/1.1
Authorization: Basic YmFpeGs6cWF6d3N4MTIzQlhLLg==
User-Agent: git/1.9.1
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 207

* upload completely sent off: 207 out of 207 bytes
< HTTP/1.1 200 OK
< Date: Fri, 15 Dec 2017 04:02:03 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Transfer-Encoding: chunked
< Content-Type: application/x-git-upload-pack-result
* Connection #1 to host our.sourcecode.com left intact
* Found bundle for host our.sourcecode.com: 0x1f2a910
* Re-using existing connection! (#1) with host our.sourcecode.com
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#1)
* Server auth using Basic with user 'user1'
> POST /repos/libnl/git-upload-pack HTTP/1.1
Authorization: Basic YmFpeGs6cWF6d3N4MTIzQlhLLg==
User-Agent: git/1.9.1
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 316

* upload completely sent off: 316 out of 316 bytes
< HTTP/1.1 200 OK
< Date: Fri, 15 Dec 2017 04:02:03 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Transfer-Encoding: chunked
< Content-Type: application/x-git-upload-pack-result
* Connection #1 to host our.sourcecode.com left intact
* Hostname was NOT found in DNS cache
*   Trying *.*.*.*...
* Connected to our.sourcecode.com (*.*.*.*) port 443 (#0)
* found 1 certificates in /home/dtv16/ssl_key/private_ca.crt
* server certificate verification SKIPPED
* common name: our.sourcecode.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: C=JP,ST=Kanagawa,L=Yokohama,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* start date: Thu, 24 Nov 2016 02:04:53 GMT

* expire date: Sun, 22 Nov 2026 02:04:53 GMT

* issuer: C=JP,ST=Kanagawa,O=ComS,OU=IT,CN=our.sourcecode.com,EMAIL=*******
* compression: NULL
* cipher: AES-256-CBC
* MAC: SHA256


Message has been deleted

Lucky Small Jian

unread,
Jan 9, 2018, 8:58:01 AM1/9/18
to Repo and Gerrit Discussion
Thank you, the reason for the problem has been found:
Shallow clone (git clone --depth=1 http://foo/bar.git) uses three request-response cycles (GET, POST, POST) while normal cloning uses only two (GET, POST). There is a bug in the server side Git implementation of 'git clone' (git-upload-pack) where it expects the third request to come on the same connection as the second request. 
The result is that the server side Git code returns a non-zero exit status after the second request/response cycle is done. This does not affect the client, which happily makes its three requests to get a shallow clone.

在 2017年12月27日星期三 UTC+8上午1:53:53,Lucky Small Jian写道:
Reply all
Reply to author
Forward
0 new messages