Issue with sonarqube-check after upgrade from 2025.2.0 to 2025.3.0

Hello
We’ve upgraded our SonarQube from 2025.2.0 to 2025.3.0

After the upgrade, we are experiencing a problem with the SonarQube check job during the scan of a branch. when it’s failed than In logs of sonarqube we see next:

{"process":"web","timestamp":"2025-06-03T14:07:13.866Z","severity":"WARN","logger":"org.sonar.server.monitoring.MainCollector","message":"Error while executing monitoring task in RecentTasksDurationTask: ","stacktrace":["java.lang.NullPointerException: at index 0","at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:232)","at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:222)","at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:216)","at com.google.common.collect.ImmutableList.sortedCopyOf(ImmutableList.java:345)","at com.google.common.collect.Ordering.immutableSortedCopy(Ordering.java:899)","at org.sonar.db.DatabaseUtils.toUniqueAndSortedList(DatabaseUtils.java:204)","at org.sonar.db.DatabaseUtils.toUniqueAndSortedPartitions(DatabaseUtils.java:190)","at org.sonar.db.DatabaseUtils.executeLargeInputs(DatabaseUtils.java:139)","at org.sonar.db.DatabaseUtils.executeLargeInputs(DatabaseUtils.java:125)","at org.sonar.db.DatabaseUtils.executeLargeInputs(DatabaseUtils.java:114)","at org.sonar.db.entity.EntityDao.selectByUuids(EntityDao.java:42)","at org.sonar.server.monitoring.ce.RecentTasksDurationTask.run(RecentTasksDurationTask.java:60)","at org.sonar.server.monitoring.MainCollector.lambda$start$0(MainCollector.java:54)","at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)","at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)","at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)","at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)","at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)","at java.base/java.lang.Thread.run(Unknown Source)"]}
{"process":"web","timestamp":"2025-06-03T14:07:43.870Z","severity":"WARN","logger":"org.sonar.server.monitoring.MainCollector","message":"Error while executing monitoring task in RecentTasksDurationTask: ","stacktrace":["java.lang.NullPointerException: at index 0","at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:232)","at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:222)","at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:216)","at com.google.common.collect.ImmutableList.sortedCopyOf(ImmutableList.java:345)","at com.google.common.collect.Ordering.immutableSortedCopy(Ordering.java:899)","at org.sonar.db.DatabaseUtils.toUniqueAndSortedList(DatabaseUtils.java:204)","at org.sonar.db.DatabaseUtils.toUniqueAndSortedPartitions(DatabaseUtils.java:190)","at org.sonar.db.DatabaseUtils.executeLargeInputs(DatabaseUtils.java:139)","at org.sonar.db.DatabaseUtils.executeLargeInputs(DatabaseUtils.java:125)","at org.sonar.db.DatabaseUtils.executeLargeInputs(DatabaseUtils.java:114)","at org.sonar.db.entity.EntityDao.selectByUuids(EntityDao.java:42)","at org.sonar.server.monitoring.ce.RecentTasksDurationTask.run(RecentTasksDurationTask.java:60)","at org.sonar.server.monitoring.MainCollector.lambda$start$0(MainCollector.java:54)","at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)","at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)","at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)","at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)","at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)","at java.base/java.lang.Thread.run(Unknown Source)"]}

How can we solve this?

1 Like

I have the same issue after upgrading from SonarQube 2025.2.0 to 2025.3.0.

The sonarqube-check job fails when scanning a branch, and the server logs show repeated NullPointerException errors in RecentTasksDurationTask, like:

Error while executing monitoring task in RecentTasksDurationTask: 
java.lang.NullPointerException: at index 0
...
at org.sonar.db.DatabaseUtils.toUniqueAndSortedList(DatabaseUtils.java:204)
...
at org.sonar.server.monitoring.ce.RecentTasksDurationTask.run(RecentTasksDurationTask.java:60)

This is blocking our pipeline runs. Any workaround or official fix would be appreciated.

1 Like

Hey there.

We’re broadly aware of this issue (SONAR-25220) but not that it is failing scans. Can you give some more details on how the sonarqube-check job is failing? What’s the stacktrace from the scanner?

Hello, Colin, thanks for the reply.
At this moment, we increased the timeout for sonarqube-check from 1h to 5h, and the job passed, but the scan is working for 160-180 minutes. Before the upgrade, the current job worked 20-30 mins. We use SonarScanner CLI 7.1.0.4889

Hey Andrii,

I believe that what you’re seeing in the web.log is a red herring.

You should have timestamps available in your scanner logs. What is taking long?

Hey Colin,
Please check next

2025-06-03T22:25:28.235332Z 01O 22:25:27.942 INFO  Load global settings (done) | time=168ms
2025-06-03T22:25:28.235349Z 01O 22:25:27.977 INFO  Load plugins index (done) | time=23ms
2025-06-03T22:25:28.235358Z 01O 22:25:28.057 INFO  Load/download plugins (done) | time=79ms
2025-06-03T22:25:28.736096Z 01O 22:25:28.361 INFO  Process project properties (done) | time=1ms
2025-06-03T22:25:28.736123Z 01O 22:25:28.394 INFO  Load project settings for component key: '[MASKED]' (done) | time=19ms
2025-06-03T22:25:28.736129Z 01O 22:25:28.434 INFO  Load project branches (done) | time=19ms
2025-06-03T22:25:28.736145Z 01O 22:25:28.437 INFO  Load branch configuration (done) | time=3ms
2025-06-03T22:25:28.736150Z 01O 22:25:28.495 INFO  Load quality profiles (done) | time=46ms
2025-06-03T22:25:29.236599Z 01O 22:25:28.800 INFO  Load active rules (done) | time=279ms
2025-06-03T22:25:32.242785Z 01O 22:25:31.846 INFO  Load analysis cache | time=3041ms
2025-06-03T22:25:37.747549Z 01O 22:25:37.696 INFO  6 languages detected in 21257 preprocessed files (done) | time=5774ms
2025-06-03T22:25:38.248234Z 01O 22:25:37.747 INFO  Load/download plugins (done) | time=47ms
2025-06-03T22:25:38.248251Z 01O 22:25:38.189 INFO  Load project repositories (done) | time=262ms
2025-06-03T22:25:38.749989Z 01O 22:25:38.451 INFO  SCM collecting changed files in the branch (done) | time=261ms
2025-06-03T22:25:47.260060Z 01O 22:25:47.182 INFO  21257 files indexed (done) | time=8717ms
2025-06-03T22:25:47.260108Z 01O 22:25:47.251 INFO  Load metrics repository (done) | time=18ms
2025-06-03T22:25:48.261476Z 01O 22:25:47.933 INFO  Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
2025-06-03T22:25:48.261489Z 01O 22:25:47.970 INFO  Sensor IaC CloudFormation Sensor [iac] (done) | time=38ms
2025-06-03T22:25:48.261509Z 01O 22:25:48.049 INFO  Sensor IaC AzureResourceManager Sensor [iac] (done) | time=78ms
2025-06-03T22:25:48.261521Z 01O 22:25:48.168 INFO  Sensor Java Config Sensor [iac] (done) | time=118ms
2025-06-03T22:26:52.344731Z 01O 22:26:52.260 INFO  Sensor JavaScript/TypeScript analysis [javascript] (done) | time=64093ms
2025-06-03T22:26:52.344749Z 01O 22:26:52.284 INFO  Sensor JavaScript inside HTML analysis [javascript] (done) | time=24ms
2025-06-03T22:26:52.344761Z 01O 22:26:52.309 INFO  Sensor CSS Rules [javascript] (done) | time=24ms
2025-06-03T22:26:53.846837Z 01O 22:26:53.696 INFO  Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=1387ms
2025-06-03T22:26:53.846852Z 01O 22:26:53.701 INFO  Sensor CSS Metrics [javascript] (done) | time=6ms
2025-06-03T22:26:53.846862Z 01O 22:26:53.722 INFO  Sensor HTML [web] (done) | time=20ms
2025-06-03T22:26:53.846871Z 01O 22:26:53.726 INFO  Sensor XML Sensor [xml] (done) | time=4ms
2025-06-03T22:27:00.356122Z 01O 22:27:00.088 INFO  Sensor PHP sensor [php] (done) | time=6361ms
2025-06-03T22:27:00.356168Z 01O 22:27:00.136 INFO  Sensor Analyzer for "php.ini" files [php] (done) | time=48ms
2025-06-03T23:58:39.932494Z 01O 23:58:39.805 INFO  Sensor PHPUnit report sensor [php] (done) | time=5499670ms
2025-06-03T23:58:39.932513Z 01O 23:58:39.900 INFO  Sensor IaC Docker Sensor [iac] (done) | time=95ms
2025-06-03T23:58:39.932524Z 01O 23:58:39.917 INFO  Sensor Serverless configuration file sensor [security] (done) | time=17ms
2025-06-03T23:58:39.932533Z 01O 23:58:39.930 INFO  Sensor AWS SAM template file sensor [security] (done) | time=13ms
2025-06-03T23:58:40.432929Z 01O 23:58:39.940 INFO  Sensor AWS SAM Inline template file sensor [security] (done) | time=10ms
2025-06-03T23:58:40.933091Z 01O 23:58:40.457 INFO  Sensor EnterpriseTextAndSecretsSensor [textenterprise] (done) | time=516ms
2025-06-03T23:58:40.933210Z 01O 23:58:40.475 INFO  Sensor JavaSecuritySensor [security] (done) | time=19ms
2025-06-03T23:58:40.933284Z 01O 23:58:40.477 INFO  Sensor CSharpSecuritySensor [security] (done) | time=2ms
2025-06-03T23:59:50.522968Z 01O 23:59:50.167 INFO  Sensor PhpSecuritySensor [security] (done) | time=69690ms
2025-06-03T23:59:50.523069Z 01O 23:59:50.168 INFO  Sensor PythonSecuritySensor [security] (done) | time=1ms
2025-06-04T00:00:08.465230Z 01O 00:00:07.778 INFO  Sensor JsSecuritySensor [security] (done) | time=17610ms
2025-06-04T00:00:08.465440Z 01O 00:00:07.779 INFO  Sensor KotlinSecuritySensor [security] (done) | time=0ms
2025-06-04T00:00:08.465660Z 01O 00:00:07.779 INFO  Sensor GoSecuritySensor [security] (done) | time=1ms
2025-06-04T00:00:08.465910Z 01O 00:00:07.928 INFO  Sensor JsArchitectureSensor [architecture] (done) | time=15ms
2025-06-04T00:00:08.465990Z 01O 00:00:07.998 INFO  Sensor Zero Coverage Sensor (done) | time=70ms
2025-06-04T00:00:12.513600Z 01O 00:00:12.000 INFO  CPD Executor CPD calculation finished (done) | time=2863ms
2025-06-04T00:00:13.524750Z 01O 00:00:12.905 INFO  SCM writing changed lines (done) | time=111ms```

The slowest is Sensor PHPUnit report sensor [php] (done) | time=5499670ms - it’s happened after upgrade.

before upgrade
Sensor PHPUnit report sensor [php] (done) | time=129222ms

Hm. That’s definitely not expected.

@github-antonc Any chance it’s also the Sensor PHPUnit report sensor for you that’s running slow as well?

Hello @kushlychok !

Sorry to hear that you’re runnung into an issue with the PHP Unit Report Importing!

Currently I’m not sure why this issue is happening on your side, as the only change we did to the Sensor PHPUnit report sensor was to change certain log messages from error to warning. And this should not have the effect of increasing the duration of the sensor.

Can you run try to run the analysis with the following flags and post the logs for me?
sonar.scanner.excludeHiddenFiles=true and sonar.verbose=true?

With the debug logs I can easier pinpoint where the problem is.

Best
Jonas

Hello. Thank you for the reply.
Yesterday, we decided to make a rollback from SQ 2025.3.0 to 2025.2.0.
We have tested our pipelines, and everything is now working fine.
Our pipelines and PHP sensor started working as previously - 20-30 mins.

We ran the pipeline with your options, also made changes for scanner options - increased xmx from 4g to 6g.

We noticed the scanner started writing a lot of udg files on sq 2025.3.0 and on sq 2025.2.0 we didn’t see this

log of php sensor unit with debug

25-06-04T19:03:08.240446Z 01O 19:03:08.200 INFO  Sensor PHPUnit report sensor [php]
2025-06-04T19:03:08.240450Z 01O 19:03:08.201 INFO  No PHPUnit tests reports provided (see 'sonar.php.tests.reportPath' property)
2025-06-04T19:03:08.240454Z 01O 19:03:08.202 INFO  Importing /builds/dev/our-project/test-reports/coverage-legacy.xml
2025-06-04T19:07:04.639200Z 01O 19:07:03.683 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit.xml
2025-06-04T19:10:51.365347Z 01O 19:10:51.000 INFO  Importing /builds/dev/our-projecttest-reports/coverage-laravel-feature.xml
2025-06-04T19:14:50.683018Z 01O 19:14:50.650 INFO  Importing /builds/dev/our-project/test-reports/coverage-legacy-api.xml
2025-06-04T19:18:38.482992Z 01O 19:18:38.069 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-classes.xml
2025-06-04T19:22:26.784466Z 01O 19:22:26.409 INFO  Importing /builds/dev/our-project/test-reports/coverage-legacy-tasks.xml
2025-06-04T19:26:19.586693Z 01O 19:26:19.276 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-graphql-query.xml
2025-06-04T19:32:03.527168Z 01O 19:32:03.218 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-graphql-other.xml
2025-06-04T19:36:38.889392Z 01O 19:36:38.738 INFO  Importing /builds/dev/our-project/test-reports/coverage-legacy-controllers-models.xml
2025-06-04T19:40:58.224236Z 01O 19:40:58.089 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-graphql-query-merchants.xml
2025-06-04T19:44:55.530744Z 01O 19:44:55.393 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-graphql-query-residuals-analytics.xml
2025-06-04T19:48:52.339464Z 01O 19:48:52.174 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-graphql-query-residuals.xml
2025-06-04T19:52:47.646075Z 01O 19:52:47.473 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-graphql-query-leads.xml
2025-06-04T19:56:37.446580Z 01O 19:56:37.088 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-feature-api-lead.xml
2025-06-04T20:00:30.251762Z 01O 20:00:30.164 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-feature-api-other.xml
2025-06-04T20:04:31.566109Z 01O 20:04:31.491 INFO  Importing /builds/dev/our-project/test-reports/coverage-laravel-unit-services.xml
2025-06-04T20:08:21.867702Z 01O 20:08:21.708 INFO  Sensor PHPUnit report sensor [php] (done) | time=3913507ms

Hello,

We think we have identified the regression. Here is the ticket:

Thanks for reporting the issue!

1 Like