Unable to connect Stash server to remote Github repo

XMLWordPrintable

    • Type: Bug
    • Resolution: Handled by Support
    • Priority: High
    • None
    • Affects Version/s: 2.8.2
    • Component/s: None
    • None

      We are attempting to mirror a GitHub repository to our Stash server per these instructions:

      https://confluence.atlassian.com/display/STASH/Importing+code+from+an+existing+project#Importingcodefromanexistingproject-MirroranexistingGitrepository

      Complete import attempts began by following instructions from Stash online help. The git push --all stash command failed with this error, though:

      $ git push --all stash
      Password for 'https://daniel.mccallum213@code.sinclair.edu':
      Counting objects: 67811, done.
      Delta compression using up to 8 threads.
      Compressing objects: 100% (19356/19356), done.
      Unable to rewind rpc post data - try increasing http.postBuffer
      error: RPC failed; result=65, HTTP code = 0
      fatal: The remote end hung up unexpectedly
      Writing objects: 100% (67811/67811), 43.42 MiB | 5 KiB/s, done.
      Total 67811 (delta 41272), reused 67630 (delta 41120)
      fatal: The remote end hung up unexpectedly
      Everything up-to-date

      Attempts to increase http.postBuffer as suggested by Stash online help and many blog posts resulted in a different error, effectively a HTTP 404:

      $ git config http.postBuffer 209715200
      $ git push --all stash
      Password for 'https://daniel.mccallum213@code.sinclair.edu':
      Counting objects: 67811, done.
      Delta compression using up to 8 threads.
      Compressing objects: 100% (19356/19356), done.
      Writing objects: 100% (67811/67811), 43.42 MiB | 59.62 MiB/s, done.
      Total 67811 (delta 41272), reused 67630 (delta 41120)
      error: RPC failed; result=22, HTTP code = 404
      fatal: The remote end hung up unexpectedly
      fatal: The remote end hung up unexpectedly
      Everything up-to-date

      After increasing the IIS request size limits the error changed again, but was similarly uninformative and continued to occur after a long wait, implying some sort of timeout:

      $ git push --all stash
      Password for 'https://daniel.mccallum213@code.sinclair.edu':
      Counting objects: 67811, done.
      Delta compression using up to 8 threads.
      Compressing objects: 100% (19356/19356), done.
      Writing objects: 100% (67811/67811), 43.42 MiB | 60.69 MiB/s, done.
      Total 67811 (delta 41272), reused 67630 (delta 41120)
      error: RPC failed; result=56, HTTP code = 0
      fatal: The remote end hung up unexpectedly
      fatal: The remote end hung up unexpectedly
      Everything up-to-date

      The same problem persisted after explicitly unsetting any request size limits in Tomcat Connector config.

      We then attempted to push to the same URL, but with the hosts file configured to resolve our Stash URL (code.sinclair.edu) to 127.0.0.1 and IIS configured to accept https requests on all available IPs. This did not change the error message nor timeout-ish behavior.

      The final workaround reconfigured the Git stash remote to point directly at Tomcat, i.e. port 7990 on localhost. Obviously, the import was run directly from a command prompt on the Stash host.

      Curl Debugging Output Trying to Push to code.sinclair.edu:

      $ git remote -v
      origin git@github.com:Jasig/SSP.git (fetch)
      origin git@github.com:Jasig/SSP.git (push)
      stash https://daniel.mccallum213@code.sinclair.edu/scm/sspos/ssp.git (fetch)
      stash https://daniel.mccallum213@code.sinclair.edu/scm/sspos/ssp.git (push)
      stash2 https://daniel.mccallum213@code.sinclair.edu/scm/sspos/ssp-dm.git (fetch)
      stash2 https://daniel.mccallum213@code.sinclair.edu/scm/sspos/ssp-dm.git (push)
      $ GIT_CURL_VERBOSE=1 git push stash2 rel-2-1-patches

      • Couldn't find host code.sinclair.edu in the .netrc file; using defaults
      • About to connect() to code.sinclair.edu port 443 (#0)
      • Trying 140.106.224.161...
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • SSL connection using AES128-SHA
      • Server certificate:
      • subject: C=US; ST=Ohio; L=Dayton; OU=PAR07956_mfiszlew; O=Sinclair Community College; CN=*.sinclair.edu
      • start date: 2011-05-19 16:42:17 GMT
      • expire date: 2014-05-19 16:42:12 GMT
      • subjectAltName: code.sinclair.edu matched
      • issuer: OU=Organization Validation CA; O=GlobalSign; CN=GlobalSign Organization Validation CA
      • SSL certificate verify ok.
        > GET /scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack HTTP/1.1
        User-Agent: git/1.7.11.3
        Host: code.sinclair.edu
        Accept: /
        Pragma: no-cache

      < HTTP/1.1 401 Unauthorized
      < Content-Type: text/html
      < Server: Microsoft-IIS/7.5
      < X-AREQUESTID: 890x5812x1
      < X-XSS-Protection: 1; mode=block
      < X-Frame-Options: SAMEORIGIN
      < X-Content-Type-Options: nosniff
      < WWW-Authenticate: Basic realm="Atlassian Stash"
      < Date: Mon, 25 Nov 2013 19:50:21 GMT
      < Content-Length: 1293
      <

      • Ignoring the response-body
      • Connection #0 to host code.sinclair.edu left intact
      • Issue another request to this URL: 'https://daniel.mccallum213@code.sinclair.edu/scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack'
      • Couldn't find host code.sinclair.edu in the .netrc file; using defaults
      • Re-using existing connection! (#0) with host (nil)
      • Connected to (nil) (140.106.224.161) port 443 (#0)
      • Server auth using Basic with user 'daniel.mccallum213'
        > GET /scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack HTTP/1.1
        Authorization: Basic ZGFuaWVsLm1jY2FsbHVtMjEzOg==
        User-Agent: git/1.7.11.3
        Host: code.sinclair.edu
        Accept: /
        Pragma: no-cache

      < HTTP/1.1 401 Unauthorized
      < Content-Type: text/html
      < Server: Microsoft-IIS/7.5
      < X-AREQUESTID: 890x5813x1
      < Set-Cookie: JSESSIONID=39406C1FEB76109D7479B1C2EAAA561C; Path=/; Secure; HttpOnly < Set-Cookie: _atl_stash_remember_me=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/

      • Authentication problem. Ignoring this.
        < WWW-Authenticate: Basic realm="Atlassian Stash"
        < Date: Mon, 25 Nov 2013 19:50:21 GMT
        < Content-Length: 1293
      • The requested URL returned error: 401
      • Closing connection #0
        Password for 'https://daniel.mccallum213@code.sinclair.edu':
      • Couldn't find host code.sinclair.edu in the .netrc file; using defaults
      • About to connect() to code.sinclair.edu port 443 (#0)
      • Trying 140.106.224.161...
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • SSL re-using session ID
      • SSL connection using AES128-SHA
      • Server certificate:
      • subject: C=US; ST=Ohio; L=Dayton; OU=PAR07956_mfiszlew; O=Sinclair Community College; CN=*.sinclair.edu
      • start date: 2011-05-19 16:42:17 GMT
      • expire date: 2014-05-19 16:42:12 GMT
      • subjectAltName: code.sinclair.edu matched
      • issuer: OU=Organization Validation CA; O=GlobalSign; CN=GlobalSign Organization Validation CA
      • SSL certificate verify ok.
      • Server auth using Basic with user 'daniel.mccallum213'
        > GET /scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack HTTP/1.1
        Authorization: Basic ZGFuaWVsLm1jY2FsbHVtMjEzOhtbQV4xd3dJRD9raD5BZQ==
        User-Agent: git/1.7.11.3
        Host: code.sinclair.edu
        Accept: /
        Pragma: no-cache

      < HTTP/1.1 401 Unauthorized
      < Content-Type: text/html
      < Server: Microsoft-IIS/7.5
      < X-AREQUESTID: 890x5814x1
      < Set-Cookie: JSESSIONID=BAB566FEB6C73418BD0490C9507F5BEC; Path=/; Secure; HttpOnly < Set-Cookie: _atl_stash_remember_me=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/

      • Authentication problem. Ignoring this.
        < WWW-Authenticate: Basic realm="Atlassian Stash"
        < Date: Mon, 25 Nov 2013 19:50:37 GMT
        < Content-Length: 1293
      • The requested URL returned error: 401
      • Closing connection #0
        fatal: Authentication failed
        dmccallum@dmccallum-mbp:~/tmp/sinclair-ssp/SSP.git (BARE:master)$ GIT_CURL_VERBOSE=1 git push stash2 rel-2-1-patches
      • Couldn't find host code.sinclair.edu in the .netrc file; using defaults
      • About to connect() to code.sinclair.edu port 443 (#0)
      • Trying 140.106.224.161...
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • SSL connection using AES128-SHA
      • Server certificate:
      • subject: C=US; ST=Ohio; L=Dayton; OU=PAR07956_mfiszlew; O=Sinclair Community College; CN=*.sinclair.edu
      • start date: 2011-05-19 16:42:17 GMT
      • expire date: 2014-05-19 16:42:12 GMT
      • subjectAltName: code.sinclair.edu matched
      • issuer: OU=Organization Validation CA; O=GlobalSign; CN=GlobalSign Organization Validation CA
      • SSL certificate verify ok.
        > GET /scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack HTTP/1.1
        User-Agent: git/1.7.11.3
        Host: code.sinclair.edu
        Accept: /
        Pragma: no-cache

      < HTTP/1.1 401 Unauthorized
      < Content-Type: text/html
      < Server: Microsoft-IIS/7.5
      < X-AREQUESTID: 890x5815x1
      < X-XSS-Protection: 1; mode=block
      < X-Frame-Options: SAMEORIGIN
      < X-Content-Type-Options: nosniff
      < WWW-Authenticate: Basic realm="Atlassian Stash"
      < Date: Mon, 25 Nov 2013 19:50:41 GMT
      < Content-Length: 1293
      <

      • Ignoring the response-body
      • Connection #0 to host code.sinclair.edu left intact
      • Issue another request to this URL: 'https://daniel.mccallum213@code.sinclair.edu/scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack'
      • Couldn't find host code.sinclair.edu in the .netrc file; using defaults
      • Re-using existing connection! (#0) with host (nil)
      • Connected to (nil) (140.106.224.161) port 443 (#0)
      • Server auth using Basic with user 'daniel.mccallum213'
        > GET /scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack HTTP/1.1
        Authorization: Basic ZGFuaWVsLm1jY2FsbHVtMjEzOg==
        User-Agent: git/1.7.11.3
        Host: code.sinclair.edu
        Accept: /
        Pragma: no-cache

      < HTTP/1.1 401 Unauthorized
      < Content-Type: text/html
      < Server: Microsoft-IIS/7.5
      < X-AREQUESTID: 890x5816x1
      < Set-Cookie: JSESSIONID=498E5FFEBB5E829D25380E925ADDA281; Path=/; Secure; HttpOnly < Set-Cookie: _atl_stash_remember_me=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/

      • Authentication problem. Ignoring this.
        < WWW-Authenticate: Basic realm="Atlassian Stash"
        < Date: Mon, 25 Nov 2013 19:50:41 GMT
        < Content-Length: 1293
      • The requested URL returned error: 401
      • Closing connection #0
        Password for 'https://daniel.mccallum213@code.sinclair.edu':
      • Couldn't find host code.sinclair.edu in the .netrc file; using defaults
      • About to connect() to code.sinclair.edu port 443 (#0)
      • Trying 140.106.224.161...
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • SSL re-using session ID
      • SSL connection using AES128-SHA
      • Server certificate:
      • subject: C=US; ST=Ohio; L=Dayton; OU=PAR07956_mfiszlew; O=Sinclair Community College; CN=*.sinclair.edu
      • start date: 2011-05-19 16:42:17 GMT
      • expire date: 2014-05-19 16:42:12 GMT
      • subjectAltName: code.sinclair.edu matched
      • issuer: OU=Organization Validation CA; O=GlobalSign; CN=GlobalSign Organization Validation CA
      • SSL certificate verify ok.
      • Server auth using Basic with user 'daniel.mccallum213'
        > GET /scm/sspos/ssp-dm.git/info/refs?service=git-receive-pack HTTP/1.1
        Authorization: Basic ZGFuaWVsLm1jY2FsbHVtMjEzOl4xd3dJRD9raD5BZQ==
        User-Agent: git/1.7.11.3
        Host: code.sinclair.edu
        Accept: /
        Pragma: no-cache

      < HTTP/1.1 200 OK
      < Cache-Control: no-cache, max-age=0, must-revalidate < Pragma: no-cache < Content-Length: 183 < Content-Type: application/x-git-receive-pack-advertisement
      < Expires: Fri, 01 Jan 1980 00:00:00 GMT < Server: Microsoft-IIS/7.5 < X-AREQUESTID: 890x5817x1 < Set-Cookie: JSESSIONID=0AF74D10636A18834E1ED4160E5747FB; Path=/; Secure; HttpOnly < X-AUSERNAME: daniel.mccallum213 < X-ASESSIONID: 15tqetw < X-XSS-Protection: 1; mode=block < X-Frame-Options: SAMEORIGIN < X-Content-Type-Options: nosniff < Date: Mon, 25 Nov 2013 19:50:45 GMT <

      • Connection #0 to host code.sinclair.edu left intact Counting objects: 61727, done.
        Delta compression using up to 8 threads.
        Compressing objects: 100% (18507/18507), done.
        Writing objects: 100% (61727/61727), 42.17 MiB, done.
        Total 61727 (delta 37811), reused 60423 (delta 36702)
      • Couldn't find host code.sinclair.edu in the .netrc file; using defaults
      • About to connect() to code.sinclair.edu port 443 (#0)
      • Trying 140.106.224.161...
      • connected
      • Connected to code.sinclair.edu (140.106.224.161) port 443 (#0)
      • SSL re-using session ID
      • SSL connection using AES128-SHA
      • Server certificate:
      • subject: C=US; ST=Ohio; L=Dayton; OU=PAR07956_mfiszlew; O=Sinclair Community College; CN=*.sinclair.edu
      • start date: 2011-05-19 16:42:17 GMT
      • expire date: 2014-05-19 16:42:12 GMT
      • subjectAltName: code.sinclair.edu matched
      • issuer: OU=Organization Validation CA; O=GlobalSign; CN=GlobalSign Organization Validation CA
      • SSL certificate verify ok.
      • Server auth using Basic with user 'daniel.mccallum213'
        > POST /scm/sspos/ssp-dm.git/git-receive-pack HTTP/1.1
        Authorization: Basic ZGFuaWVsLm1jY2FsbHVtMjEzOl4xd3dJRD9raD5BZQ==
        User-Agent: git/1.7.11.3
        Host: code.sinclair.edu
        Accept-Encoding: deflate, gzip
        Content-Type: application/x-git-receive-pack-request
        Accept: application/x-git-receive-pack-result
        Content-Length: 44215497
      • SSL read: error:00000000:lib(0):func(0):reason(0), errno 54
      • Closing connection #0
        error: RPC failed; result=56, HTTP code = 0
        fatal: The remote end hung up unexpectedly
        fatal: The remote end hung up unexpectedly Everything up-to-date

            Assignee:
            Unassigned
            Reporter:
            Lance Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: