Analysis fails with FileNotFoundException (too many open files) in PmdConfiguration.dumpXmlRuleSet(), log contains hundreds of "Fail to execute PMD"

167 views
Skip to first unread message

Eduard Wirch

unread,
Aug 29, 2016, 2:49:20 AM8/29/16
to SonarQube
We have a Sonar-Job on our Jenkins CI server. The job fails sometimes showing this stack trace:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project fff: java.lang.IllegalStateException: Fail to save the PMD configuration
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: java.lang.IllegalStateException: Fail to save the PMD configuration
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.sonar.api.utils.XmlParserException: java.lang.IllegalStateException: Fail to save the PMD configuration
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:72)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:251)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy18.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
... 22 more
Caused by: java.lang.IllegalStateException: Fail to save the PMD configuration
at org.sonar.plugins.pmd.PmdConfiguration.dumpXmlRuleSet(PmdConfiguration.java:59)
at org.sonar.plugins.pmd.PmdExecutor.createRulesets(PmdExecutor.java:128)
at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:111)
at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:91)
at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:75)
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:67)
... 46 more
Caused by: java.io.FileNotFoundException: /var/lib/jenkins/workspace/FACT-Finder-Framework-JDK8_Sonar/fff-ui/target/sonar/pmd-unit-tests.xml (too many open files)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at com.google.common.io.Files$2.getOutput(Files.java:132)
at com.google.common.io.Files$2.getOutput(Files.java:129)
at com.google.common.io.CharStreams$3.getOutput(CharStreams.java:111)
at com.google.common.io.CharStreams$3.getOutput(CharStreams.java:108)
at com.google.common.io.CharStreams.write(CharStreams.java:128)
at com.google.common.io.Files.write(Files.java:335)
at com.google.common.io.Files.write(Files.java:306)
at org.sonar.plugins.pmd.PmdConfiguration.writeToWorkingDirectory(PmdConfiguration.java:95)
at org.sonar.plugins.pmd.PmdConfiguration.dumpXmlRuleSet(PmdConfiguration.java:53)
... 51 more

I already found https://jira.sonarsource.com/browse/SONARPMD-6 which should be fixed in PMD plugin 2.4. We're using 2.5.

Freddy Mallet

unread,
Aug 31, 2016, 4:47:47 AM8/31/16
to Eduard Wirch, SonarQube
Hello Eduard,

The SonarSource team is no more contributing directly to the Checkstyle, PMD and Findbugs plugins. I would try to fill an GitHub issue directly on the SonarQube PMD plugin : https://github.com/SonarQubeCommunity/sonar-pmd

Cheers
Freddy

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/e657f78e-6f3f-4681-b7ba-139bd5ec3cb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Freddy MALLET | SonarSource
Product Director & Co-Founder
http://sonarsource.com

Eduard Wirch

unread,
Aug 31, 2016, 5:16:06 AM8/31/16
to Freddy Mallet, SonarQube
Hi Freddy

Thanks for the hint. Is there an overview somewhere about the status on replacing PMD rules with SonarQube rules?

Cheers,
Eduard

Freddy Mallet

unread,
Sep 2, 2016, 7:57:30 AM9/2/16
to Eduard Wirch, SonarQube
Hi Eduard,


++
Freddy

Eduard Wirch

unread,
Sep 2, 2016, 8:36:18 AM9/2/16
to Freddy Mallet, SonarQube
Thanks! 
Reply all
Reply to author
Forward
0 new messages