Building simplicidade.org: notes, projects, and occasional rants

User interaction is not allowed

This errors happened to me sometime ago, but today I saw it again on a coworker Mac.

You’ll get the error on the Terminal, with commands that want to use MacOS Keychain passwords. I’m sure there is another element at work here, but I could not find it.

In this case, the error on docker login was this (you’ll get a similar error with git fetch or git pull):

Error saving credentials: error storing credentials - err: exit status 1, out: `User interaction is not allowed`

The command line tool is trying to access a Keychain Item, and this item is protected to only be used by some applications. On normal conditions, this would trigger a graphical pop-up asking for permission for this new application to access said item, but in this case he fails to launch the pop-up and therefore, rejects the action.

To fix, open the Keychain Access application, search for the domain you were trying to access (in the case of docker login it would be the private registry address, or hub.docker.com), edit the entry, select the tab “Access Control”.

You can then add permission to the application you need by taping the “+” button on the lower left, and picking the correct file, but I don’t have a easy way to discover what is the correct file to add. If the problem is docker login you could first try to add the command /Applications/Docker.app/Contents/Resources/bin/docker-credential-osxkeychain.bin. For git pull or git fetch issues, try to add /Library/Developer/CommandLineTools/usr/libexec/git-core/git-credential-osxkeychain.

If you don’t know which command line application is the culprit, you can just disable access control for this password item by making sure that the “Allow all applications to access this item” option is selected and “Save Changes”.

You should try to find the correct application if possible, but the second options will work. No security, but it would work.