LoginSignup
11
8

More than 3 years have passed since last update.

Mac で docker login や docker-compose build や up 時に User interaction is not allowed エラー。はたまた docker.credentials.errors.StoreError のたぐい

Last updated at Posted at 2019-10-02

[xxxx] Failed to execute script docker-compose

macOS Mojave(MacOS 10.14.6)で docker login docker pulldocker-compose up docker-compose build すると error storing credentials User interaction is not allowed が出ます。

$ docker-compose up -d
Building mc1
Traceback (most recent call last):
  File "site-packages/docker/credentials/store.py", line 80, in _execute
  File "subprocess.py", line 411, in check_output
  File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['/usr/local/bin/docker-credential-desktop', 'get']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages/docker/auth.py", line 264, in _resolve_authconfig_credstore
  File "site-packages/docker/credentials/store.py", line 35, in get
  File "site-packages/docker/credentials/store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `User interaction is not allowed.`".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 72, in main
  File "compose/cli/main.py", line 128, in perform_command
  File "compose/cli/main.py", line 1077, in up
  File "compose/cli/main.py", line 1073, in up
  File "compose/project.py", line 548, in up
  File "compose/service.py", line 367, in ensure_image_exists
  File "compose/service.py", line 1106, in build
  File "site-packages/docker/api/build.py", line 261, in build
  File "site-packages/docker/api/build.py", line 308, in _set_auth_headers
  File "site-packages/docker/auth.py", line 304, in get_all_credentials
  File "site-packages/docker/auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `User interaction is not allowed.`".')
[5011] Failed to execute script docker-compose

TL; DR

ログイン情報を KeyChain に書き込めないことによるエラーです。

security コマンドの unlock-keychain で、アンロックして KeyChain に追加できるようにします。パスワードは macOS にログイン中のアカウントのパスワードです。

$ security unlock-keychain
password to unlock default: 

TS; DR

ローカルでビルドした Docker イメージを、Docker Hub にプッシュするために Docker アカウントにログインする必要がありました。(docker logindocker push

しかし、他の Mac では docker login 出来たのに、SSH 接続したヘッドレスの Mac ではログインできなかったのです。

$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a
Docker ID, head over to https://hub.docker.com to create one.
Username: keinos
Password: 
Error saving credentials: error storing credentials - err: exit status 1, out: `error
storing credentials - err: exit status 1, out: `User interaction is not allowed.``

アカウント名とパスワードが同じなのはコピペピピックして確認済みです。

また、docker-compose up でイメージがダウンロードされる場合にも表示されることがあります。

$ docker-compose up --build
Pulling bungeecord (itzg/bungeecord:)...
Traceback (most recent call last):
  File "site-packages/docker/credentials/store.py", line 80, in _execute
  File "subprocess.py", line 411, in check_output
  File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['/usr/local/bin/docker-credential-desktop', 'get']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages/docker/auth.py", line 264, in _resolve_authconfig_credstore
  File "site-packages/docker/credentials/store.py", line 35, in get
  File "site-packages/docker/credentials/store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `User interaction is not allowed.`".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 72, in main
  File "compose/cli/main.py", line 128, in perform_command
  File "compose/cli/main.py", line 1077, in up
  File "compose/cli/main.py", line 1073, in up
  File "compose/project.py", line 548, in up
  File "compose/service.py", line 361, in ensure_image_exists
  File "compose/service.py", line 1250, in pull
  File "compose/progress_stream.py", line 102, in get_digest_from_pull
  File "compose/service.py", line 1215, in _do_pull
  File "site-packages/docker/api/image.py", line 396, in pull
  File "site-packages/docker/auth.py", line 48, in get_config_header
  File "site-packages/docker/auth.py", line 324, in resolve_authconfig
  File "site-packages/docker/auth.py", line 235, in resolve_authconfig
  File "site-packages/docker/auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `User interaction is not allowed.`".')
[4023] Failed to execute script docker-compose

落ち着いてエラー内容を読むと、error storing credentials(「認証情報の保存エラー」) とあるのでログイン情報の保存時にエラーが発生しているようです。

また、続けて User interaction is not allowed(「ユーザとのやりとりは禁止されています」) とあるので、権限的な問題が原因のようです。

せやかて sudo て、と不安になりましたが「docker login User interaction is not allowed」でググったら出てきた以下の Qiita 記事で一発解消。古い記事ですが、2019 年末現在も有効でした。

助かりました。

11
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8