codacy / codacy-analysis-cli-action

GitHub Action for the codacy-analysis-cli
https://github.com/codacy/codacy-analysis-cli
Apache License 2.0
58 stars 18 forks source link

[TS-392] Failed to parse output: Unrecognized token 'No': was expecting 'null', 'true', 'false' or NaN #115

Closed ben-manes closed 1 year ago

ben-manes commented 1 year ago

I observe that the analysis fails. It isn't clear if this is a configuration mistake, in which case the error could be more helpful.

```console Status: Downloaded newer image for codacy/codacy-analysis-cli:7.6.4 05/22 19:04:04 ERROR CodacyPlugins:11 - Failed to parse output: Unrecognized token 'No': was expecting 'null', 'true', 'false' or NaN at [Source: (String)"No specified files"; line: 1, column: 3] - No specified files com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'No': was expecting 'null', 'true', 'false' or NaN at [Source: (String)"No specified files"; line: 1, column: 3] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:703) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2853) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2831) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._matchToken(ReaderBasedJsonParser.java:2612) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1876) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:757) at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4141) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3971) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2[276](https://github.com/ben-manes/caffeine/actions/runs/5049430617/jobs/9058875700#step:5:288)) - classesDirectories: /src sourceDirectories: /src at com.codacy.tools.spotbugs.SpotBugs$.apply(SpotBugs.scala:70) at com.codacy.tools.scala.seed.DockerEngine.executeTool(DockerEngine.scala:53) at com.codacy.tools.scala.seed.DockerEngine.$anonfun$main$2(DockerEngine.scala:35) at scala.util.Success.$anonfun$map$1(Try.scala:255) at scala.util.Success.map(Try.scala:213) at com.codacy.tools.scala.seed.DockerEngine.$anonfun$main$1(DockerEngine.scala:27) at scala.util.Success.flatMap(Try.scala:251) at com.codacy.tools.scala.seed.DockerEngine.main(DockerEngine.scala:26) at com.codacy.tools.spotbugs.Engine.main(Engine.scala) at com.codacy.plugins.runners.BinaryDockerRunner.$anonfun$run$4(BinaryDockerRunner.scala:84) at scala.util.Success.flatMap(Try.scala:251) at com.codacy.plugins.runners.BinaryDockerRunner.run(BinaryDockerRunner.scala:69) at com.codacy.plugins.results.traits.ToolRunner.$anonfun$apply$2(ToolRunner.scala:77) at com.codacy.plugins.results.traits.CodacyDocker$.$anonfun$usingDockerConfig$2(CodacyDocker.scala:45) at com.codacy.plugins.utils.FileHelper$.$anonfun$usingNewFile$2(FileHelper.scala:51) at scala.util.Try$.apply(Try.scala:213) at com.codacy.plugins.utils.FileHelper$.usingNewFile(FileHelper.scala:45) at com.codacy.plugins.results.traits.CodacyDocker$.usingConfigPath(CodacyDocker.scala:57) at com.codacy.plugins.results.traits.CodacyDocker$.$anonfun$usingDockerConfig$1(CodacyDocker.scala:39) at scala.Option.map(Option.scala:230) at com.codacy.plugins.results.traits.CodacyDocker$.usingDockerConfig(CodacyDocker.scala:38) at com.codacy.plugins.results.traits.ToolRunner.$anonfun$apply$1(ToolRunner.scala:76) at scala.util.Try$.apply(Try.scala:213) at com.codacy.plugins.results.traits.ToolRunner.apply(ToolRunner.scala:61) at com.codacy.plugins.results.traits.ToolRunner.run(ToolRunner.scala:49) at com.codacy.analysis.core.tools.Tool.run(Tool.scala:91) at com.codacy.analysis.core.analysis.CodacyPluginsAnalyser.analyse(CodacyPluginsAnalyser.scala:25) at com.codacy.analysis.cli.analysis.AnalyseExecutor.$anonfun$issues$1(AnalyseExecutor.scala:150) at scala.util.Success.flatMap(Try.scala:251) at com.codacy.analysis.cli.analysis.AnalyseExecutor.issues(AnalyseExecutor.scala:142) at com.codacy.analysis.cli.analysis.AnalyseExecutor.$anonfun$run$5(AnalyseExecutor.scala:66) at scala.collection.parallel.AugmentedIterableIterator.map2combiner(RemainsIterator.scala:116) at scala.collection.parallel.AugmentedIterableIterator.map2combiner$(RemainsIterator.scala:113) at scala.collection.parallel.immutable.ParHashSet$ParHashSetIterator.map2combiner(ParHashSet.scala:81) at scala.collection.parallel.ParIterableLike$Map.leaf(ParIterableLike.scala:1056) at scala.collection.parallel.Task.$anonfun$tryLeaf$1(Tasks.scala:53) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.util.control.Breaks$$anon$1.catchBreak(Breaks.scala:67) at scala.collection.parallel.Task.tryLeaf(Tasks.scala:56) at scala.collection.parallel.Task.tryLeaf$(Tasks.scala:50) at scala.collection.parallel.ParIterableLike$Map.tryLeaf(ParIterableLike.scala:1053) at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.internal(Tasks.scala:170) at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.internal$(Tasks.scala:157) at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.internal(Tasks.scala:[440](https://github.com/ben-manes/caffeine/actions/runs/5049430617/jobs/9058875700#step:5:452)) at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.compute(Tasks.scala:150) at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.compute$(Tasks.scala:149) at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.compute(Tasks.scala:440) at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ```
github-actions[bot] commented 1 year ago

Internal ticket created : TS-392

DMarinhoCodacy commented 1 year ago

Hello @ben-manes

Thanks for reporting this.

Can you run codacy/codacy-analysis-cli-action@master instead of codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5? When you run the pipeline, it runs for a old version of cli-action 7.6.3 instead of 7.9.1, which is the latest version.

Kind regards, David Marinho

ben-manes commented 1 year ago

I see, thanks. Can you perform regular releases? OSSF Scorecard will report unpinned actions as a supply chain vulnerability, where only hash versions are considered safe due to tag rewriting. It is easy to keep it updated using dependabot, and you can submit security incidents to github if a version is compromised. Otherwise there is a risk of a compromise like Codecov, SolarWinds, Jetbrains, etc. A dynamic version is really not in anyone's best interest.

ben-manes commented 1 year ago

The error still occurs with 7.9.1

https://github.com/ben-manes/caffeine/actions/runs/5138777500/jobs/9248461369#step:5:354