blackducksoftware / blackduck-docker-inspector

Apache License 2.0
20 stars 12 forks source link

Error inspecting image: response was 404 Not Found, reason phrase was Not Found. #21

Closed sunyinghao5438 closed 4 years ago

sunyinghao5438 commented 4 years ago

Error inspecting image: There was a problem trying to GET http://localhost:9222/api/current-user?offset=0&limit=100, response was 404 Not Found, reason phrase was Not Found.

stevebillings commented 4 years ago

Please provide a log with logging level set to TRACE. On the surface, it looks like there may be an issue with your Black Duck server. Can you log into http://localhost:9222?

sunyinghao5438 commented 4 years ago

@stevebillings Thank you for your reply. Yes, I can log in http://localhost:9222

[2020-06-10T18:15:37+0100]: Jar dir: /tmp/blackduck-docker-inspector
[2020-06-10T18:15:37+0100]: Checking /tmp/blackduck-docker-inspector/blackduck-docker-inspector-latest-commit-id.txt for commit ID
[2020-06-10T18:15:37+0100]: Existing version commit ID file: /tmp/blackduck-docker-inspector/blackduck-docker-inspector-latest-commit-id.txt
[2020-06-10T18:15:37+0100]: Current version commit ID: 19b2b984ac74614db4168e19311f99a5495bceb4
[2020-06-10T18:15:37+0100]: The currently-installed version of the blackduck-docker-inspector jar file: 19b2b984ac74614db4168e19311f99a5495bceb4
[2020-06-10T18:15:37+0100]: Downloading https://blackducksoftware.github.io/blackduck-docker-inspector/latest-commit-id.txt to /tmp/blackduck-docker-inspector/blackduck-docker-inspector-latest-commit-id.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    41  100    41    0     0    418      0 --:--:-- --:--:-- --:--:--   418
[2020-06-10T18:15:37+0100]: The latest version of the blackduck-docker-inspector jar file: 19b2b984ac74614db4168e19311f99a5495bceb4
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1180  100  1180    0     0   4896      0 --:--:-- --:--:-- --:--:--  4896
Latest release version: 9.0.1
[2020-06-10T18:15:37+0100]: Deriving name of latest released jar file
Latest release version: 9.0.1
[2020-06-10T18:15:37+0100]: Latest released jar filename: blackduck-docker-inspector-9.0.1.jar
[2020-06-10T18:15:37+0100]: Deriving name of latest released AirGap Zip file
Latest release version: 9.0.1
[2020-06-10T18:15:37+0100]: Latest released AirGap Zip filename: blackduck-docker-inspector-9.0.1-air-gap.zip
[2020-06-10T18:15:37+0100]: Selected jar: https://sig-repo.synopsys.com/bds-integrations-release/com/synopsys/integration/blackduck-docker-inspector/9.0.1/blackduck-docker-inspector-9.0.1.jar
[2020-06-10T18:15:37+0100]:   local path: /tmp/blackduck-docker-inspector/blackduck-docker-inspector-9.0.1.jar
[2020-06-10T18:15:37+0100]: Selected Air Gap Zip: 
[2020-06-10T18:15:37+0100]:   local path: /tmp/blackduck-docker-inspector/blackduck-docker-inspector-9.0.1-air-gap.zip
[2020-06-10T18:15:37+0100]: /tmp/blackduck-docker-inspector/blackduck-docker-inspector-9.0.1.jar is up-to-date.
[2020-06-10T18:15:37+0100]: jarPath: /tmp/blackduck-docker-inspector/blackduck-docker-inspector-9.0.1.jar
[2020-06-10T18:15:37+0100]: Options: --blackduck.url=http://localhost:9222/ --blackduck.password=****** --docker.image=hello-world
[2020-06-10T18:15:37+0100]: Jar dir: /tmp/blackduck-docker-inspector
2020-06-10 18:15:39.654  INFO 15435 --- [           main] c.s.i.b.dockerinspector.DockerInspector  : Black Duck Docker Inspector 9.0.1
2020-06-10 18:15:41.338  INFO 15435 --- [           main] c.s.i.b.dockerinspector.DockerInspector  : Inspecting image:tag hello-world:latest
2020-06-10 18:15:41.501  INFO 15435 --- [           main] c.s.i.b.d.b.BlackDuckClient              : Successful connection to Black Duck.
2020-06-10 18:15:41.501  INFO 15435 --- [           main] c.s.i.b.d.d.DockerClientManager          : Pulling image hello-world:latest
2020-06-10 18:15:43.353  INFO 15435 --- [           main] c.s.i.b.d.d.DockerClientManager          : Saving the docker image to : /tmp/blackduck-docker-inspector-files/shared/run_15435_sunyinghao5438/target/hello-world_latest.tar
2020-06-10 18:15:43.379  INFO 15435 --- [           main] .b.d.h.ImageInspectorClientStartServices : docker-java library version: 1.40; API version: 19.03.8
2020-06-10 18:15:43.382  INFO 15435 --- [           main] .b.d.h.ImageInspectorClientStartServices : Service http://localhost:9002 (UBUNTU) is not running; starting it...
2020-06-10 18:15:43.382  INFO 15435 --- [           main] .b.d.h.ImageInspectorClientStartServices : (Image inspection may complete faster if you set cleanup.inspector.container=false)
2020-06-10 18:15:43.382  INFO 15435 --- [           main] c.s.i.b.d.d.DockerClientManager          : Pulling image blackducksoftware/blackduck-imageinspector-ubuntu:5.0.1
2020-06-10 18:15:44.737  INFO 15435 --- [           main] c.s.i.b.d.d.DockerClientManager          : Starting container: blackduck-imageinspector-ubuntu_15435_sunyinghao5438
2020-06-10 18:16:05.498  INFO 15435 --- [           main] .b.d.h.ImageInspectorClientStartServices : Sending getBdio request to: http://localhost:9002 (UBUNTU)
2020-06-10 18:16:05.999  INFO 15435 --- [           main] c.s.i.b.dockerinspector.output.Output    : Writing BDIO to /tmp/blackduck-docker-inspector-files/shared/run_15435_sunyinghao5438/output/hello-world_latest_noPkgMgr_bdio.jsonld
2020-06-10 18:16:06.001  WARN 15435 --- [           main] c.s.i.b.dockerinspector.output.Output    : Unable to remove temporary file /tmp/blackduck-docker-inspector-files/shared/run_15435_sunyinghao5438/output/hello-world_latest_containerfilesystem.tar.gz
2020-06-10 18:16:06.001  INFO 15435 --- [           main] c.s.i.b.d.b.BlackDuckClient              : Uploading BDIO files.
2020-06-10 18:16:06.005  INFO 15435 --- [           main] c.s.i.b.d.b.BlackDuckClient              : uploading hello-world_latest_noPkgMgr_bdio.jsonld
2020-06-10 18:16:06.380 ERROR 15435 --- [           main] c.s.i.b.dockerinspector.DockerInspector  : Error inspecting image: There was a problem trying to GET http://localhost:9222/api/current-user?offset=0&limit=100, response was 404 Not Found, reason phrase was Not Found.
2020-06-10 18:16:06.398  INFO 15435 --- [           main] c.s.i.b.dockerinspector.DockerInspector  : Returning -1
[2020-06-10T18:16:06+0100]: Return code: 255

and also I downloaded the source code and get the error stack trace

com.synopsys.integration.rest.exception.IntegrationRestException: There was a problem trying to GET http://localhost:9222/api/current-user?offset=0&limit=100, response was 404 Not Found, reason phrase was Not Found.
    at com.synopsys.integration.rest.request.Response.throwExceptionForError(Response.java:218)
    at com.synopsys.integration.blackduck.rest.BlackDuckHttpClient.throwExceptionForError(BlackDuckHttpClient.java:76)
    at com.synopsys.integration.blackduck.service.BlackDuckResponseTransformer.getResponse(BlackDuckResponseTransformer.java:46)
    at com.synopsys.integration.blackduck.service.BlackDuckService.getResponse(BlackDuckService.java:209)
    at com.synopsys.integration.blackduck.codelocation.CodeLocationCreationService.calculateCodeLocationRange(CodeLocationCreationService.java:78)
    at com.synopsys.integration.blackduck.codelocation.CodeLocationCreationService.createCodeLocations(CodeLocationCreationService.java:51)
    at com.synopsys.integration.blackduck.codelocation.bdioupload.BdioUploadService.uploadBdio(BdioUploadService.java:50)
    at com.synopsys.integration.blackduck.dockerinspector.blackduckclient.BlackDuckClient.uploadBdio(BlackDuckClient.java:122)
    at com.synopsys.integration.blackduck.dockerinspector.httpclient.HttpClientInspector.getBdio(HttpClientInspector.java:105)
    at com.synopsys.integration.blackduck.dockerinspector.DockerInspector.inspectImage(DockerInspector.java:114)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
    at com.synopsys.integration.blackduck.dockerinspector.DockerInspector.main(DockerInspector.java:103)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:86)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
stevebillings commented 4 years ago

I continue to suspect there is something wrong with your localhost Black Duck server. For how long have you been using it? You could do a test to see if https://blackducksoftware.github.io/synopsys-detect/latest can connect to it. I suspect the result will be the same.

sunyinghao5438 commented 4 years ago

Thank you! I am new in blackduck. and in the port 9222 which is running blackduck protex, So in this case, I should run Synopsys Detect in my local?

stevebillings commented 4 years ago

Ah, I see. The Black Duck product names are very confusing. Docker Inspector and Synopsys Detect only work with https://www.synopsys.com/software-integrity/security-testing/software-composition-analysis.html, and not with Protex.

sunyinghao5438 commented 4 years ago

Sorry for the late reply! Thank you