docker-composeでdocker.credentials.errors.StoreError

macOSでdocker-composeしたら、エラーが表示されましたが、無事、解決できました。

エラー状況

macOS: 10.15.5
docker desktop: 2.4.0.0 (アップデート後)
python: pyenvのpython 3.8.2

久しぶりにmacOSでdocker-composeしたら、次のエラーが表示されてしまいました。

$ docker-compose build Building xxxxxx 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.`".') [8959] Failed to execute script docker-compose

最初「docker.credentials.errors.StoreError」だけで検索したら「gcloud関連のエラーが」という記事が見つかりました。

何か違うと思って、よく読むと、記事のエラーはdocker-credential-gcloud 。ぼくのエラーをよく見ると、docker-credential-desktopと、微妙に違うエラーでした。

Docker Desktopのアップデートダイアログが表示されていたので、アップデートしました。450MBのダウンロード。Docker Desktopを再起動しました。

すると、もう一度アップデートダイアログが表示されました。今度は480MBのダウンロード。Docker Desktopを再起動しました。

ターミナルでdocker-composeを実行しました。残念ながら、同じエラーでした。

$ docker-compose build Building xxxxxx 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 3, in <module> File "compose/cli/main.py", line 67, in main File "compose/cli/main.py", line 126, in perform_command File "compose/cli/main.py", line 302, in build File "compose/project.py", line 468, in build File "compose/project.py", line 450, in build_service File "compose/service.py", line 1125, 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.`".') [9309] Failed to execute script docker-compose

pyenvのpythonがよくないのかもと思い、macOS標準のpythonにしてみましたが、やはり同じエラーでした。

対応方法

「docker.credentials.errors.StoreError docker-credential-desktop」で検索してみました。「security unlock-keychain」を実行するといいようです。

パスワードを聞かれました。ぼくの場合は、macOSログイン時のパスワードを入力しました。

$ security unlock-keychain password to unlock default:

ぼくの環境では、これで解決しました。

参考記事

Mac で docker login や docker-compose build や up 時に User interaction is not allowed エラー。はたまた docker.credentials.errors.StoreError のたぐい - Qiita
Failed to execute script docker-compose macOS Mojave(MacOS 10.14.6)で docker login docker pull や docker-com...
docker-composeコマンドでCredentials store errorが出たときの対処法 - Qiita
環境 OS: macOS Mojave 10.14.5 Docker DeskTop: 2.0.0.3(Engine: 18.09.2、Compose: 1.23.2、Credential Helper: 0.6.0) エラ...

qiitaのお世話になってるわね

タイトルとURLをコピーしました