Wierd/strage migrating error upon sonar analisys (PMD)


Sonarqube version - (in docker)

I have some strange issue for which I found little information on internet and whats even more weird (and I did not found any mentions of second) its… migration over project (i.e. it shows up on different parts of project on repeated runs and occasionally do not show up at all.


[2023-04-17T07:02:53.688Z] [WARNING] Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
[2023-04-17T07:02:53.688Z] [INFO] Java Main Files AST scan (done) | time=63190ms
[2023-04-17T07:02:53.688Z] [INFO] Java Test Files AST scan
[2023-04-17T07:02:53.688Z] [INFO] 0 source files to be analyzed
[2023-04-17T07:02:53.688Z] [INFO] 0/0 source files have been analyzed
[2023-04-17T07:02:53.688Z] [INFO] Java Test Files AST scan (done) | time=0ms
[2023-04-17T07:02:53.688Z] [INFO] Java Generated Files AST scan
[2023-04-17T07:02:53.688Z] [INFO] 0 source files to be analyzed
[2023-04-17T07:02:53.688Z] [INFO] 0/0 source files have been analyzed
[2023-04-17T07:02:53.688Z] [INFO] Java Generated Files AST scan (done) | time=1ms
[2023-04-17T07:02:53.688Z] [INFO] Sensor JavaSquidSensor [java] (done) | time=63199ms
[2023-04-17T07:02:53.688Z] [INFO] Sensor CSS Rules [cssfamily]
[2023-04-17T07:02:53.688Z] [INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[2023-04-17T07:02:53.688Z] [INFO] Sensor CSS Rules [cssfamily] (done) | time=0ms
[2023-04-17T07:02:53.688Z] [INFO] Sensor PmdSensor [pmd]
[2023-04-17T07:02:53.688Z] [INFO] Execute PMD 6.30.0
[2023-04-17T07:02:53.688Z] [INFO] Java version: 11
[2023-04-17T07:02:53.688Z] [INFO] PMD configuration: <PATH_IN_PROJECT_THAT_HAVE_ERROR_AND_IS_DIFFERENT_ON_DIFFERENT_RUNS>/target/sonar/pmd.xml
[2023-04-17T07:02:53.688Z] [INFO] Execute PMD 6.30.0 (done) | time=5ms
[2023-04-17T07:03:00.213Z] [INFO] ------------------------------------------------------------------------
[2023-04-17T07:03:00.213Z] [INFO] Reactor Summary:
[2023-04-17T07:03:00.216Z] [INFO] ------------------------------------------------------------------------
[2023-04-17T07:03:00.216Z] [INFO] BUILD FAILURE
[2023-04-17T07:03:00.216Z] [INFO] ------------------------------------------------------------------------
[2023-04-17T07:03:00.216Z] [INFO] Total time: 03:59 h
[2023-04-17T07:03:00.216Z] [INFO] Finished at: 2023-04-17T07:02:59Z
[2023-04-17T07:03:00.216Z] [INFO] ------------------------------------------------------------------------
[2023-04-17T07:03:00.216Z] [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project ren-parent: net.sourceforge.pmd.RuleSetLoadException: Cannot parse <PATH_IN_PROJECT_THAT_HAVE_ERROR_AND_IS_DIFFERENT_ON_DIFFERENT_RUNS>/target/sonar/pmd.xml: Can't find resource category/java/performance.xml. Make sure the resource is a valid file or URL or is on the CLASSPATH -> [Help 1]
[2023-04-17T07:03:00.216Z] [ERROR] 

In this part of log I replaced actual path with <PATH_IN_PROJECT_THAT_HAVE_ERROR_AND_IS_DIFFERENT_ON_DIFFERENT_RUNS>
and weirdest thing is - its changing over different runs - i.e. error is “migrating”.

File pmd.xml is very much present on specified path.
And it contains stuff like:

  <rule ref="category/java/performance.xml/AvoidArrayLoops">
  <rule ref="category/java/performance.xml/BooleanInstantiation">
  <rule ref="category/java/performance.xml/LongInstantiation">

So not sure why it complains about “Can’t find resource category/java/performance.xml.”

I tried to clean cache on server where it is run, but that does not seems to have impact on is error shows up or no.
Tried to reboot sonar.

Right now I am somewhat at loss what is going on.
Any ideas, advices?

Prefereable result - do not see this error ever again :slight_smile:

I suggest reaching out to the maintainers of GitHub - jborgers/sonar-pmd: ☕️ PMD Plugin for SonarQube

:warning: Make sure you upgrade to SonarQube v9.9 LTS soon, not only to benefit from our Best LTS Ever™, but because soon we will systematically ask users to upgrade when they ask questions about earlier versions of SonarQube, which are now considered unsupported. :smiley: