Any Help for error 501 When cloning from GIT command line?

Sam Stansfield February 15, 2018

I am developing a plugin for BitBucket to support our single sign on solution. 

It’s a single-sign on solution for PKI cert integration. When a user goes to bitbucket rather than form authentication my plugin checks to see if there is a Crowd Token. If one does not exist bitbucket will redirect the user to our hosted single sign on application that reads the PKI certificate and authenticates them through crowd and creates an SSO Token. The application then redirects the user back to bitbucket where it can now read a valid Crowd token and authenticate the user. This all works through the web. However through git we are getting an error 501 Not Implemented when trying to clone repositories. We have configured git with the ssl cert and key, to store cookies for the crowd token, etc. And when I try to clone a repository through git I can trace in the BitBucket debug logs where the authentication is happening and it appears to be successful. However we are then presented with the error 501 Not Implemented.

I did some research but the only documentation I can find on this issue is this confluence page https://confluence.atlassian.com/stashkb/git-commands-return-error-code-501-282988872.html

I have verified that our git version is recent enough. The issue is that error 501 is vague and I'm not seeing a specific breakpoint in the debug logs, so anybody that has experience with this type of issue would be a great help.

1 answer

0 votes
Tom Davies
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 15, 2018

The KB entry suggests that the 501 error occurs when your git client falls back to a type of HTTP access that Bitbucket Server doesn't support, because using 'smart HTTP' failed -- so the root cause is some error on the previous request that the git client is making to BBS.

You might be able to discover more by running 'GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_PERFORMANCE=2 GIT_TRACE_PACK_ACCESS=2 GIT_TRACE_PACKET=2 GIT_TRACE_PACKFILE=2 GIT_TRACE_SETUP=2 GIT_TRACE_SHALLOW=2 git clone ...'

(Most of those options are probably not relevant to this particular problem, but I don't know exactly what they do, so best to include them)

You could also monitor the network traffic between BBS and your git client, to try to see the previous error.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events