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

[BUG] Error popup each time a Dockerfile is shown in Visual Studio Code #733

Open
maffe opened this issue Aug 15, 2024 · 8 comments
Open

Comments

@maffe
Copy link

maffe commented Aug 15, 2024

Describe the bug
Each time I open a Dockerfile in Visual Studio Code, I get a notification with an error message like

Command failed: java -DRHDA_TOKEN=f9949b4c-11ca-4a03-9d3c-9bea921b9fb1 -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar c:\Users\alice\.vscode\extensions\redhat.fabric8-analytics-0.9.5\dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json alpine
Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://alpine:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.base/java.lang.ProcessImpl.create(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:500)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more

(The error message means it cannot find the file)

To Reproduce
Steps to reproduce the behavior:

  1. Save this Dockerfile:

     FROM alpine
     RUN apk add texlive
    
  2. Open it in Visual Studio Code

  3. Error popup appears:
    grafik

Expected behavior
Do not show any error messages if skopeo is not found, without the error message I wouldn’t even know of this extension, I did not install it myself

VSCode(please complete the following information):

  • OS: Windows 10
  • VSCode version: 1.92.1
  • Dependency Analytics Version: v0.9.5

Additional context
Some time ago I could work with these Dockerfiles without a problem.

@rubensa
Copy link

rubensa commented Sep 4, 2024

Same problem here.
In the Red Hat Dependency Analytics Server output I can see:

Error: LinkageError occurred while loading main class com.redhat.exhort.Main
	java.lang.UnsupportedClassVersionError: com/redhat/exhort/Main has been compiled by a more recent version of the Java Runtime (class file version 64.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Error: LinkageError occurred while loading main class com.redhat.exhort.Main
	java.lang.UnsupportedClassVersionError: com/redhat/exhort/Main has been compiled by a more recent version of the Java Runtime (class file version 64.0), this version of the Java Runtime only recognizes class file versions up to 55.0
[Warn  - 7:06:05 PM] Component Analysis Error: Error: Command failed: java -DRHDA_TOKEN=931b204a-6c07-4067-bcd0-8f8a0ae1dc4b -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar /home/user/.vscode-server/extensions/redhat.fabric8-analytics-0.9.5/dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json rubensa/ubuntu-tini-dev
Error: LinkageError occurred while loading main class com.redhat.exhort.Main
	java.lang.UnsupportedClassVersionError: com/redhat/exhort/Main has been compiled by a more recent version of the Java Runtime (class file version 64.0), this version of the Java Runtime only recognizes class file versions up to 55.0

[Warn  - 7:06:08 PM] Component Analysis Error: Error: Command failed: java -DRHDA_TOKEN=931b204a-6c07-4067-bcd0-8f8a0ae1dc4b -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar /home/user/.vscode-server/extensions/redhat.fabric8-analytics-0.9.5/dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json ghcr.io/rubensa/my-data-api-devcontainer base
Error: LinkageError occurred while loading main class com.redhat.exhort.Main
	java.lang.UnsupportedClassVersionError: com/redhat/exhort/Main has been compiled by a more recent version of the Java Runtime (class file version 64.0), this version of the Java Runtime only recognizes class file versions up to 55.0

As a side note: I only have docker installed (neither skopeo nor podman).

Is it possible to disable Dockerfiles analysis to avoid having this kind of errors (that, to me, appear without a Dockerfile opened)?

@rubensa
Copy link

rubensa commented Sep 4, 2024

Taking a deep review of the docs looks like my problem might be relate to this:

For base images in a Dockerfile or Containerfile, you must have Java version 20 or later.

In my case the Java version being used to build the project is Java 11.

So:

  • Is there any setting to specify an alternative Java path (not the "default" one, like it can be set using spring-boot.ls.java.home for Spring Boot VSCode extension)?

  • Is there any setting to disable specific analysis (Dockerfile analysis in this case)?

As a side note, I tried using a Maven command (mvn) wrapper like:

#!/bin/sh
# Hack needed by redhat.fabric8-analytics extension that runs maven commands using default JDK
JAVA_HOME=/usr/lib/jvm/21.0 mvn "$@"

and setting 'redHatDependencyAnalytics.mvn.executable.path' to that but looks like, for Dockerfile analysis, Maven is not used but Java command directly (and I can't find a way to specify the path).

@rubensa
Copy link

rubensa commented Sep 4, 2024

Looking at the code, looks like a simple "hard-coded" command call is issued without the ability to specify the full path or something...

@rubensa
Copy link

rubensa commented Sep 4, 2024

Patching the server.js file to hardcode the full Java path (/usr/lib/jvm/21.0/bin/java instead of simply java) I keep getting error messages (as I have no skopeo installed).

Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://rubensa/ubuntu-tini-dev:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more
[Warn  - 8:17:27 PM] Component Analysis Error: Error: Command failed: /usr/lib/jvm/21.0/bin/java -DRHDA_TOKEN=baeb2ab0-31b0-4a3c-a30a-28636e42e218 -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar /home/user/.vscode-server/extensions/redhat.fabric8-analytics-0.9.5/dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json rubensa/ubuntu-tini-dev
Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://rubensa/ubuntu-tini-dev:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more

Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://ghcr.io/rubensa/my-data-api-devcontainer:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more
[Warn  - 8:17:30 PM] Component Analysis Error: Error: Command failed: /usr/lib/jvm/21.0/bin/java -DRHDA_TOKEN=baeb2ab0-31b0-4a3c-a30a-28636e42e218 -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar /home/user/.vscode-server/extensions/redhat.fabric8-analytics-0.9.5/dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json ghcr.io/rubensa/my-data-api-devcontainer base
Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://ghcr.io/rubensa/my-data-api-devcontainer:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more

Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://rubensa/ubuntu-tini-dev:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more
[Warn  - 8:22:06 PM] Component Analysis Error: Error: Command failed: /usr/lib/jvm/21.0/bin/java -DRHDA_TOKEN=baeb2ab0-31b0-4a3c-a30a-28636e42e218 -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar /home/user/.vscode-server/extensions/redhat.fabric8-analytics-0.9.5/dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json rubensa/ubuntu-tini-dev
Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://rubensa/ubuntu-tini-dev:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more

Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://ghcr.io/rubensa/my-data-api-devcontainer:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more
[Warn  - 8:22:07 PM] Component Analysis Error: Error: Command failed: /usr/lib/jvm/21.0/bin/java -DRHDA_TOKEN=baeb2ab0-31b0-4a3c-a30a-28636e42e218 -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar /home/user/.vscode-server/extensions/redhat.fabric8-analytics-0.9.5/dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json ghcr.io/rubensa/my-data-api-devcontainer base
Exception in thread "main" java.lang.RuntimeException: Failed to execute command 'skopeo inspect --raw docker://ghcr.io/rubensa/my-data-api-devcontainer:latest' 
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:227)
	at com.redhat.exhort.image.ImageUtils.execSkopeoInspect(ImageUtils.java:408)
	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:265)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
Caused by: java.io.IOException: Cannot run program "skopeo": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.redhat.exhort.tools.Operations.runProcessGetFullOutput(Operations.java:194)
	... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 12 more

So I definetly need a way to simply disable Dockefile validations.

@sabalza
Copy link

sabalza commented Sep 4, 2024 via email

@sabalza
Copy link

sabalza commented Sep 4, 2024 via email

@sabalza
Copy link

sabalza commented Sep 4, 2024 via email

@rubensa
Copy link

rubensa commented Sep 5, 2024

Just for the record... Trying to config Dockerfile analysis is a nightmare if you have a "not that easy" Dockerfiles.

After applying the patch mentioned before, installing syft and skopeo, adding credentials (as some Docker images are in private repositories) to skopeo (via skopeo login), I keep getting errors as some Dockerfiles use multistage builds where some "ancestor" is called base (that does not exists as such name in the registry but skopeo tries to analyze).

Exception in thread "main" java.lang.RuntimeException: time="2024-09-05T12:49:53+02:00" level=fatal msg="Error parsing image name \"docker://base:latest\": reading manifest latest in docker.io/library/base: errors:\ndenied: requested access to the resource is denied\nunauthorized: authentication required\n"

	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:268)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)
[Warn  - 12:49:53 PM] Component Analysis Error: Error: Command failed: /usr/lib/jvm/21.0/bin/java -DRHDA_TOKEN=55b60dea-beb6-4c09-8242-19daa77e741b -DRHDA_SOURCE=vscode -DEXHORT_SYFT_PATH=syft -DEXHORT_SKOPEO_PATH=skopeo -DEXHORT_DOCKER_PATH=docker -DEXHORT_PODMAN_PATH=podman -jar /home/user/.vscode-server/extensions/redhat.fabric8-analytics-0.9.5/dist/../javaApiAdapter/exhort-java-api-adapter-1.0-SNAPSHOT-jar-with-dependencies.jar json ghcr.io/rubensa/my-data-api-devcontainer base
Exception in thread "main" java.lang.RuntimeException: time="2024-09-05T12:49:53+02:00" level=fatal msg="Error parsing image name \"docker://base:latest\": reading manifest latest in docker.io/library/base: errors:\ndenied: requested access to the resource is denied\nunauthorized: authentication required\n"

	at com.redhat.exhort.image.ImageUtils.getImageDigests(ImageUtils.java:268)
	at com.redhat.exhort.image.ImageRef.checkImageDigest(ImageRef.java:121)
	at com.redhat.exhort.image.ImageRef.<init>(ImageRef.java:48)
	at com.redhat.exhort.ImageRefInput.<init>(ImageRefInput.java:10)
	at com.redhat.exhort.Main.parseArguments(Main.java:121)
	at com.redhat.exhort.Main.main(Main.java:27)

So, to me, the only way to use the rest of analysis (I mainly use it for maven dependencies analysis) is to be able to disable Dockerfile analysis.

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

No branches or pull requests

3 participants