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.
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
- Build or pull the image in an earlier step.
- Pass the exact tag to
snyk container test. - If scanning a registry image, ensure the CLI can pull it (login if private).
docker pull ghcr.io/org/myimage:${{ github.sha }}
snyk container test ghcr.io/org/myimage:${{ github.sha }} --severity-threshold=highProvide the Dockerfile for base detection
Passing --file=Dockerfile helps Snyk identify the base image and avoids detection failures.
snyk container test myimage:latest --file=DockerfileHow 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.