Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analysis does not continue after update failure #6535

Open
OrangeDog opened this issue Mar 21, 2024 · 6 comments
Open

Analysis does not continue after update failure #6535

OrangeDog opened this issue Mar 21, 2024 · 6 comments
Labels

Comments

@OrangeDog
Copy link
Contributor

Describe the bug
After this is logged:

[WARNING] Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.

The intention is that analysis should continue. However, this is logged instead:

[ERROR] Unable to continue dependency-check analysis.
[ERROR] Fatal exception(s) analyzing Project

Version of dependency-check used
The problem occurs using version 9.0.10 of the maven plugin.

Log file
https://gist.github.com/OrangeDog/24ce9447e015184ccf85ac647e17749b

To Reproduce
Steps to reproduce the behavior:

  1. Have a successful initial sync of the data
  2. Induce NVD updates to fail (these logs were while the service was unavailable)
  3. Run dependency-check:check

Expected behavior
The update fails, but then analysis continues.

Additional context
Retries disabled so it doesn't take 15 hours. However, my logs are also showing this bug: #6531 (comment)

<configuration>
  <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
  <nodeAnalyzerEnabled>false</nodeAnalyzerEnabled>
  <failOnError>false</failOnError>
  <hintsFile>${project.basedir}/hints.xml</hintsFile>
  <nvdApiServerId>nvd</nvdApiServerId>
  <nvdMaxRetryCount>0</nvdMaxRetryCount>
  <ossIndexServerId>sonatype-ossindex</ossIndexServerId>
  <outputDirectory>${project.build.directory}/owasp-reports</outputDirectory>
  <suppressionFile>${project.basedir}/suppressions.xml</suppressionFile>
</configuration>
@OrangeDog OrangeDog added the bug label Mar 21, 2024
@bmeier-pros
Copy link

It's always worked this way in my experience - if it can't update the feed or any of the linked sources (OSSINDEX, hosted suppressions, whatever), the plugin errors out, killing the build. The message sequence has been the same in the past, first the warning, then the error.

I thought this was by design. :-) This is not a regression, but it certainly could be considered a bug.

@OrangeDog
Copy link
Contributor Author

@bmeier-pros it is not by design: #6515 (comment)

@bmeier-pros
Copy link

@OrangeDog very interesting. As far back as I can remember, at least to 6.x, this has been the way it's worked for our builds. We do have failOnError set to true, perhaps that is part of it.

@bmeier-pros
Copy link

Our current configuration looks something like this:

dependencyCheck {
  failBuildOnCVSS = 4.0
  suppressionFiles = files("**/dependency-check-suppressions.xml")
  analyzers {
    experimentalEnabled = false
    centralEnabled = false // hardcoded to access Maven Central, which is disallowed
    assemblyEnabled = false // no .NET assemblies, avoid scanner failure
    nuspecEnabled = false // no nuget specs, avoid scanner failure
    ossIndex {
      enabled = true
    }
    retirejs {
      // Cached Retire JS repository
      retireJsUrl = "${cache}/raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json"
    }
    // Cached known exploited vulnerabilities
    knownExploitedURL = "${cache}/www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"
  }
  nvd {
    delay = 5000
    maxRetryCount = 10
    nvdApiKey = System.getenv("NVD_API_KEY")
  }
  hostedSuppressions {
    // Cached hosted suppressions for false positives
    url = "${cache}/jeremylong.github.io/DependencyCheck/suppressions/publishedSuppressions.xml"
  }
  scanConfigurations = ['runtimeClasspath', 'compileClasspath', 'annotationProcessor']
}

I'm attempting to update to 9.0.10 from 9.0.9 and getting all sorts of strange behavior.

@OrangeDog
Copy link
Contributor Author

Yes, it's always been like this for me too. Since ~v4.

@jeremylong
Copy link
Owner

In my limited spare time - I'm going to have to check the SQL statement used in

ensureDataExists();
} catch (NoDataException ex) {
throwFatalExceptionCollection("Unable to continue dependency-check analysis.", ex, exceptions);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants