We are getting the following error when running the Jenkins job to test our React Native code base for vulnerabilities.
Snyk installation is UP-TO-DATE
Testing for known issues...
> /Users/appbuilder/Work/CICDSetup/tools/io.snyk.jenkins.tools.SnykInstallation/Snyk/node_modules/.bin/snyk test --json --severity-threshold=medium --org=PSoft --project-name=Mob-Service
FATAL: Snyk command execution failed
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'env': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"env: node: No such file or directory
"; line: 1, column: 4]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:722)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2868)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1914)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:773)
at io.snyk.jenkins.model.ObjectMapperHelper.unmarshallTestResult(ObjectMapperHelper.java:54)
at io.snyk.jenkins.SnykStepBuilder.perform(SnykStepBuilder.java:262)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
at hudson.model.Build$BuildExecution.build(Build.java:197)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
at hudson.model.Run.execute(Run.java:1907)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Invoke Snyk Security task' changed build result to FAILURE
Build step 'Invoke Snyk Security task' marked build as failure
Running the same command at a shell from the same folder works fine. The issue arises only when it initiated via the “snyk security task” build action.
We tried different things without any success
- Got a fresh checkout of the code
- Wiping our the workspace altogether
- Restricted the scan of files to only package.json or ios/podfile
- Create a brand new Jenkins project and try
Now we are running out of options. Any help would be highly appreciated.