Skip to content

Pipelines fails due to NoDataException / UpdateException: Error updating the NVD Data #460

@RikNorakomi

Description

@RikNorakomi

When trying to run the dependencyCheckAggregate task locally the dependency reports are generated correctly.

I am having issues running them in an Azure DevOps pipeline though:

The pipeline failse due to the following:

Checking for updates and analyzing dependencies for vulnerabilities
Checking for updates
Error updating the NVD Data
org.owasp.dependencycheck.data.update.exception.UpdateException: Error updating the NVD Data
	at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:399)
	at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:117)
	at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:903)
	at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:708)

...
		at [email protected]/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.NullPointerException: Cannot read the array length because "bytes" is null
	at java.base/java.lang.String.<init>(String.java:1387)
	at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient._next(NvdCveClient.java:440)
	at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:379)
	at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:355)
...

Caused by: org.owasp.dependencycheck.exception.ExceptionCollection: One or more exceptions occurred during analysis:
	UpdateException: Error updating the NVD Data
		caused by NullPointerException: Cannot read the array length because "bytes" is null
	NoDataException: No documents exist
	at org.owasp.dependencycheck.Engine.throwFatalExceptionCollection(Engine.java:1178)
	at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:640)
	at org.owasp.dependencycheck.gradle.tasks.AbstractAnalyze.analyze(AbstractAnalyze.groovy:103)

  1. And I have my gradle file configured as followed:
configure<org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension> {
    nvd.apiKey = [myApiKey]
    format = org.owasp.dependencycheck.reporting.ReportGenerator.Format.ALL.toString()
    outputDirectory = "$projectDir/build/reports/owasp-report"
}
  1. Alternatively I have tried configuring autoUpdate = false but this also leads to a NoDataException:
Caused by: org.owasp.dependencycheck.exception.ExceptionCollection: One or more exceptions occurred during analysis:
	NoDataException: Autoupdate is disabled and the database does not exist
	at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:720)
	at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:634)
	at org.owasp.dependencycheck.gradle.tasks.AbstractAnalyze.analyze(AbstractAnalyze.groovy:103)

How do I fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions