Skip to content
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

An error occurred listing credentials with docker-credential-gcr #739

Closed
glebbash opened this issue Mar 27, 2024 · 2 comments · Fixed by #902
Closed

An error occurred listing credentials with docker-credential-gcr #739

glebbash opened this issue Mar 27, 2024 · 2 comments · Fixed by #902
Labels
triage Investigation required

Comments

@glebbash
Copy link
Contributor

glebbash commented Mar 27, 2024

Expected Behaviour
Should work fine :)

Actual Behaviour
Having docker-credential-gcr installed makes it not possible to start testcontainers.

Problem is that running docker-credential-gcr list command returns exit code 1, which triggers an error here:

return reject(new Error("An error occurred listing credentials"));

This is caused by list command being not implemented:

Usage: docker-credential-gcr <flags> <subcommand> <subcommand args>
...
Subcommands for Docker credential store API:
        erase            (UNIMPLEMENTED) erase any stored credentials for the server specified via stdin
        get              for the server specified via stdin, return the stored credentials via stdout
        list             (UNIMPLEMENTED) list all stored credentials
...

P.S: not really sure what commands are required to be implemented by docker credential helpers spec (if there is one) so it might be an issue for docker-credential-gcr repo.

Testcontainer Logs

Error: An error occurred listing credentials
    at /workspace/***/node_modules/testcontainers/build/container-runtime/auth/credential-provider.js:32:35
    at ChildProcess.exithandler (node:child_process:430:5)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)

Steps to Reproduce

  1. Install docker-credential-gcr
  2. Run the following (or any other container):
import { GenericContainer, Wait } from "testcontainers";

const spannerEmulator = await new GenericContainer(
  "gcr.io/cloud-spanner-emulator/emulator"
)
  .withExposedPorts(9010)
  .withWaitStrategy(Wait.forLogMessage("gRPC server listening at"))
  .start();

Environment Information

  • Operating System: Ubuntu 22.04
  • Docker Version: 25.0.3
  • Node version: v20.11.1
  • Testcontainers version: 10.7.2
@ghtaylor
Copy link

If anyone has come to this page from a quick Google, the below fixed it for me:

In ~/.docker/config.json, remove the below entry, and save:

{
  //
  "credsStore": "desktop"
  //
}

@glebbash
Copy link
Contributor Author

@cristianrgreco can you get the linked PR merged pls? I tested that it works locally and added a unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Investigation required
Projects
None yet
3 participants