Git commands return error code 501

Troubleshooting Git

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When pulling from, pushing or cloning to Stash, it responds with the error code 501.

$ git clone url directory
Cloning into 'directory'...
error: The requested URL returned error: 501 while accessing url
fatal: HTTP request failed

Or it may respond with a error code 22:

$ git push url
error: Cannot access URL http://test@bushbeer:7990/git/TEST/test2.git/, return code 22
error: failed to push some refs to 'http://test@bushbeer:7990/git/TEST/test2.git'

Cause

Git has 2 protocols when connecting over HTTP. Stash supports "smart HTTP", but will return a 501 for normal HTTP. This can mean one of two things:

  1. You are using an older version of Git which doesn't support "smart HTTP".
  2. There was a transient issue on the server, and your Git client tried normal HTTP as a fallback.
For more background on the Git "smart HTTP" protocol, see the Pro-Git online book.

Resolution

In the first case, you'll need to upgrade your client-side version of Git. You need Git 1.6.6 or later on the client side.

In the second case, you can just try the command again. A possible cause of these transient issues may be that your server is hitting resource limits. See Scaling Stash for details.

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Last modified on Mar 15, 2013

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.