aquasecurity / microscanner

Scan your container images for package vulnerabilities with Aqua Security
859 stars 108 forks source link

Error: snappy: corrupt input when running microscanner #51

Closed patrocinio closed 4 years ago

patrocinio commented 4 years ago

I have an OpenShift 4.3 environment, and I am using BuildConfig and the following Dockerfile:

FROM node:latest

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app

RUN npm install
COPY server.js /usr/src/app

ARG acquaToken
ADD https://get.aquasec.com/microscanner .
RUN chmod +x microscanner
RUN ./microscanner $acquaToken

EXPOSE 8080
CMD ["npm", "start"]

However, the build is failing with the following error:

node-build-config-6-build docker-build STEP 12: RUN ./microscanner $acquaToken
node-build-config-6-build docker-build 2020-05-23 19:10:27.181  INFO    Contacting CyberCenter...   {"registry": "", "image": ""}
node-build-config-6-build docker-build 2020-05-23 19:10:27.705  INFO    CyberCenter connection established  {"registry": "", "image": "", "api_version": "4"}
node-build-config-6-build docker-build 2020-05-23 19:10:30.300  INFO    Processing results...   {"registry": "", "image": ""}
node-build-config-6-build docker-build 
node-build-config-6-build docker-build ERROR: scan failed: CyberCenter returned error: failed scanning: failed reading error response: failed decompressing response: snappy: corrupt input

Any idea on what I can do to fix this error?

jonassteinberg1 commented 4 years ago

Same is happening to me:

2020-05-23 20:41:31.846 INFO    Contacting CyberCenter...   {"registry": "", "image": ""}
2020-05-23 20:41:33.430 INFO    CyberCenter connection established  {"registry": "", "image": "", "api_version": "4"}
2020-05-23 20:41:37.014 INFO    Processing results...   {"registry": "", "image": ""}

ERROR: scan failed: CyberCenter returned error: failed scanning: failed reading error response: failed decompressing response: snappy: corrupt input
jerbia commented 4 years ago

@patrocinio @jonassteinberg1
Can you check again? It's hard to identify the issue without the image. I tried a NodeJS image with sample project and it seems to work. Here is my Dockerfile

FROM node:latest RUN mkdir -p /usr/src/app WORKDIR /usr/src/app RUN git clone https://github.com/contentful/the-example-app.nodejs.git WORKDIR /usr/src/app/the-example-app.nodejs RUN npm install

ARG acquaToken ADD https://get.aquasec.com/microscanner . RUN chmod +x microscanner RUN ./microscanner $acquaToken

patrocinio commented 4 years ago

Hello @jerbia Thanks for validation.

I ran my Dockerfile and yours, and both worked fine.

Closing the issue.

Thanks for your assistance!