Carthage update error: "GitHub API request failed: Bad credentials"

Created on 12 Mar 2016  Â·  3Comments  Â·  Source: Carthage/Carthage

Here is my Cartfile:

# Kanna HTML parsing library
github "tid-kijyun/Kanna" ~> 1.0.0

# Realm database/ORM
github "realm/realm-cocoa"

When I run carthage update I get this:

$ carthage --version
Unrecognized command: '--version'. See `carthage help`.

$ carthage update --platform OSX
*** Fetching realm-cocoa
*** Fetching Kanna
*** Skipped downloading realm-cocoa.framework binary due to the error:
    "GitHub API request failed: Bad credentials"
*** Checking out realm-cocoa at "v0.98.3"
*** Skipped downloading Kanna.framework binary due to the error:
    "GitHub API request failed: Bad credentials"
*** Checking out Kanna at "1.0.5"
*** xcodebuild output can be found in /var/folders/p2/c_d5mx0s3gl45165btrpx1fm0000gn/T/carthage-xcodebuild.KVYEob.log
*** Building scheme "Kanna_OSX" in Kanna.xcworkspace
*** Building scheme "RealmSwift" in RealmExamples.xcworkspace
*** Building scheme "Realm" in RealmExamples.xcworkspace

So it does seem to build both Kanna and Realm, but I'm getting an error about bad GitHub API credentials. What is wrong?

question

Most helpful comment

Thanks @mdiep — with your help, I figured it out.
For others stumbling across this issue, here are the steps that solved it for me:

  1. Edit ~/.gitconfig and add the following:

[credential] helper = osxkeychain [credential "https://github.com"] username = willhains

(Replace willhains with your GitHub user ID.)

  1. Clone a private repo via HTTPS.
  2. OSX will prompt for your GitHub password.
  3. Run carthage update.

All 3 comments

Carthage is trying to downloading a pre-built binary of both frameworks from the GitHub release. Carthage gets your GitHub credentials from git and uses them to make the API request.

If you want to prevent this, you'll need to set a new set of credentials with Git's credential helper.

Thanks @mdiep — with your help, I figured it out.
For others stumbling across this issue, here are the steps that solved it for me:

  1. Edit ~/.gitconfig and add the following:

[credential] helper = osxkeychain [credential "https://github.com"] username = willhains

(Replace willhains with your GitHub user ID.)

  1. Clone a private repo via HTTPS.
  2. OSX will prompt for your GitHub password.
  3. Run carthage update.

I had the same issue and had to upgrade to the latest version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CAPIStkidd picture CAPIStkidd  Â·  3Comments

itinance picture itinance  Â·  3Comments

justinmakaila picture justinmakaila  Â·  4Comments

chrislconover picture chrislconover  Â·  3Comments

pmhood picture pmhood  Â·  3Comments