-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS X: Cannot get password: An internal error has occurred
error after using using key in different application
#45
Comments
OS version? |
Yeah, this works fine for me on Sierra. |
I'm on Sierra 10.12.6 and installed |
Yeah, I am on the same versions..... |
Is it important that you create it from RStudio? Is it reproducible? |
Oh, wait, I can actually reproduce it, so all is good. |
OK, this is bad, actually. If we give (command line) R "Always allow" access to a key, then no other apps can access it. Otherwise multiple apps can happily have access. E.g. adding the key from RStudio (which is the rsession app for the keychain): > key_set_with_value("javier-test", "sql-test2", "sql-password2")
> key_get("javier-test", "sql-test2")
[1] "sql-password2" and then from the command line:
works fine with "Always allow" access. (And RStudio keeps working.) But as soon as I give access to R, both |
This is really strange, and honestly seems to be a macOS bug to me. What I can try is to use the newer functions of the macOS keychain API, I am using the legacy API calls currently. There is some chance that they fixed it there. |
I can't fully prove this, but I strongly suspect that this is because console R is not signed with codesign. A workaround is to mark the keys as "Allow all applications to access this item" in Keychain Access. macOS will still ask for confirmation when an app tries to access them. I'll try to update the code to create keys with this flag set by default. |
I can't be sure of this, but want to note that I was first hit with this error immediately after upgrading to the latest RStudio (after happily using Mac OSX with keychain for a long time). My old version of RStudio was a few months old, so I think it's likely this is a problem introduced in a September version of RStudio. The workaround you suggest works for me. |
I just hit this and can confirm the workaround still works. |
Like @dgrtwo this happened to me after upgrading OSX. Workaround solved it. |
Hi, I also just hit this.
|
@almartin82 Can you try the workaround mentioned in the comment above? |
Workaround works, thanks! |
I think with newer macOS versions this does not happen any more, at least I can't repro this on Mojave. |
This is not blocking the use of
keyring
that I'm considering but worth investigating at some point.Repro:
From RStudio:
Then open R from the terminal and run:
Password prompt should trigger requesting access, use "Always Allow" (other selection won't reproduce this).
Now back from RStudio:
The text was updated successfully, but these errors were encountered: