Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

keychain error #189

Closed
juliangruber opened this issue Jul 1, 2014 · 30 comments
Closed

keychain error #189

juliangruber opened this issue Jul 1, 2014 · 30 comments

Comments

@juliangruber
Copy link

$ ghi config --auth juliangruber
Enter juliangruber's GitHub password (never stored): ✔
✔︎ Token saved to keychain.

$ ghi list
⠄security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
#
Authorization required.

Please run 'ghi config --auth <username>'

Using the latest version from brew. Is there anything else I should try?

@leecade
Copy link

leecade commented Jul 1, 2014

👍 same problem

@juliangruber
Copy link
Author

same after installing with gem

@juliangruber
Copy link
Author

Also using latest osx

@suprememoocow
Copy link

I'm running ghi 0.9.3 and OSX Mavericks (Darwin debaser.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64) installed via brew and am seeing the same problem.

@kinabalu
Copy link

kinabalu commented Jul 4, 2014

same problem, installed via Brew. Running OSX Mavericks and latest homebrew

@stephencelis
Copy link
Owner

I just installed from scratch and was unable to reproduce. Can those affected:

  1. Type git config ghi.token and see what prints out. If you paste that line (without the leading !), do you get the same error?
  2. Open "Keychain Access" and search your keychains for "ghi"? (A "ghi token" password should be filtered.)
  3. Goto https://github.com/settings/applications and check for a "ghi on device name" access token.

To fix, try:

  1. Running git config --unset --global ghi.token
  2. Deleting the item you found in step 2, above.
  3. Deleting the token you found in step 3, above.
  4. Reauthorizing from scratch with ghi config --auth.

@leecade
Copy link

leecade commented Jul 5, 2014

thanks @stephencelis, works for me.

@kinabalu
Copy link

kinabalu commented Jul 5, 2014

I figured out what the problem was in my case, SourceTree had created an entry for github.com and the error was because the entry conflicted. Not sure what the method of fixing this is between the conflicting versions, but I'm happy it's working

@juliangruber
Copy link
Author

Keychain Access didn't show an entry for ghi, odd. I authed again and now it works. Thanks!

@qcom
Copy link

qcom commented Oct 23, 2014

Same with me @juliangruber on Yosemite after downloading the binary (no brew installation). Thanks a lot @stephencelis!

@jorinkl
Copy link

jorinkl commented Oct 30, 2014

Same for me, no keychain entry for ghi on yosemite, fixes as mentioned by @stephencelis did not work

@stephencelis
Copy link
Owner

@qcom Are you saying that it worked fine, or that you were unable to authorize?
@jorinkl Did you install via brew or via GitHub master?

@jorinkl
Copy link

jorinkl commented Nov 5, 2014

@stephencelis Tried installing via brew, GitHub master and gem. None of them worked and had the same issue (⠄security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.)

@codingjoe
Copy link

👍 same over here. brew 0.9.3 on yosemite

Homebrew 0.9.5
ghi version 0.9.3
Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64

@phubner
Copy link

phubner commented Nov 13, 2014

same issue here. ran from brew 0.9.3 on yosemite.

UPDATE: just ran the auth with sudo and that fixed it. However that was after revoking my previously created token.

@davidpdrsn
Copy link

Running auth with sudo also fixed the issues for me.

@codingjoe
Copy link

👎 not for me

@pudgereyem
Copy link

Had problem with the authorization aswell. Running OS X Yosemite 10.10.1.

  1. Installed ghi via brew
  2. ghi config --auth <username>
  3. Not working, no entry in keychain
  4. Solved by doing as @stephencelis instructed; keychain error #189 (comment)

I have no idea why this is happening tho.

@soumyaray
Copy link

@stephencelis : Found a fix

First, I ran through your 4 steps but couldn't find ghi token in keychain for step 2. I undid token ghi on github and tried again, no luck. I uninstalled ghi and tried reinstalling with brew (used gem before) and same problems.

Then I realized that I had two github.com entries in my keychain: an older one authorizing source-tree, and a newer one authorizing safari and git-credential-osxkeychain.

I deleted the older github entry for source-tree in keychain and now everything works. I suspect ghi does not expect multiple github entries in keychain.

Note to others: to find out what a keychain entry authorizes, double-click on it and select the Access Control tab.

@linjunpop
Copy link

@soumyaray 's solution works for me too.

@jorinkl
Copy link

jorinkl commented Jan 22, 2015

The solution from @soumyaray worked for me too.

1 similar comment
@tjordan73
Copy link

The solution from @soumyaray worked for me too.

@ErebusBat
Copy link

👍 for @stephencelis original recommendation.

OS X Yosemite 10.10.2 here, fresh ghi install (from brew)

@cakuki
Copy link

cakuki commented Jun 2, 2015

For those who cannot make ghi work alongside with existing SourceTree installation:

git config --global ghi.token "\!security find-internet-password -a [Your GitHub account name here] -s github.com -w"

will let ghi use your predefined SourceTree token/access-key (make sure that key has private repo access from your GitHub account settings if you want to access them via ghi).

I think security tool does not allow you to add more than one internet password for a site. So ghi fails to add an internet password for github.com with the ghi token label (that's why some cannot find anything in Keychain Access app when they search for 'ghi'). With this command, you can change ghi token getter without requiring ghi token label. So any github internet account entry will be used.

@ara4n
Copy link

ara4n commented Sep 7, 2015

My problem was that github have changed where the ghi token is shown - https://github.com/settings/tokens is the right URL, not https://github.com/settings/applications. Unsetting the ghi token in git config and then removing it from github fixed this for me.

@perlun
Copy link

perlun commented Apr 21, 2016

Seeing the same problem here as @cakuki, was fixed by removing the SourceTree entry in the keychain.

@stephencelis - this is a bug in ghi; it should verify when doing ghi config --auth <user> that the entry was properly added to the keychain (or give an error otherwise). Do you want me to create a separate issue for that?

@AlexChesters
Copy link
Contributor

@perlun thanks for that! A seperate issue would be great 😄

@matthewadams
Copy link

following

@lsloan
Copy link

lsloan commented Feb 14, 2017

Thanks to the comment from @cakuki, I'm finally able to get responses from GitHub using ghi. (Sir, I give you virtual beer for that! 🍺🍻)

I have several items in my keychain for each of github.com and gist.github.com, since I have work and personal accounts, and I use each with multiple git tools, like SourceTree, CLI, etc. So ghi's inability to deal with a complex situation is a real problem. (It should at least give an error message if adding the keychain item fails.) Manually setting git's ghi.token to use an existing github.com keychain item has done the trick.

PS:

  • The comment from @stephencelis was also helpful for shedding some light on the inner workings. However, the GitHub tokens are now found at https://github.com/settings/tokens.
  • As @perlun suggests, an issue needs to be opened for making ghi config --auth check that it was successful in adding the keychain item.

@dblock
Copy link

dblock commented Oct 20, 2018

I ran into this with a repo and an explanation, #370. None of the methods above help that problem really.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests