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

Distroless test failing due to change in syft behavior #4537

Closed
mthalman opened this issue Apr 3, 2023 · 0 comments
Closed

Distroless test failing due to change in syft behavior #4537

mthalman opened this issue Apr 3, 2023 · 0 comments

Comments

@mthalman
Copy link
Member

mthalman commented Apr 3, 2023

The following test failure is occurring for Ubuntu chiseled:

[xUnit.net 00:05:16.02]     Microsoft.DotNet.Docker.Tests.RuntimeDepsImageTests.VerifyDistrolessPackages(imageData: HasCustomSdk='True', SdkOS='jammy', OSTag='jammy-chiseled', Version='8.0', VersionFamily='8.0', VersionString='8.0', DefaultPort='8080', Arch='Arm', IsArm='True', OS='jammy-chiseled', IsDistroless='True', Platform='linux/arm/v7', ArchVariant='v7', IsWindows='False', Rid='linux-arm', OsVersion='') [FAIL]
  Failed Microsoft.DotNet.Docker.Tests.RuntimeDepsImageTests.VerifyDistrolessPackages(imageData: HasCustomSdk='True', SdkOS='jammy', OSTag='jammy-chiseled', Version='8.0', VersionFamily='8.0', VersionString='8.0', DefaultPort='8080', Arch='Arm', IsArm='True', OS='jammy-chiseled', IsDistroless='True', Platform='linux/arm/v7', ArchVariant='v7', IsWindows='False', Rid='linux-arm', OsVersion='') [4 s]
  Error Message:
   System.InvalidOperationException : Failed to execute docker run --name distroless-packages --rm -v /var/run/docker.sock:/var/run/docker.sock  anchore/syft packages docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7 -o json
Exit code: 1
Standard Error: [0000]  WARN scheme "docker" specified, but it coincides with a common image name; re-examining user input "docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7" without scheme parsing because image retrieval using scheme parsing was unsuccessful: unable to use DockerDaemon source: image has unexpected architecture "arm", which differs from the user specified architecture "arm64"
2023/04/03 20:16:09 error during command execution: 1 error occurred:
	* failed to construct source from user input "docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7": could not fetch image "mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7": unable to determine image source to select platform
  Stack Trace:
     at Microsoft.DotNet.Docker.Tests.DockerHelper.Execute(String args, Boolean ignoreErrors, Boolean autoRetry, ITestOutputHelper outputHelper) in /repo/dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/DockerHelper.cs:line 146
   at Microsoft.DotNet.Docker.Tests.DockerHelper.ExecuteWithLogging(String args, Boolean ignoreErrors, Boolean autoRetry) in /repo/dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/DockerHelper.cs:line 161
   at Microsoft.DotNet.Docker.Tests.DockerHelper.Run(String image, String name, String command, String workdir, String optionalRunArgs, Boolean detach, String runAsUser, Boolean skipAutoCleanup, Boolean useMountedDockerSocket) in /repo/dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/DockerHelper.cs:line 265
   at Microsoft.DotNet.Docker.Tests.RuntimeDepsImageTests.VerifyDistrolessPackages(ProductImageData imageData) in /repo/dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs:line 99
   at InvokeStub_RuntimeDepsImageTests.VerifyDistrolessPackages(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Standard Output Messages:
Executing: docker pull anchore/syft
 Using default tag: latest
 latest: Pulling from anchore/syft
 24b5e8185525: Pulling fs layer
 5a8403824680: Pulling fs layer
 e050b707cfbd: Pulling fs layer
 5a8403824680: Verifying Checksum
 5a8403824680: Download complete
 24b5e8185525: Verifying Checksum
 24b5e8185525: Download complete
 e050b707cfbd: Verifying Checksum
 e050b707cfbd: Download complete
 24b5e8185525: Pull complete
 5a8403824680: Pull complete
 e050b707cfbd: Pull complete
 Digest: sha256:2e78580c1e866d9afbb899f9270b377714101d1d203bd2886f31a7c0ab78e6fa
 Status: Downloaded newer image for anchore/syft:latest
 docker.io/anchore/syft:latest
 Execution Elapsed Time: 00:00:03.1995975
 Executing: docker run --name distroless-packages --rm -v /var/run/docker.sock:/var/run/docker.sock  anchore/syft packages docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7 -o json
 \x1b[0;90m[0000]\x1b[0m \x1b[0;33m WARN\x1b[0m scheme "docker" specified, but it coincides with a common image name; re-examining user input "docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7" without scheme parsing because image retrieval using scheme parsing was unsuccessful: unable to use DockerDaemon source: image has unexpected architecture "arm", which differs from the user specified architecture "arm64"
 2023/04/03 20:16:09 error during command execution: 1 error occurred:
 	* failed to construct source from user input "docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7": could not fetch image "mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7": unable to determine image source to select platform

This issue only occurs in the Arm32 tests. Example build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=226631&view=logs&jobId=cd63c7f0-318c-51f3-a785-67f930099f68&j=cd63c7f0-318c-51f3-a785-67f930099f68&t=ba40f016-3ef8-51a5-390d-37da4ad750f7.

This is a change in behavior from the previous released version of the syft image. It started in 0.76.0. Quick fix is to pin the version to anchore/syft:v0.75.0.

I've logged anchore/syft#1708 for the syft side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants