4

Mac OS X 10.6.6 Server git version for both client and server is: 1.7.3.5

Error returned is:

Chris-Muenchs-Mac-Book-Pro:Desktop cmuench$ git clone http://example.com/is.git
Cloning into is...
Username: 
Password: 
error: The requested URL returned error: 401 (curl_result = 22, http_code = 401, sha1 = 8fbb19449c4388ae4b51594af3507bfd44c567d7)
error: Unable to find 8fbb19449c4388ae4b51594af3507bfd44c567d7 under http://example.com/is.git
Cannot obtain needed commit 8fbb19449c4388ae4b51594af3507bfd44c567d7
while processing commit 129e0ba31589356b9c4326907ddf7e11d7b6be18.
error: Fetch failed.

The above referenced commit sha1 exists in the repo and I am able to clone via the file system, but not over http or https.

Here is my apache settings: (WebDav is ON) (Defined above this snippet)

<Location "/is.git">
    AuthType Basic
    <Limit GET HEAD OPTIONS CONNECT POST PROPFIND PUT DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
        Require group  development
    </Limit>
    AuthName "is.git"
</Location>

Any ideas on how to fix this?

1
  • I added my username and was able to clone, but now I can't push: PUT error: curl result=22, HTTP code=403 Commented Mar 9, 2011 at 20:27

2 Answers 2

12

Overview

The HTTP 401 means that the request requires user authentication, refer to HTTP Status Codes.

Assuming that you entered the correct username and password, the 401 response means that maybe the credentials are not being submitted correctly or maybe the credentials are not being authenticated well. Ignore this line.

Real Problem

The next 3 lines however indicate where the real issue lies.

     error: Unable to find 8fbb19449c4388ae4b51594af3507bfd44c567d7 under http://example.com/is.git
     Cannot obtain needed commit 8fbb19449c4388ae4b51594af3507bfd44c567d7
     while processing commit 129e0ba31589356b9c4326907ddf7e11d7b6be18.

These implies that some commits cannot be found on the server.

Remedy

Doing a git cleanup git gc should fix the problem. Run git gc on the folder where the git repo is hosted and that should fix the problem.

Cheers

Sign up to request clarification or add additional context in comments.

1 Comment

Cool. git gc is always a saviour
0

The HTTP 403 you're seeing when you attempt to push is the code meaning "Forbidden". Do you need to add:

Order allow,deny
Allow from all

...to your Location block?

2 Comments

The original post lists http error code 401. See below for a fix for that.
This is intended as the solution to the inability-to-push in the OP's subsequent comment; I shall edit for clarification.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.