Skip to content
Latchkey

Snyk "Failed to test ... project" container scan error in CI

Unlike a "found issues" failure (a working gate), "Failed to test" means Snyk never completed the scan: it could not fetch the image, reach the daemon, or interpret the base OS. This is an operational error, not a vulnerability verdict.

What this error means

Snyk exits with "Failed to test <image>" or "Could not detect ... base image", with no vulnerability table, before any gate decision.

Snyk
Testing myimage:latest...

Failed to test myimage:latest.
Could not test the image. Please make sure the image exists and is accessible,
or that the Docker daemon is running.

Common causes

The image is not present or reachable

The tag was never built locally and Snyk cannot reach the registry, so there is nothing to test.

The Docker daemon is unavailable to the CLI

Snyk uses the daemon to inspect local images; without socket access it cannot load the image.

How to fix it

Ensure the image is available before testing

  1. Build or pull the image in an earlier step.
  2. Pass the exact tag to snyk container test.
  3. If scanning a registry image, ensure the CLI can pull it (login if private).
Terminal
docker pull ghcr.io/org/myimage:${{ github.sha }}
snyk container test ghcr.io/org/myimage:${{ github.sha }} --severity-threshold=high

Provide the Dockerfile for base detection

Passing --file=Dockerfile helps Snyk identify the base image and avoids detection failures.

Terminal
snyk container test myimage:latest --file=Dockerfile

How to prevent it

  • Build or pull the image before the Snyk step.
  • Log in to private registries so Snyk can pull the image.
  • Pass --file=Dockerfile so base detection is reliable.

Frequently asked questions

What causes "Snyk "Failed to test""?
The tag was never built locally and Snyk cannot reach the registry, so there is nothing to test.
How do I fix Snyk "Failed to test"?
Ensure the image is available before testing

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card