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

The actual error is overridden and not returned from getImageWithRetryStrategy #1569

Closed
akpsgit opened this issue Feb 14, 2023 · 5 comments
Closed
Labels
bug Something isn't working good-first-issue Good for newcomers

Comments

@akpsgit
Copy link

akpsgit commented Feb 14, 2023

Please provide a set of steps on how to reproduce the issue
Try to scan a non existing image, e.g.:
syft registry:docker.io/istio/examples-bookinfo-reviews-v1@sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3

What happened:
The actual error is being printed only as warning (requires the -v flag, otherwise now way of knowing about it):

syft registry:docker.io/istio/examples-bookinfo-reviews-v1@sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3 -v
[0000]  INFO syft version: 0.71.0
[0002]  WARN scheme "registry" specified, but it coincides with a common image name; re-examining user input "registry:docker.io/istio/examples-bookinfo-reviews-v1@sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3" without scheme parsing because image retrieval using scheme parsing was unsuccessful: unable to use OciRegistry source: failed to get image descriptor from registry: GET https://index.docker.io/v2/istio/examples-bookinfo-reviews-v1/manifests/sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3: MANIFEST_UNKNOWN: manifest unknown; unknown manifest name=istio/examples-bookinfo-reviews-v1 revision=sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3
2023/02/14 15:10:12 error during command execution: 1 error occurred:
	* failed to construct source from user input "registry:docker.io/istio/examples-bookinfo-reviews-v1@sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3": could not fetch image "docker.io/istio/examples-bookinfo-reviews-v1@sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3": unable determine image source

What you expected to happen:
That actual error will be returned as part of the error:

unable to use OciRegistry source: failed to get image descriptor from registry: GET https://index.docker.io/v2/istio/examples-bookinfo-reviews-v1/manifests/sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3: MANIFEST_UNKNOWN: manifest unknown; unknown manifest name=istio/examples-bookinfo-reviews-v1 revision=sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3

Anything else we need to know?:

Environment:

  • Output of syft version:

Application: syft
Version: 0.71.0
JsonSchemaVersion: 6.2.0
BuildDate: 2023-02-09T16:35:11Z
GitCommit: 88c81d3
GitDescription: [not provided]
Platform: darwin/amd64
GoVersion: go1.19.5
Compiler: gc

  • OS (e.g: cat /etc/os-release or similar):

ProductName: macOS
ProductVersion: 13.1
BuildVersion: 22C65

@akpsgit akpsgit added the bug Something isn't working label Feb 14, 2023
@kzantow
Copy link
Contributor

kzantow commented Feb 14, 2023

Currently, you will get an error, which includes:

could not fetch image "docker.io/istio/examples-bookinfo-reviews-v1@sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3"

Is this not clear enough? Could you elaborate on the ask here?

@akpsgit
Copy link
Author

akpsgit commented Feb 15, 2023

@kzantow Thanks for the quick response.
It's not clear enough because I don't get the actual reason for the Error. The ask is to return the actual error:

MANIFEST_UNKNOWN: manifest unknown; unknown manifest name=istio/examples-bookinfo-reviews-v1 revision=sha256:b8f16a765eea1e53aadf59146b3ffede9d2a869d6edf7d1729fb83d5146bbef3

The error that is currently returned is on a different image fetch trial, where "registry:" is concatenated to the image.

@tgerla tgerla added the good-first-issue Good for newcomers label Feb 23, 2023
@fishkerez
Copy link

I am facing the same issue.
In my case I had a private image that gets PERMISSION DENIED (asia.gcr.io/gke-release-staging/cluster-proportional-autoscaler@sha256:0f232ba18b63363e33f205d0242ef98324fb388434f8598c2fc8e967dca146bc)
But the error I get is
unable to parse registry reference=\"registry:asia.gcr.io/gke-release-staging/cluster-proportional-autoscaler@sha256:0f232ba18b63363e33f205d0242ef98324fb388434f8598c2fc8e967dca146bc\": could not parse reference: registry:asia.gcr.io/gke-release-staging/cluster-proportional-autoscaler@sha256:0f232ba18b63363e33f205d0242ef98324fb388434f8598c2fc8e967dca146bc TBD
That was very confusing and made it very hard for me to understand the real issue.

@FrimIdan
Copy link
Contributor

FrimIdan commented May 9, 2023

@kzantow @tgerla I've got the same problem when trying to scan an arm image with a amd cli

$ syft docker:idanfrim/multi-arch:only-arm64
 ⠸ Pulling image

2023/05/09 10:29:44 error during command execution: 1 error occurred:
	* failed to construct source from user input "docker:idanfrim/multi-arch:only-arm64": could not fetch image "idanfrim/multi-arch:only-arm64": unable to determine image source to select platform

The error (unable to determine image source to select platform) is not clear.
The real error (image has unexpected architecture "arm64", which differs from the user specified architecture "amd64) can only be displayed when using -v flag.

$ syft -v docker:idanfrim/multi-arch:only-arm64
[0000]  INFO syft version: 0.77.0
[0003]  INFO new version of syft is available: 0.80.0 (current version is 0.77.0)
[0006]  WARN scheme "docker" specified, but it coincides with a common image name; re-examining user input "docker:idanfrim/multi-arch:only-arm64" without scheme parsing because image retrieval using scheme parsing was unsuccessful: unable to use DockerDaemon source: image has unexpected architecture "arm64", which differs from the user specified architecture "amd64"
2023/05/09 12:04:11 error during command execution: 1 error occurred:
	* failed to construct source from user input "docker:idanfrim/multi-arch:only-arm64": could not fetch image "idanfrim/multi-arch:only-arm64": unable to determine image source to select platform

I've opened a PR to address it (#1801)

@akpsgit
Copy link
Author

akpsgit commented May 24, 2023

Thanks @FrimIdan for #1801 !

@akpsgit akpsgit closed this as completed May 24, 2023
@spiffcs spiffcs added changelog-ignore Don't include this issue in the release changelog and removed changelog-ignore Don't include this issue in the release changelog labels Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good-first-issue Good for newcomers
Projects
Archived in project
Development

No branches or pull requests

6 participants