Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

snyk test command failing silently in pipeline

ashish
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 3, 2020

I am using maven docker image as base image to run pipeline - maven:3.6.3-jdk-11

In my pipeline, I run mvn install and then run snyk test. Here are snyk specific logs - 

 

+ snyk auth $snykapikey

Your account has been authenticated. Snyk is now ready to be used.

 

+ snyk test --all-projects --json > snyktestoutput.json
Skipping cache upload for failed step

 

And here's pipeline definition - 

custom:

    run-synk-tests:

      - step:

          name: Run Snyk tests

          caches:

            - maven

          script:

            - apt-get update && apt-get install -y nodejs

            - curl -L https://npmjs.org/install.sh | sh

            - npm -version

            - npm install -g snyk

        

            - mvn -B install

            - snyk auth $snykapikey

            - snyk test --all-projects --json > snyktestoutput.json

            - pipe: snyk/snyk-scan:0.4.3

              variables:

                SNYK_TOKEN: $snykapikey

                SNYK_TEST_JSON_INPUT: "snyktestoutput.json"

 

BTW, snyk command does not fail if I just run this in pipeline

 - snyk test --all-projects

 and comment out all pipe and output file related lines.

1 answer

0 votes
Igorski March 2, 2021

Run the snyk test command with the -d flag to get more debug information.

I have a very similar problem only when using Gradle. I wonder if the root cause is the same. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events