Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-2966

Shouldn't supply a response body to Git clients when returning 401 response

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 2.0.3
    • 2.0.1
    • Git Hosting
    • None

      A reported a problem with cloning repositories via HTTP with recent versions of Git.

      Either due to a change in git or a particular version of libcurl git was compiled against the Not Authenticated String Stash sends back to the client causes git to not identify the repository as supporting the smart HTTP protocol.

      Symptoms: a clone attempt aborts with

      fatal: http://user@example.com:7990/scm/PROJECT/repo.git/info/refs not valid: is this a git repository?
      

      To workaround this problem, Stash should supply an empty response body when returning a 401 to the git client.

          Form Name

            [BSERV-2966] Shouldn't supply a response body to Git clients when returning 401 response

            Certain combinations of git and libcurl (exact combinations are still tbd) don't cope with the response body Stash used to return up to version 2.0.3.

            GIT Version Curl version Works?
            <= 1.7.12.2 7.19.7
            1.7.12.3 7.19.7
            1.8.0.2 7.19.7
            1.7.12.3 7.28.1
            1.8.0.2 7.28.1

            This seems to particularly affect CentOS which ships with somewhat old versions of libcurl. E.g. CentOS 6.3 with curl-devel-7.19.7; CentOS 5.8 with curl-devel-7.15.5.

            Workaround: Preferred: upgrade to Stash 2.0.3 or 2.1 or higher. If that isn't possible, please compile git against a more recent version of libcurl.

            Libcurl:

            curl -OL http://curl.haxx.se/download/curl-7.28.1.tar.gz
            tar xfz curl-7.28.1.tar.gz
            cd curl-7.28.1
            ./configure --enable-http --prefix=/opt/curl-7.28.1
            make
            sudo make install
            

            git:

            make configure
            ./configure --prefix=/opt/git-1.8.0.2 --with-curl=/opt/curl-7.28.1
            make
            sudo make install
            

            Stefan Saasen (Inactive) added a comment - Certain combinations of git and libcurl (exact combinations are still tbd) don't cope with the response body Stash used to return up to version 2.0.3. GIT Version Curl version Works? <= 1.7.12.2 7.19.7 1.7.12.3 7.19.7 1.8.0.2 7.19.7 1.7.12.3 7.28.1 1.8.0.2 7.28.1 This seems to particularly affect CentOS which ships with somewhat old versions of libcurl . E.g. CentOS 6.3 with curl-devel-7.19.7; CentOS 5.8 with curl-devel-7.15.5. Workaround : Preferred: upgrade to Stash 2.0.3 or 2.1 or higher. If that isn't possible, please compile git against a more recent version of libcurl. Libcurl: curl -OL http: //curl.haxx.se/download/curl-7.28.1.tar.gz tar xfz curl-7.28.1.tar.gz cd curl-7.28.1 ./configure --enable-http --prefix=/opt/curl-7.28.1 make sudo make install git: make configure ./configure --prefix=/opt/git-1.8.0.2 --with-curl=/opt/curl-7.28.1 make sudo make install

              tim@atlassian.com TimP
              tim@atlassian.com TimP
              Affected customers:
              0 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: