question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RetireJS checks frequently fail due to corrupt jsrepository.json file

See original GitHub issue

Describe the bug

I frequently get this stack trace failing the dependency check:

Caused by: org.owasp.dependencycheck.exception.ExceptionCollection: One or more exceptions occurred during analysis:
        Failed to initialize the RetireJS repo: `/Users/tester/.gradle/dependency-check-data/4.0/jsrepository.json` appears to be malformed. Please delete the file or run the dependency-check purge command and re-try running dependency-check.
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:719)
        at org.owasp.dependencycheck.Engine$analyzeDependencies$2.call(Unknown Source)
        at org.owasp.dependencycheck.gradle.tasks.AbstractAnalyze.analyze(AbstractAnalyze.groovy:88)
        ... 85 more

I delete the file manually and that does make the next check pass, but then randomly it corrupts itself again in the future.

Version of dependency-check used

The problem occurs using version 5.3.2.1 of the Gradle plugin.

Log file

I’m unable to find any logs other than the stack trace I get in the build itself.

To Reproduce

To determine.

It happens frequently in our multi-project build, but not at all in one of my simpler single-project builds, so I’m thinking it might require a multi-project build to reproduce it, but haven’t determined anything specific yet, and our own build is private so I can’t just post it. 😦

When I see the build running, I notice that the checks are running on multiple subprojects at the same time. This could be a hint - maybe one of them reads the file while another one is actively writing data into it?

Expected behavior

  1. Any updates to any file should be done atomically so that it isn’t possible for someone to find the file in a half-initialised state.

  2. If the file is corrupt, it should be deleted and then treated as if it didn’t exist.

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcoopercommented, May 15, 2020

I am experiencing the same issue starting today. As suggested, I even removed the entire ~/.m2/repository/org/owasp/dependency-check-utils/5.3.2/ directory to try to fix the corrupted jsrepository.json file, but I get the same error for every build:

[INFO] --- dependency-check-maven:5.3.2:aggregate (dependency-check) @ oauth-service ---
[INFO] Checking for updates
[INFO] Skipping NVD check since last check was within 4 hours.
[INFO] Skipping RetireJS update since last update was within 24 hours.
[INFO] Check for updates complete (1549 ms)
[INFO] 

Dependency-Check is an open source tool performing a best effort analysis of 3rd party dependencies; false positives and false negatives may exist in the analysis performed by the tool. Use of the tool and the reporting provided constitutes acceptance for use in an AS IS condition, and there are NO warranties, implied or otherwise, with regard to the analysis or its use. Any use of the tool and the reporting provided is at the user’s risk. In no event shall the copyright holder or OWASP be held liable for any damages whatsoever arising out of or in connection with the use of this tool, the analysis performed, or the resulting report.


[INFO] Analysis Started
[INFO] Finished Archive Analyzer (0 seconds)
[INFO] Finished File Name Analyzer (0 seconds)
[INFO] Finished Jar Analyzer (0 seconds)
[ERROR] ----------------------------------------------------
[ERROR] .NET Assembly Analyzer could not be initialized and at least one 'exe' or 'dll' was scanned. The 'dotnet' executable could not be found on the path; either disable the Assembly Analyzer or add the path to dotnet core in the configuration.
[ERROR] ----------------------------------------------------
[WARNING] No lock file exists - this will result in false negatives; please run `npm install --package-lock`
[INFO] Finished Node.js Package Analyzer (0 seconds)
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Created CPE Index (1 seconds)
[INFO] Finished CPE Analyzer (4 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[ERROR] Exception occurred initializing RetireJS Analyzer.
[INFO] Finished Sonatype OSS Index Analyzer (0 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (1 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
[INFO] Analysis Complete (8 seconds)
[WARNING] 

One or more dependencies were identified with known vulnerabilities in oauth-service:

log4j-api-2.12.1.jar (pkg:maven/org.apache.logging.log4j/log4j-api@2.12.1, cpe:2.3:a:apache:log4j:2.12.1:*:*:*:*:*:*:*) : CVE-2020-9488


See the dependency-check report for more details.


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:23 min
[INFO] Finished at: 2020-05-15T11:15:33-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.owasp:dependency-check-maven:5.3.2:aggregate (dependency-check) on project oauth-service: One or more exceptions occurred during dependency-check analysis: One or more exceptions occurred during analysis:
[ERROR]         Failed to initialize the RetireJS repo: `/Users/brett/.m2/repository/org/owasp/dependency-check-utils/5.3.2/../../dependency-check-data/4.0/jsrepository.json` appears to be malformed. Please delete the file or run the dependency-check purge command and re-try running dependency-check.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

0reactions
henrykuijperscommented, Sep 8, 2020

Thank you so much @jeremylong ! Looking forward to seeing the fix. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

RetireJS checks frequently fail due to corrupt jsrepository.json ...
Describe the bug I am facing the same issue which is described in #2642 The above issue is closed in 6.0.1 and I...
Read more >
Jenkinsfile pipeline with DependenceCheck fail with RetireJS ...
dependency-check-data/5.0/jsrepository.json'; Error downloading file ... [ERROR] caused by DownloadFailedException: Error downloading file ...
Read more >
OWASP Dependency-Check
Dependency-Check is a Software Composition Analysis (SCA) tool suite that identifies project dependencies and checks if there are any known, ...
Read more >
RetireJsAnalyzer xref
1 /* 2 * This file is part of dependency-check-core. ... 221 } 222 223 //several users are reporting that the retire js...
Read more >
DependencyCheck - Bountysource
OWASP dependency-check is a utility that detects publicly disclosed vulnerabilities in application dependencies. Become a Bounty Hunter You're a Bounty Hunter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found