sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.94k stars 572 forks source link

Statistics - recalculate vulnerabilities statistics failure #472

Closed somera closed 1 week ago

somera commented 1 month ago

OSS 3.72.0-04

The "Statistics - recalculate vulnerabilities statistics" task isn't working.

==> nexus.log <==
2024-09-07 16:39:16,852+0000 INFO  [quartz-9-thread-20]  *SYSTEM com.sonatype.nexus.vulnerability.internal.log.VulnerabilityStatisticsTask - Task log: /nexus/sonatype-work/nexus3/log/tasks/repository.vulnerability.statistics-20240907163916850.log
2024-09-07 16:39:16,854+0000 WARN  [quartz-9-thread-20]  *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task 2bba648a-27d1-4292-b907-e6d04864a944 : 'Statistics - recalculate vulnerabilities statistics' [repository.vulnerability.statistics] execution failure
java.time.format.DateTimeParseException: Text '05/Sep/2024:09:36:10 +0000' could not be parsed at index 3
        at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052)
        at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1954)
        at java.base/java.time.ZonedDateTime.parse(ZonedDateTime.java:600)
        at com.sonatype.nexus.vulnerability.internal.log.RequestLogAggregator.extractDate(RequestLogAggregator.java:118)
        at com.sonatype.nexus.vulnerability.internal.log.RequestLogAggregator.parseLogFiles(RequestLogAggregator.java:97)
        at com.sonatype.nexus.vulnerability.internal.log.RequestLogAggregator.versionRequestCount(RequestLogAggregator.java:71)
        at com.sonatype.nexus.vulnerability.internal.log.VulnerabilityRadarService.recalculateStatistics(VulnerabilityRadarService.java:68)
        at com.sonatype.nexus.vulnerability.internal.log.VulnerabilityStatisticsTask.execute(VulnerabilityStatisticsTask.java:37)
        at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:105)
        at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:143)
        at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:106)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:145)
        at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
        at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
        at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
2024-09-07 16:39:16,855+0000 INFO  [quartz-9-thread-20]  *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'Statistics - recalculate vulnerabilities statistics' [repository.vulnerability.statistics] state change RUNNING -> WAITING (FAILED)

This image is my configuation.

image

And I start it manualy for testing after OrientDB to H2 migration.

somera commented 1 month ago

With OSS 3.70.2-01 it's working.

somera commented 1 month ago

@mrprescott any updates here?

somera commented 3 weeks ago

Still same in OSS 3.73.0-12

==> nexus.log <==
2024-10-11 10:23:33,547+0000 INFO  [quartz-9-thread-19]  *SYSTEM com.sonatype.nexus.vulnerability.internal.log.VulnerabilityStatisticsTask - Task log: /nexus/sonatype-work/nexus3/log/tasks/repository.vulnerability.statistics-20241011102333534.log
2024-10-11 10:23:33,659+0000 WARN  [quartz-9-thread-19]  *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task 0deedb35-a2d5-43a1-b848-cac8fbc90ad0 : 'Statistics - recalculate vulnerabilities statistics' [repository.vulnerability.statistics] execution failure
java.time.format.DateTimeParseException: Text '07/Sep/2024:09:39:20 +0000' could not be parsed at index 3
        at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052)
        at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1954)
        at java.base/java.time.ZonedDateTime.parse(ZonedDateTime.java:600)
        at com.sonatype.nexus.vulnerability.internal.log.RequestLogAggregator.extractDate(RequestLogAggregator.java:118)
        at com.sonatype.nexus.vulnerability.internal.log.RequestLogAggregator.parseLogFiles(RequestLogAggregator.java:97)
        at com.sonatype.nexus.vulnerability.internal.log.RequestLogAggregator.versionRequestCount(RequestLogAggregator.java:71)
        at com.sonatype.nexus.vulnerability.internal.log.VulnerabilityRadarService.recalculateStatistics(VulnerabilityRadarService.java:68)
        at com.sonatype.nexus.vulnerability.internal.log.VulnerabilityStatisticsTask.execute(VulnerabilityStatisticsTask.java:37)
        at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:105)
        at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:143)
        at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:106)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:145)
        at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
        at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
        at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
somera commented 3 weeks ago

I deleted the task and added it again. Same problem with the same date.

Why September? -> 07/Sep/2024:09:39:20 +0000

How can I fix it?

somera commented 1 week ago

Looks like Nexus is slowly dying. Cause nothing happens here.

I solved it. Just by deleting older fildes in /sonatype-work/nexus3/tmp folder.

I'm asking me, why I get this error with some files in the /tmp folder.