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

Cannot complete initial NVD download - 503 status #6107

Closed
OrangeDog opened this issue Nov 22, 2023 · 120 comments
Closed

Cannot complete initial NVD download - 503 status #6107

OrangeDog opened this issue Nov 22, 2023 · 120 comments
Labels

Comments

@OrangeDog
Copy link
Contributor

Describe the bug
The default configuration, with an API key, is either making requests too quickly, or not retrying enough, or both. It always eventually fails with a 503 error from NVD.

Version of dependency-check used
Maven plugin 9.0.0

Log file

[INFO] --- dependency-check:9.0.0:check (default-cli) @ test ---
[INFO] Checking for updates
[INFO] NVD API has 171,358 records in this update
[INFO] Downloaded 20,000/171,358 (12%)
[ERROR] 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:336)
    at org.owasp.dependencycheck.data.update.NvdApiDataSource.update (NvdApiDataSource.java:110)
    at org.owasp.dependencycheck.Engine.doUpdates (Engine.java:902)
    at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase (Engine.java:707)
    at org.owasp.dependencycheck.Engine.analyzeDependencies (Engine.java:633)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.runCheck (BaseDependencyCheckMojo.java:1936)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.execute (BaseDependencyCheckMojo.java:1119)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:52)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:161)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:73)
Caused by: io.github.jeremylong.openvulnerability.client.nvd.NvdApiException: NVD Returned Status Code: 503
    at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next (NvdCveClient.java:327)
    at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi (NvdApiDataSource.java:315)
    at org.owasp.dependencycheck.data.update.NvdApiDataSource.update (NvdApiDataSource.java:110)
    at org.owasp.dependencycheck.Engine.doUpdates (Engine.java:902)
    at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase (Engine.java:707)
    at org.owasp.dependencycheck.Engine.analyzeDependencies (Engine.java:633)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.runCheck (BaseDependencyCheckMojo.java:1936)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.execute (BaseDependencyCheckMojo.java:1119)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:52)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:161)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:73)
[INFO] Skipping RetireJS update since last update was within 24 hours.
[INFO] Skipping Hosted Suppressions file update since last update was within 2 hours.
[INFO] Skipping Known Exploited Vulnerabilities update check since last check was within 24 hours.
[WARNING] Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
[ERROR] Unable to continue dependency-check analysis.
[ERROR] Fatal exception(s) analyzing Test
[INFO] Cache event queue destroyed: CacheEventQueue [listenerId=-135459835, cacheName=NODEAUDIT]
[INFO] Cache event queue destroyed: CacheEventQueue [listenerId=-135459835, cacheName=CENTRAL]
[INFO] Cache event queue destroyed: CacheEventQueue [listenerId=-135459835, cacheName=POM]
[ERROR] Region [NODEAUDIT] : Not alive and dispose was called, filename: NODEAUDIT
[ERROR] Region [CENTRAL] : Not alive and dispose was called, filename: CENTRAL
[ERROR] Region [POM] : Not alive and dispose was called, filename: POM

The debug log in this case is a nightmare as it logs every raw request and response, 16 bytes at a time, without synchronisation so they're all misordered. I'm not going through that to sanitise my API key.

To Reproduce
mvn dependency-check:check

Expected behavior
Successful completion of the download.

@OrangeDog OrangeDog added the bug label Nov 22, 2023
@croudet
Copy link

croudet commented Nov 22, 2023

Same for me.

@OrangeDog
Copy link
Contributor Author

OrangeDog commented Nov 22, 2023

It looks like perhaps there is a retry mechanism, but for some reason the connection pool has been closed and it doesn't do anything about it.

[DEBUG] Shutdown connection pool GRACEFUL
[DEBUG] c-0000000006 Shutdown connection GRACEFUL
[DEBUG] Connection pool shut down
[DEBUG] Shutdown GRACEFUL
[DEBUG] c-0000000007[ACTIVE][rw:w][ACTIVE][rw][NOT_HANDSHAKING][0][0][0] Enqueued ShutdownCommand with priority IMMEDIATE
[DEBUG] c-0000000007[ACTIVE][r:w][ACTIVE][r][NOT_HANDSHAKING][0][0][0] Event cleared [w]
[DEBUG] c-0000000007[ACTIVE][rw:w][ACTIVE][rw][NOT_HANDSHAKING][0][0][0] Event set [w]
[DEBUG] ex-0000000008: consume response data, len 8192 bytes
[DEBUG] ex-0000000008: consume response data, len 8128 bytes
[DEBUG] c-0000000007[ACTIVE][r:w][ACTIVE][r][NOT_HANDSHAKING][0][0][0] Event cleared [w]
[DEBUG] ex-0000000008: execution failed: Connection is closed
[DEBUG] ex-0000000008 request failed: Connection is closed
[DEBUG] ep-0000000008 close IMMEDIATE
[DEBUG] ep-0000000008 endpoint closed
[DEBUG] ep-0000000008 discarding endpoint
[DEBUG] ep-0000000008 releasing endpoint
[DEBUG] ep-0000000008 connection released [route: {s}->https://services.nvd.nist.gov:443][total available: 0; route allocated: 0 of 5; total allocated: 0 of 25]
[DEBUG] request failed
org.apache.hc.core5.http.ConnectionClosedException: Connection is closed
    at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexer.disconnected (ClientHttp1StreamDuplexer.java:205)
    at org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onDisconnect (AbstractHttp1StreamDuplexer.java:409)
    at org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.disconnected (AbstractHttp1IOEventHandler.java:95)
    at org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.disconnected (ClientHttp1IOEventHandler.java:41)
    at org.apache.hc.client5.http.impl.async.LoggingIOSession$1.disconnected (LoggingIOSession.java:258)
    at org.apache.hc.core5.reactor.ssl.SSLIOSession$1.disconnected (SSLIOSession.java:247)
    at org.apache.hc.core5.reactor.InternalDataChannel.disconnected (InternalDataChannel.java:204)
    at org.apache.hc.core5.reactor.SingleCoreIOReactor.processClosedSessions (SingleCoreIOReactor.java:231)
    at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute (SingleCoreIOReactor.java:133)
    at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute (AbstractSingleCoreIOReactor.java:86)
    at org.apache.hc.core5.reactor.IOReactorWorker.run (IOReactorWorker.java:44)
    at java.lang.Thread.run (Thread.java:829)
[DEBUG] Ticket returned At: 17:11:13; count: 23
[DEBUG] Ticket taken At: 17:11:13; count: 24
[DEBUG] Requested At: 17:11:13; URI: /rest/json/cves/2.0?virtualMatchString=cpe%3A2.3%3Aa%3A&resultsPerPage=2000&startIndex=22000
[DEBUG] ex-0000000025 preparing request execution
[DEBUG] ex-0000000025 target auth state: UNCHALLENGED
[DEBUG] ex-0000000025 proxy auth state: UNCHALLENGED
[DEBUG] ex-0000000025 acquiring connection with route {s}->https://services.nvd.nist.gov:443
[DEBUG] ex-0000000025 acquiring endpoint (3 MINUTES)
[DEBUG] ex-0000000025 endpoint lease request (3 MINUTES) [route: {s}->https://services.nvd.nist.gov:443][total available: 0; route allocated: 0 of 5; total allocated: 0 of 25]
[DEBUG] request failed
java.lang.IllegalStateException: Connection pool shut down
    at org.apache.hc.core5.util.Asserts.check (Asserts.java:38)
    at org.apache.hc.core5.pool.StrictConnPool.lease (StrictConnPool.java:176)
    at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager$3.<init> (PoolingAsyncClientConnectionManager.java:271)
    at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager.lease (PoolingAsyncClientConnectionManager.java:266)
    at org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime.acquireEndpoint (InternalHttpAsyncExecRuntime.java:105)
    at org.apache.hc.client5.http.impl.async.AsyncConnectExec.execute (AsyncConnectExec.java:141)
    at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute (AsyncExecChainElement.java:54)
    at org.apache.hc.client5.http.impl.async.AsyncProtocolExec.internalExecute (AsyncProtocolExec.java:207)
    at org.apache.hc.client5.http.impl.async.AsyncProtocolExec.execute (AsyncProtocolExec.java:172)
    at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute (AsyncExecChainElement.java:54)
    at org.apache.hc.client5.http.impl.async.AsyncHttpRequestRetryExec.internalExecute (AsyncHttpRequestRetryExec.java:97)
    at org.apache.hc.client5.http.impl.async.AsyncHttpRequestRetryExec.execute (AsyncHttpRequestRetryExec.java:184)
    at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute (AsyncExecChainElement.java:54)
    at org.apache.hc.client5.http.impl.async.AsyncRedirectExec.internalExecute (AsyncRedirectExec.java:112)
    at org.apache.hc.client5.http.impl.async.AsyncRedirectExec.execute (AsyncRedirectExec.java:278)
    at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute (AsyncExecChainElement.java:54)
    at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient.executeImmediate (InternalAbstractHttpAsyncClient.java:347)
    at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient.lambda$doExecute$0 (InternalAbstractHttpAsyncClient.java:205)
    at org.apache.hc.core5.http.nio.support.BasicRequestProducer.sendRequest (BasicRequestProducer.java:93)
    at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient.doExecute (InternalAbstractHttpAsyncClient.java:178)
    at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute (CloseableHttpAsyncClient.java:97)
    at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute (CloseableHttpAsyncClient.java:107)
    at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute (CloseableHttpAsyncClient.java:124)
    at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute (CloseableHttpAsyncClient.java:130)
    at io.github.jeremylong.openvulnerability.client.nvd.RateLimitedClient.delayedExecute (RateLimitedClient.java:179)
    at io.github.jeremylong.openvulnerability.client.nvd.RateLimitedClient.lambda$execute$0 (RateLimitedClient.java:152)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:829)
[DEBUG] Ticket returned At: 17:11:13; count: 24
[DEBUG] Rate Limited API call - waiting for 2000ms
[DEBUG] Ticket taken At: 17:11:13; count: 25
[DEBUG] Requested At: 17:11:13; URI: /rest/json/cves/2.0?virtualMatchString=cpe%3A2.3%3Aa%3A&resultsPerPage=2000&startIndex=58000
[DEBUG] ex-0000000026 preparing request execution
[DEBUG] ex-0000000026 target auth state: UNCHALLENGED
[DEBUG] ex-0000000026 proxy auth state: UNCHALLENGED
[DEBUG] ex-0000000026 acquiring connection with route {s}->https://services.nvd.nist.gov:443
[DEBUG] ex-0000000026 acquiring endpoint (3 MINUTES)
[DEBUG] ex-0000000026 endpoint lease request (3 MINUTES) [route: {s}->https://services.nvd.nist.gov:443][total available: 0; route allocated: 0 of 5; total allocated: 0 of 25]
[DEBUG] request failed
java.lang.IllegalStateException: Connection pool shut down

That repeats for a bit, with the ex-00000... number continuing to increment.

@jeremylong
Copy link
Owner

Can you try increasing the delay? For the CLI it would be --nvdApiDelay 16000?

@jeremylong
Copy link
Owner

By default it is attempting to use 8000 without an API key.

@mastermc0
Copy link

mastermc0 commented Nov 22, 2023 via email

@croudet
Copy link

croudet commented Nov 22, 2023

I am using the gradle plugin with the following:

dependencyCheck {
    nvd {
        apiKey = '<my-api-key>'
        delay = 16000
    }
}

Still result in 503:

$ ./gradlew dependencyCheckAnalyze

> Task :dependencyCheckAnalyze
Verifying dependencies for project access
Checking for updates and analyzing dependencies for vulnerabilities
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:336)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:110)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:902)
        at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:707)
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:633)
        at org.owasp.dependencycheck.gradle.tasks.AbstractAnalyze.analyze(AbstractAnalyze.groovy:100)
        at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:568)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
        at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:248)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:73)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:233)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:216)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:199)
        at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:166)
        at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
        at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:78)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:28)
        at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.executeDelegateBroadcastingChanges(CaptureStateAfterExecutionStep.java:100)
        at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:72)
        at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:50)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:179)
        at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:70)
        at org.gradle.internal.Either$Right.fold(Either.java:175)
        at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:68)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:46)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:36)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:25)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:91)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:55)
        at [email protected]/java.util.Optional.orElseGet(Optional.java:364)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:37)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:77)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:38)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:108)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:71)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:45)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNonEmptySources(SkipEmptyWorkStep.java:177)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:81)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:53)
        at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
        at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
        at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:75)
        at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:41)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:66)
        at [email protected]/java.util.Optional.orElseGet(Optional.java:364)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:66)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:38)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:32)
        at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:293)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:21)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:64)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:78)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
        at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at [email protected]/java.lang.Thread.run(Thread.java:840)
Caused by: io.github.jeremylong.openvulnerability.client.nvd.NvdApiException: NVD Returned Status Code: 503
        at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:327)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:315)
        ... 133 more
Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
Unable to continue dependency-check analysis.

Region [NODEAUDIT] : Not alive and dispose was called, filename: NODEAUDIT
Region [CENTRAL] : Not alive and dispose was called, filename: CENTRAL
Region [POM] : Not alive and dispose was called, filename: POM

> Task :dependencyCheckAnalyze FAILED

@jeremylong
Copy link
Owner

yup... apparently the NVD API is under load... maybe they'll delay the retirement of the data feeds...

@rkapoor028
Copy link

rkapoor028 commented Nov 22, 2023

same is happening for us.

@nscuro
Copy link

nscuro commented Nov 22, 2023

Yeah even with DT and API key I'm getting rate limited to no end.

@jeremylong maybe they'll delay the retirement of the data feeds...

If that is the outcome then it'd be a win for everyone 😆 DC adopting the NVD REST API must be one of the most brutal load tests you can get! 9.0 was only released today so I'm assuming the situation will not get better as folks proceed with upgrading.

@jim-liu
Copy link
Contributor

jim-liu commented Nov 23, 2023

Can you try increasing the delay? For the CLI it would be --nvdApiDelay 16000?

Not sure if it's relevant. I've tried a 300000ms delay with vulnz (with or without API key), but still getting 503 after a couple requests.

@chadlwilson
Copy link
Contributor

chadlwilson commented Nov 23, 2023

I'm getting 404s now (while using an API key) - wonder if it's related or something else bad in the API data or dep check's use of it.

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:336)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:110)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:902)
        at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:707)
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:633)
        at org.owasp.dependencycheck.gradle.tasks.AbstractAnalyze.analyze(AbstractAnalyze.groovy:100)
       ... SNIP
Caused by: io.github.jeremylong.openvulnerability.client.nvd.NvdApiException: NVD Returned Status Code: 404
        at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:327)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:315)
        ... 165 more

Edit: seems this was an invalid API key somehow, see #6107 (comment)

@nico-arianto
Copy link

nico-arianto commented Nov 23, 2023

Yes, I also experiencing 503 issue with or without the NVD API Key.

@tornstam
Copy link

tornstam commented Nov 23, 2023

I have the same problem with an api key

[INFO] Checking for updates
[INFO] NVD API has 171,457 records in this update
[INFO] Downloaded 20,000/171,457 (12%)
[INFO] Downloaded 40,000/171,457 (23%)
[ERROR] Error updating the NVD Data
org.owasp.dependencycheck.data.update.exception.UpdateException: Error updating the NVD Data
...
Caused by: io.github.jeremylong.openvulnerability.client.nvd.NvdApiException: NVD Returned Status Code: 503

@JeremyJeanson
Copy link

Same situation here with an API Key 😞

@andrzej-talarek
Copy link

Same here - despite 16k delay.

@danshome
Copy link

Same here...404

One or more exceptions occurred during analysis:
UpdateException: Error updating the NVD Data
caused by NvdApiException: NVD Returned Status Code: 404
NoDataException: No documents exist

I have the nvdApiKey set and 16000.

@chadlwilson
Copy link
Contributor

Looks like the 404s are most likely be to do with invalid API Keys, according to https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-404-error-occurs (with some speculation about NVD giving out API keys that don't work here, as would seem likely in my case as I am pretty confident my key was correct).

Regenerated my key and am now onto the 503s like others :-)

@danshome
Copy link

@chadlwilson Yep. Ran the test curl -H "Accept: application/json" -H "apiKey: ########-####-####-####-############" -v https://services.nvd.nist.gov/rest/json/cves/2.0\?cpeName\=cpe:2.3:o:microsoft:windows_10:1607:\*:\*:\*:\*:\*:\*:\*

The key was bad. Requested and new one, and the second one they sent me works. Looks like they have some issues to workout with this new API.

@danshome
Copy link

danshome commented Nov 23, 2023

@chadlwilson How are you supposed to list the API key in nvdApiKey?

apiKey: ########-####-####-####-############
or
########-####-####-####-############

If I list it the first way I get a 503, if I list it the second way I get a 404, but the test using curl with the new API key it works fine.

@chadlwilson
Copy link
Contributor

@danshome
Copy link

danshome commented Nov 23, 2023

The curl command is working fine, but from the plugin it's getting a 503...

One or more exceptions occurred during analysis:
UpdateException: Error updating the NVD Data
caused by NvdApiException: NVD Returned Status Code: 503
NoDataException: No documents exist

@danshome
Copy link

danshome commented Nov 23, 2023

I had to add <nvdApiDelay>16000</nvdApiDelay> back, now it's working. There was about a 30 second delay before it finally started to download.

@danshome
Copy link

danshome commented Nov 23, 2023

@chadlwilson Have you tested with maven parallel builds before? We build with -T1C and it's looking like it might be attempting to use multiple threads to connect to the API.

I'm running with mvn -X now and I can see it downloading, but after about a minute of downloading it got...

One or more exceptions occurred during analysis:
UpdateException: Error updating the NVD Data
caused by NvdApiException: NVD Returned Status Code: 503
NoDataException: No documents exist

I'm going to try again and double the nvdApiDelay

@danshome
Copy link

Looks like they have some issues to work on. I bumped up <nvdApiDelay>32000</nvdApiDelay>. It got further this time, but eventually failed with a 503. Here are the debug logs showing the failure.

failure.txt

@OrangeDog
Copy link
Contributor Author

🤞 that results in them continuing the significantly more efficient data downloads

@Maxouwell
Copy link

Maxouwell commented Nov 28, 2023

They also seems to have closed th API Key deliverance.
image

@marcelhdl
Copy link

@jeremylong Thx for your work! Do you have any new information about the usability of the API?
Currently the new way via the API isnt usable isnt it?

@ccidecio
Copy link

@Maxouwell I have just generated an API key, it seems they have enabled that back. Just FYI

@dlakatos847
Copy link

dlakatos847 commented Nov 29, 2023

If you refresh on the page https://nvd.nist.gov/developers/confirm-api-key?uuid= by mistake it regenerates the key and the old one will no longer work resulting in 404.

@somera
Copy link

somera commented Nov 29, 2023

Isn't working for me since two days. I got new API key and I get

[WARNING] NVD API request failures are occurring; retrying request for the 11 time
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443

@carlmolemans
Copy link

Can you elaborate as to why this was closed? I see no solution and am experiencing the same issue as mentioned in the ticket.

@somera
Copy link

somera commented Dec 4, 2023

@carlmolemans have you done it with 9.0.2? For me it's working #6186

@nico-arianto
Copy link

[Update] It's working now for me with 9.0.2 Thanks

@ruben0909
Copy link

It's failing for me again with 9.0.7 in Azure Devops

@carlmolemans
Copy link

Isn't working for me since two days. I got new API key and I get

[WARNING] NVD API request failures are occurring; retrying request for the 11 time
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443

We solved it by creating a "common" pipeline for the dependency checks. This runs each night and our builds verify themselves against this cache.

@lorthirk
Copy link

Isn't working for me since two days. I got new API key and I get

[WARNING] NVD API request failures are occurring; retrying request for the 11 time
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443
[INFO] Recoverable I/O exception (org.apache.hc.core5.http.ConnectionClosedException) caught when processing request to {s}->https://services.nvd.nist.gov:443

Same for me from a Jenkins instance running on AWS. On my machine works fine though...

@ifyenuoyibo
Copy link

I obtained the api key and provided an api key in my pom but still getting the below error

15:44:42 [INFO] Building **** - Parent POMs 3-0-SNAPSHOT [1/21]
15:44:42 [INFO] --------------------------------[ pom ]---------------------------------
15:44:42 [INFO]
15:44:42 [INFO] --- dependency-check-maven:9.0.2:purge (default-cli) @ parent-poms ---
15:44:44 [INFO] Database file purged; local copy of the NVD has been removed
15:44:44 [INFO] Cache directory purged
15:44:44 [INFO]
15:44:44 [INFO] --- dependency-check-maven:9.0.2:aggregate (default-cli) @ parent-poms ---
15:44:45 [INFO] Checking for updates
15:44:45 [WARNING] An NVD API Key was not provided - it is highly recommended to use an NVD API key as the update can take a VERY long time without an API Key
15:47:06 [INFO] Recoverable I/O exception (org.apache.hc.client5.http.ConnectTimeoutException) caught when processing request to {s}->https://services.nvd.nist.gov:443
15:49:13 [INFO] Recoverable I/O exception (org.apache.hc.client5.http.ConnectTimeoutException) caught when processing request to {s}->https://services.nvd.nist.gov:443
15:51:19 [INFO] Recoverable I/O exception (org.apache.hc.client5.http.ConnectTimeoutException) caught when processing request to {s}->https://services.nvd.nist.gov:443

I had earlier tried with version 9.0.7 and was getting this error

14:33:37 [INFO] --- dependency-check-maven:9.0.7:purge (default-cli) @ parent-poms ---
14:33:42 [INFO] Unable to purge database; the database file does not exist: /apps/jenkins-core-agent/.m2/repository-executor-3/org/owasp/dependency-check-utils/9.0.7/../../dependency-check-data/9.0/odc.mv.db
14:33:42 [INFO]
14:33:42 [INFO] --- dependency-check-maven:9.0.7:aggregate (default-cli) @ parent-poms ---
14:33:43 [INFO] Checking for updates
14:33:43 [WARNING] An NVD API Key was not provided - it is highly recommended to use an NVD API key as the update can take a VERY long time without an API Key
14:44:51 [WARNING] NVD API request failures are occurring; retrying request for the 5 time
14:46:58 [WARNING] NVD API request failures are occurring; retrying request for the 6 time
14:49:04 [WARNING] NVD API request failures are occurring; retrying request for the 7 time
14:51:11 [WARNING] NVD API request failures are occurring; retrying request for the 8 time
14:53:32 [WARNING] NVD API request failures are occurring; retrying request for the 9 time
14:55:39 [WARNING] NVD API request failures are occurring; retrying request for the 10 time
14:57:45 [WARNING] NVD API request failures are occurring; retrying request for the 11 time
15:08:39 [WARNING] NVD API request failures are occurring; retrying request for the 5 time
15:11:01 [WARNING] NVD API request failures are occurring; retrying request for the 6 time
15:13:07 [WARNING] NVD API request failures are occurring; retrying request for the 7 time
15:15:13 [WARNING] NVD API request failures are occurring; retrying request for the 8 time

I read a comment on another this thread that said 9.0.2 worked but it doesn't seem to be working for me. Is the issue fixed please @jeremylong ?

@ifyenuoyibo
Copy link

@somera @nico-arianto How long did it take before 9.0.2 worked for you. Did you provide an api key? Please advise. Thanks

@nscuro
Copy link

nscuro commented Dec 22, 2023

@ifyenuoyibo Version 9.0.7 has been released since then, I'd suggest you give that a try: https://github.com/jeremylong/DependencyCheck/blob/main/CHANGELOG.md

@valentijnscholten
Copy link
Contributor

The logs state an API key was NOT provided.

@somera
Copy link

somera commented Dec 23, 2023

@ifyenuoyibo for me it's working since 9.0.2 and I have an NVD API Key. Current run with 9.0.7:

[INFO] Checking for updates
[INFO] NVD API has 1.405 records in this update
[INFO] Downloaded 1.405/1.405 (100%)
[INFO] Completed processing batch 1/1 (100%) in 2.100ms
[INFO] Updating CISA Known Exploited Vulnerability list: https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
[INFO] Begin database defrag
[INFO] End database defrag (3502 ms)
[INFO] Check for updates complete (9771 ms)

@nico-arianto
Copy link

@ifyenuoyibo I'm using the NVD key and it took me ~30 mins with 9.0.2 to download the database for the 1st time from clean state.

@somera
Copy link

somera commented Dec 23, 2023

I needed ~45 minutes with 9.0.2 for the first download.

@lgolubenkobit
Copy link

[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=232000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=234000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=236000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=238000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=240000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=242000
[INFO] NVD API has 242,227 records in this update
[DEBUG] Temporary directory is `/tmp/dctempde847f7a-e691-4425-b8ec-a3b09dbb591e`
[DEBUG] Ticket returned At: 18:27:07; count: 3; by 82
[DEBUG] Ticket taken At: 18:27:07; count: 3; by 82
[DEBUG] Requested At: 18:27:07; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=10000
[DEBUG] Ticket returned At: 18:27:07; count: 4; by 83

..............................................................

[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=240000
[DEBUG] Requested At: 18:20:30; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=220000
[DEBUG] Ticket taken At: 18:20:30; count: 50; by 77
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=238000
[DEBUG] Requested At: 18:20:30; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=166000
[DEBUG] Ticket taken At: 18:20:38; count: 50; by 74
[DEBUG] Requested At: 18:20:38; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=222000
[DEBUG] Ticket returned At: 18:20:42; count: 51; by 75
[DEBUG] Rate Limited API call - waiting for 3736ms
[DEBUG] Content-Type Received: application/json
[DEBUG] Ticket taken At: 18:20:46; count: 50
[DEBUG] Requested At: 18:20:46; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=238000
[DEBUG] Ticket returned At: 18:20:49; count: 51; by 75
[DEBUG] Content-Type Received: application/json
[DEBUG] Content-Type Received: application/json
[DEBUG] Content-Type Received: application/json
[DEBUG] Ticket taken At: 18:21:07; count: 50
[DEBUG] Requested At: 18:21:07; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=240000
[DEBUG] Content-Type Received: application/json
[DEBUG] Retrying request 2 time
[DEBUG] Ticket returned At: 18:21:37; count: 51; by 74
[DEBUG] Content-Type Received: application/json
[ERROR] 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:389)
    at org.owasp.dependencycheck.data.update.NvdApiDataSource.update (NvdApiDataSource.java:116)
    at org.owasp.dependencycheck.Engine.doUpdates (Engine.java:906)
    at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase (Engine.java:711)
    at org.owasp.dependencycheck.Engine.analyzeDependencies (Engine.java:637)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.runCheck (BaseDependencyCheckMojo.java:1953)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.execute (BaseDependencyCheckMojo.java:1136)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)

I cant analyze a project after update to 9.0.10. I'm upgrading from 7.4 according to deprecation informed.

After a lot of times trying to analyze, it looks like after 95% always get this error. Other times, before 95%, when Ticket taken At: xxxx reach count: 50.

Actually I have this properties on pom.xml

                    <nvdApiDelay>16000</nvdApiDelay>
                    <nvdMaxRetryCount>20</nvdMaxRetryCount>
                    <nvdValidForHours>8</nvdValidForHours>
                    <connectionTimeout>15000</connectionTimeout>
                    <nvdApiKey>{apiKey}</nvdApiKey>

@cmuchinsky
Copy link

[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=232000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=234000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=236000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=238000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=240000
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=242000
[INFO] NVD API has 242,227 records in this update
[DEBUG] Temporary directory is `/tmp/dctempde847f7a-e691-4425-b8ec-a3b09dbb591e`
[DEBUG] Ticket returned At: 18:27:07; count: 3; by 82
[DEBUG] Ticket taken At: 18:27:07; count: 3; by 82
[DEBUG] Requested At: 18:27:07; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=10000
[DEBUG] Ticket returned At: 18:27:07; count: 4; by 83

..............................................................

[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=240000
[DEBUG] Requested At: 18:20:30; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=220000
[DEBUG] Ticket taken At: 18:20:30; count: 50; by 77
[DEBUG] requesting URI: https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=2000&startIndex=238000
[DEBUG] Requested At: 18:20:30; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=166000
[DEBUG] Ticket taken At: 18:20:38; count: 50; by 74
[DEBUG] Requested At: 18:20:38; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=222000
[DEBUG] Ticket returned At: 18:20:42; count: 51; by 75
[DEBUG] Rate Limited API call - waiting for 3736ms
[DEBUG] Content-Type Received: application/json
[DEBUG] Ticket taken At: 18:20:46; count: 50
[DEBUG] Requested At: 18:20:46; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=238000
[DEBUG] Ticket returned At: 18:20:49; count: 51; by 75
[DEBUG] Content-Type Received: application/json
[DEBUG] Content-Type Received: application/json
[DEBUG] Content-Type Received: application/json
[DEBUG] Ticket taken At: 18:21:07; count: 50
[DEBUG] Requested At: 18:21:07; URI: /rest/json/cves/2.0?resultsPerPage=2000&startIndex=240000
[DEBUG] Content-Type Received: application/json
[DEBUG] Retrying request 2 time
[DEBUG] Ticket returned At: 18:21:37; count: 51; by 74
[DEBUG] Content-Type Received: application/json
[ERROR] 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:389)
    at org.owasp.dependencycheck.data.update.NvdApiDataSource.update (NvdApiDataSource.java:116)
    at org.owasp.dependencycheck.Engine.doUpdates (Engine.java:906)
    at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase (Engine.java:711)
    at org.owasp.dependencycheck.Engine.analyzeDependencies (Engine.java:637)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.runCheck (BaseDependencyCheckMojo.java:1953)
    at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.execute (BaseDependencyCheckMojo.java:1136)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)

I cant analyze a project after update to 9.0.10. I'm upgrading from 7.4 according to deprecation informed.

After a lot of times trying to analyze, it looks like after 95% always get this error. Other times, before 95%, when Ticket taken At: xxxx reach count: 50.

Actually I have this properties on pom.xml

                    <nvdApiDelay>16000</nvdApiDelay>
                    <nvdMaxRetryCount>20</nvdMaxRetryCount>
                    <nvdValidForHours>8</nvdValidForHours>
                    <connectionTimeout>15000</connectionTimeout>
                    <nvdApiKey>{apiKey}</nvdApiKey>

I am seeing the same, as this was working fine yesterday with 9.0.10, I suspect it might be related to something in the NVD data itself?

@giacgbj
Copy link

giacgbj commented Mar 20, 2024

I am seeing the same, as this was working fine yesterday with 9.0.10, I suspect it might be related to something in the NVD data itself?

From https://nvd.nist.gov/:

NIST is currently working to establish a consortium to address challenges in the NVD program and develop improved tools and methods. You will temporarily see delays in analysis efforts during this transition. We apologize for the inconvenience and ask for your patience as we work to improve the NVD program.

@lgolubenkobit
Copy link

I am seeing the same, as this was working fine yesterday with 9.0.10, I suspect it might be related to something in the NVD data itself?

From https://nvd.nist.gov/:

NIST is currently working to establish a consortium to address challenges in the NVD program and develop improved tools and methods. You will temporarily see delays in analysis efforts during this transition. We apologize for the inconvenience and ask for your patience as we work to improve the NVD program.

It's possible that error is cause by an external server, but, Isn't possible to reuse already downloaded segments?
Each time analyze is executed download starts from 0, it doesn't reuse vulnerabilites downloaded previously. It tooks more than 20/30 minutes each running to get always same error at same percent.

Now i'm running locally, 4 hours at least with a lot of retries, and without download db for first time.
Previous version randomly fails, but after 2/3 retries, analyze can be completed.

@petersone-netic
Copy link

petersone-netic commented Mar 21, 2024

It would be nice to have some kind of configuration option like:
<failBuildOnExternalConnectionError>

@StefanHirche
Copy link

In my case even failOnError=false does not help, as the build task checkAggregate still fails.
Task :dependencyCheckAggregate FAILED

@nightm4re94
Copy link

In my case even failOnError=false does not help, as the build task checkAggregate still fails. Task :dependencyCheckAggregate FAILED

same for me!

Repository owner locked and limited conversation to collaborators Jul 1, 2024
@aikebah
Copy link
Collaborator

aikebah commented Jul 1, 2024

Locked conversation on this one as 'me too' comments are unneeded

For the people suffering from a 'me too' that came here to weigh in: double-check that you do cache your OWASP DependencyCheck data folder, then you should be able to run (with current cached data) using the "don't update" flag of your tool.

If you previously did not cache the intermediate results then make sure to start doing so ASAP in order to not contribute to the DDoS on the NVD API in the future.

Preferably set up a dedicated periodic job (e.g. every 4 hours) to just update your cached copy in your infrastructure and configure your builds to run without updating so that you are less impacted by infrastructure overload at the side of the NIST NVD (as a bonus you also are causing less impact on NIST NVD infrastructure by your builds reducing the risk for everyone to run into a 503).

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

No branches or pull requests