Cannot Git Clone: fatal: HTTP request failed 400 error

Carlysle McNaught October 22, 2015

I am configuring git with Stash for the first time and I am unable to clone the repository that I have created. I have done 

git config --global user.name 
git config --global user.email
 

The log file of the git clone show:

 

trace: run_command: 'git-remote-https' 'https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git' 'https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git'

Initialized empty Git repository in /home/cmcnaug1/cddis-stats/.git/

trace: run_command: '/usr/libexec/openssh/gnome-ssh-askpass' 'Password: '

* Couldn't find host git.earthdata.nasa.gov in the .netrc file; using defaults

* About to connect() to git.earthdata.nasa.gov port 443 (#0)

*   Trying 198.118.243.114... * Connected to git.earthdata.nasa.gov (198.118.243.114) port 443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

*   CAfile: /etc/pki/tls/certs/ca-bundle.crt

  CApath: none

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*  subject: CN=git.earthdata.nasa.gov,serialNumber=29-07-1958,businessCategory=Government Entity,O=NASA (National Aeronautics and Space Administration),incorporationCountry=US,L=Greenbelt,ST=Maryland,C=US

*  start date: Aug 20 18:45:56 2014 GMT

*  expire date: Oct 02 02:54:07 2016 GMT

*  common name: git.earthdata.nasa.gov

*  issuer: CN=Entrust Certification Authority - L1E,OU="(c) 2009 Entrust, Inc.",OU=www.entrust.net/rpa is incorporated by reference,O="Entrust, Inc.",C=US

> GET /scm/cddisstats/cddis-stats.git/info/refs?service=git-upload-pack HTTP/1.1

User-Agent: git/1.7.1

Host: git.earthdata.nasa.gov

Accept: */*

Pragma: no-cache

 

< HTTP/1.1 401 Unauthorized

< Date: Thu, 22 Oct 2015 18:34:21 GMT

< Server: Apache-Coyote/1.1

< X-AREQUESTID: @UAXEPFx874x1199104x6

< X-ASEN: SEN-2367362

< X-XSS-Protection: 1; mode=block

< X-Frame-Options: SAMEORIGIN

< X-Content-Type-Options: nosniff

< WWW-Authenticate: Basic realm="Atlassian Stash"

< Content-Length: 0

< Connection: close

< Content-Type: text/plain; charset=UTF-8

* Expire cleared

* Closing connection #0

* Issue another request to this URL: 'https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git/info/refs?service=git-upload-pack'

* Couldn't find host git.earthdata.nasa.gov in the .netrc file; using defaults

* About to connect() to git.earthdata.nasa.gov port 443 (#0)

*   Trying 198.118.243.114... * Connected to git.earthdata.nasa.gov (198.118.243.114) port 443 (#0)

*   CAfile: /etc/pki/tls/certs/ca-bundle.crt

  CApath: none

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*  subject: CN=git.earthdata.nasa.gov,serialNumber=29-07-1958,businessCategory=Government Entity,O=NASA (National Aeronautics and Space Administration),incorporationCountry=US,L=Greenbelt,ST=Maryland,C=US

*  start date: Aug 20 18:45:56 2014 GMT

*  expire date: Oct 02 02:54:07 2016 GMT

*  common name: git.earthdata.nasa.gov

*  issuer: CN=Entrust Certification Authority - L1E,OU="(c) 2009 Entrust, Inc.",OU=www.entrust.net/rpa is incorporated by reference,O="Entrust, Inc.",C=US

* Server auth using Basic with user 'cmcnaught92'

> GET /scm/cddisstats/cddis-stats.git/info/refs?service=git-upload-pack HTTP/1.1

User-Agent: git/1.7.1

Host: git.earthdata.nasa.gov

Accept: */*

Pragma: no-cache

 

< HTTP/1.1 401 Unauthorized

< Date: Thu, 22 Oct 2015 18:34:21 GMT

< Server: Apache-Coyote/1.1

< X-AREQUESTID: @UAXEPFx874x1199105x6

< X-ASEN: SEN-2367362

* Authentication problem. Ignoring this.

< WWW-Authenticate: Basic realm="Atlassian Stash"

< Content-Length: 0

< Connection: close

< Content-Type: text/plain; charset=UTF-8

* The requested URL returned error: 401

* Closing connection #0

* Couldn't find host git.earthdata.nasa.gov in the .netrc file; using defaults

* About to connect() to git.earthdata.nasa.gov port 443 (#0)

*   Trying 198.118.243.114... * Connected to git.earthdata.nasa.gov (198.118.243.114) port 443 (#0)

*   CAfile: /etc/pki/tls/certs/ca-bundle.crt

  CApath: none

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*  subject: CN=git.earthdata.nasa.gov,serialNumber=29-07-1958,businessCategory=Government Entity,O=NASA (National Aeronautics and Space Administration),incorporationCountry=US,L=Greenbelt,ST=Maryland,C=US

*  start date: Aug 20 18:45:56 2014 GMT

*  expire date: Oct 02 02:54:07 2016 GMT

*  common name: git.earthdata.nasa.gov

*  issuer: CN=Entrust Certification Authority - L1E,OU="(c) 2009 Entrust, Inc.",OU=www.entrust.net/rpa is incorporated by reference,O="Entrust, Inc.",C=US

* Server auth using Basic with user 'cmcnaught92'

> GET /scm/cddisstats/cddis-stats.git/info/refs HTTP/1.1

User-Agent: git/1.7.1

Host: git.earthdata.nasa.gov

Accept: */*

Pragma: no-cache

 

* The requested URL returned error: 400 Bad Request

* Closing connection #0

error: The requested URL returned error: 400 Bad Request while accessing https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git/info/refs

 

fatal: HTTP request failed

[cmcnaug1@gs690-cddis1 ~]$ set GIT_CURL_VERBOSE=1

[cmcnaug1@gs690-cddis1 ~]$ source git-debug-clone https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git

trace: built-in: git 'clone' '--verbose' 'https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git'

trace: run_command: 'git-remote-https' 'https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git' 'https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git'

Initialized empty Git repository in /home/cmcnaug1/cddis-stats/.git/

trace: run_command: '/usr/libexec/openssh/gnome-ssh-askpass' 'Password: '

* Couldn't find host git.earthdata.nasa.gov in the .netrc file; using defaults

* About to connect() to git.earthdata.nasa.gov port 443 (#0)

*   Trying 198.118.243.114... * Connected to git.earthdata.nasa.gov (198.118.243.114) port 443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

*   CAfile: /etc/pki/tls/certs/ca-bundle.crt

  CApath: none

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*  subject: CN=git.earthdata.nasa.gov,serialNumber=29-07-1958,businessCategory=Government Entity,O=NASA (National Aeronautics and Space Administration),incorporationCountry=US,L=Greenbelt,ST=Maryland,C=US

*  start date: Aug 20 18:45:56 2014 GMT

*  expire date: Oct 02 02:54:07 2016 GMT

*  common name: git.earthdata.nasa.gov

*  issuer: CN=Entrust Certification Authority - L1E,OU="(c) 2009 Entrust, Inc.",OU=www.entrust.net/rpa is incorporated by reference,O="Entrust, Inc.",C=US

> GET /scm/cddisstats/cddis-stats.git/info/refs?service=git-upload-pack HTTP/1.1

User-Agent: git/1.7.1

Host: git.earthdata.nasa.gov

Accept: */*

Pragma: no-cache

 

< HTTP/1.1 401 Unauthorized

< Date: Thu, 22 Oct 2015 18:41:44 GMT

< Server: Apache-Coyote/1.1

< X-AREQUESTID: @UAXEPFx881x1199524x6

< X-ASEN: SEN-2367362

< X-XSS-Protection: 1; mode=block

< X-Frame-Options: SAMEORIGIN

< X-Content-Type-Options: nosniff

< WWW-Authenticate: Basic realm="Atlassian Stash"

< Content-Length: 0

< Connection: close

< Content-Type: text/plain; charset=UTF-8

* Expire cleared

* Closing connection #0

* Issue another request to this URL: 'https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git/info/refs?service=git-upload-pack'

* Couldn't find host git.earthdata.nasa.gov in the .netrc file; using defaults

* About to connect() to git.earthdata.nasa.gov port 443 (#0)

*   Trying 198.118.243.114... * Connected to git.earthdata.nasa.gov (198.118.243.114) port 443 (#0)

*   CAfile: /etc/pki/tls/certs/ca-bundle.crt

  CApath: none

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*  subject: CN=git.earthdata.nasa.gov,serialNumber=29-07-1958,businessCategory=Government Entity,O=NASA (National Aeronautics and Space Administration),incorporationCountry=US,L=Greenbelt,ST=Maryland,C=US

*  start date: Aug 20 18:45:56 2014 GMT

*  expire date: Oct 02 02:54:07 2016 GMT

*  common name: git.earthdata.nasa.gov

*  issuer: CN=Entrust Certification Authority - L1E,OU="(c) 2009 Entrust, Inc.",OU=www.entrust.net/rpa is incorporated by reference,O="Entrust, Inc.",C=US

* Server auth using Basic with user 'cmcnaught92'

> GET /scm/cddisstats/cddis-stats.git/info/refs?service=git-upload-pack HTTP/1.1

User-Agent: git/1.7.1

Host: git.earthdata.nasa.gov

Accept: */*

Pragma: no-cache

 

< HTTP/1.1 401 Unauthorized

< Date: Thu, 22 Oct 2015 18:41:44 GMT

< Server: Apache-Coyote/1.1

< X-AREQUESTID: @UAXEPFx881x1199525x6

< X-ASEN: SEN-2367362

* Authentication problem. Ignoring this.

< WWW-Authenticate: Basic realm="Atlassian Stash"

< Content-Length: 0

< Connection: close

< Content-Type: text/plain; charset=UTF-8

* The requested URL returned error: 401

* Closing connection #0

* Couldn't find host git.earthdata.nasa.gov in the .netrc file; using defaults

* About to connect() to git.earthdata.nasa.gov port 443 (#0)

*   Trying 198.118.243.114... * Connected to git.earthdata.nasa.gov (198.118.243.114) port 443 (#0)

*   CAfile: /etc/pki/tls/certs/ca-bundle.crt

  CApath: none

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*  subject: CN=git.earthdata.nasa.gov,serialNumber=29-07-1958,businessCategory=Government Entity,O=NASA (National Aeronautics and Space Administration),incorporationCountry=US,L=Greenbelt,ST=Maryland,C=US

*  start date: Aug 20 18:45:56 2014 GMT

*  expire date: Oct 02 02:54:07 2016 GMT

*  common name: git.earthdata.nasa.gov

*  issuer: CN=Entrust Certification Authority - L1E,OU="(c) 2009 Entrust, Inc.",OU=www.entrust.net/rpa is incorporated by reference,O="Entrust, Inc.",C=US

* Server auth using Basic with user 'cmcnaught92'

> GET /scm/cddisstats/cddis-stats.git/info/refs HTTP/1.1

User-Agent: git/1.7.1

Host: git.earthdata.nasa.gov

Accept: */*

Pragma: no-cache

 

* The requested URL returned error: 400 Bad Request

* Closing connection #0

error: The requested URL returned error: 400 Bad Request while accessing https://cmcnaught92@git.earthdata.nasa.gov/scm/cddisstats/cddis-stats.git/info/refs

 

fatal: HTTP request failed

3 answers

0 votes
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 23, 2015

It seems like it's saying you don't have the correct permissions on Bitbucket Server (Stash).  Which is weird if you created the repo.  Are you using the same account to authenticate as you used to create the repo?  Maybe double check the permissions on the repo itself in the Stash web UI?

Carlysle McNaught October 27, 2015

Sorry for the delay, I am restricted in how frequently I can post on here. Yes I am using the same account and I have double checked the permissions. I am also now blocked by a CAPTCHA and i'm not sure how to clear it.

Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2015

I upvoted your question, which may help with your ability to post more regularly. You should be able to clear the CAPTCHA by logging into the web interface. That would prevent the git authentication from working, I think.

Carlysle McNaught October 27, 2015

I logged into the Web Interface: git.earthdata.nasa.gov, then logged out and tried to do a git clone again and it is still saying my Stash account has been marked as requiring a CAPTCHA to be solved before I may login again.

Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2015

That's strange. Are you an admin on the Stash instance?

0 votes
Carlysle McNaught October 23, 2015

Yes it does

0 votes
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2015

Is it asking you for a password at any point?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events