Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Problem with JoCoCo Report #4213

Laba42 ·

All of a sudden our JaCoCo Report does not work anymore.
With the Step Publish-JaCoCo Report the build stops after more than an hour with
the following error message, what could be the reason?

Open database [D:\Apps\QuickBuildAgent\temp\abstractpublisher45c83512-bab4-46b0-9fee-4378edeb55f5\JaCoCoReport] failed. Database status [No active connections]. caused by: Unable to get connection from database url: jdbc:h2:D:/Apps/QuickBuildAgent/temp/abstractpublisher45c83512-bab4-46b0-9fee-4378edeb55f5/JaCoCoReport/jacoco;TRACE_LEVEL_FILE=0 caused by: Fehler beim Öffnen der Datenbank: "Sleep interrupted" Error opening database: "Sleep interrupted" [8000-175] caused by: sleep interrupted

Georg

  • replies 11
  • views 76
  • stars 0
steveluo ADMIN ·

Hi@Laba42

Is there any action to cancel or interrupt the step? Is this issue occurred every time or just one time? And I need more log to know the context when this error occurred.

Laba42 ·

I put in the whole stack trace below.
I can't say much more than that. Appears suddenly, since yesterday, on all the buildings that are supposed to make this JaCoCo report.
The JaCoCo report is started from an ANT script

16:55:20,058 ERROR - Step 'master>Publish-JaCoCo-Report' is failed. com.pmease.quickbuild.plugin.report.engine.exception.DatabaseException: Open database [D:\Apps\QuickBuildAgent\temp\abstractpublisher04d2c9d9-5d2f-4dfe-88d7-4bc5059ea4af\JaCoCoReport] failed. Database status [No active connections]. at com.pmease.quickbuild.plugin.report.engine.datastore.DbStore.open(DbStore.java:358) at com.pmease.quickbuild.plugin.report.engine.metadata.ReportCategory.saveReport(ReportCategory.java:360) at com.pmease.quickbuild.plugin.report.engine.generator.DefaultGenerator.saveDestReport(DefaultGenerator.java:81) at com.pmease.quickbuild.plugin.report.engine.generator.DefaultGenerator.afterExecute(DefaultGenerator.java:55) at com.pmease.quickbuild.plugin.report.engine.generator.GenerateAction.execute(GenerateAction.java:43) at com.pmease.quickbuild.plugin.report.engine.generator.DefaultGenerator.generate(DefaultGenerator.java:37) at com.pmease.quickbuild.plugin.report.engine.contribution.publisher.AbstractPublisher.doPublish(AbstractPublisher.java:162) at com.pmease.quickbuild.plugin.report.jacoco.JacocoPublisher$$EnhancerByCGLIB$$f3cc6412.CGLIB$doPublish$45(<generated>) at com.pmease.quickbuild.plugin.report.jacoco.JacocoPublisher$$EnhancerByCGLIB$$f3cc6412$$FastClassByCGLIB$$5ea550ee.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215) at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:261) at com.pmease.quickbuild.plugin.report.jacoco.JacocoPublisher$$EnhancerByCGLIB$$f3cc6412.doPublish(<generated>) at com.pmease.quickbuild.plugin.report.engine.contribution.publisher.AbstractPublisher.run(AbstractPublisher.java:129) at com.pmease.quickbuild.plugin.report.jacoco.JacocoPublisher$$EnhancerByCGLIB$$f3cc6412.CGLIB$run$37(<generated>) at com.pmease.quickbuild.plugin.report.jacoco.JacocoPublisher$$EnhancerByCGLIB$$f3cc6412$$FastClassByCGLIB$$5ea550ee.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215) at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:261) at com.pmease.quickbuild.plugin.report.jacoco.JacocoPublisher$$EnhancerByCGLIB$$f3cc6412.run(<generated>) at com.pmease.quickbuild.stepsupport.Step.doExecute(Step.java:654) at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:568) at com.pmease.quickbuild.stepsupport.StepExecutionJob.executeStepAwareJob(StepExecutionJob.java:31) at com.pmease.quickbuild.stepsupport.StepAwareJob.executeBuildAwareJob(StepAwareJob.java:56) at com.pmease.quickbuild.BuildAwareJob.execute(BuildAwareJob.java:77) at com.pmease.quickbuild.grid.GridJob.run(GridJob.java:129) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.pmease.quickbuild.plugin.report.engine.exception.DatabaseException: Unable to get connection from database url: jdbc:h2:D:/Apps/QuickBuildAgent/temp/abstractpublisher04d2c9d9-5d2f-4dfe-88d7-4bc5059ea4af/JaCoCoReport/jacoco;TRACE_LEVEL_FILE=0 at com.pmease.quickbuild.plugin.report.engine.datastore.ConnectionManager.getConnection(ConnectionManager.java:25) at com.pmease.quickbuild.plugin.report.engine.datastore.DbStore.getConnection(DbStore.java:384) at com.pmease.quickbuild.plugin.report.engine.datastore.DbStore.open(DbStore.java:349) ... 28 more Caused by: org.h2.jdbc.JdbcSQLException: Fehler beim Öffnen der Datenbank: "Sleep interrupted" Error opening database: "Sleep interrupted" [8000-175] at org.h2.message.DbException.getJdbcSQLException(DbException.java:332) at org.h2.message.DbException.get(DbException.java:161) at org.h2.store.FileLock.getExceptionFatal(FileLock.java:450) at org.h2.store.FileLock.sleep(FileLock.java:445) at org.h2.store.FileLock.lockFile(FileLock.java:358) at org.h2.store.FileLock.lock(FileLock.java:133) at org.h2.engine.Database.open(Database.java:591) at org.h2.engine.Database.openDatabase(Database.java:244) at org.h2.engine.Database.<init>(Database.java:239) at org.h2.engine.Engine.openSession(Engine.java:58) at org.h2.engine.Engine.openSession(Engine.java:162) at org.h2.engine.Engine.createSessionAndValidate(Engine.java:141) at org.h2.engine.Engine.createSession(Engine.java:124) at org.h2.engine.Engine.createSession(Engine.java:30) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:323) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:105) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:90) at org.h2.Driver.connect(Driver.java:73) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at com.pmease.quickbuild.plugin.report.engine.datastore.ConnectionManager.getConnection(ConnectionManager.java:23) ... 30 more Caused by: java.lang.InterruptedException: sleep interrupted at java.lang.Thread.sleep(Native Method) at org.h2.store.FileLock.sleep(FileLock.java:443) ... 47 more

steveluo ADMIN ·

Hi@Laba42

Don't see such error before, seems the report database (h2) is in chaos. Please try restart the agent to see if it can recover. If still can't recover, you may have to restart the server.

Laba42 ·

sorry for the late reply
But i could not restart the server directly

After I restart the QB Server and the QB Agents the error still occurs.

Is there anything I can do to support troubleshooting?

Georg

steveluo ADMIN ·

Hi Georg,

Would you help to do some tests like below:

  1. create a new configuration
  2. add a publish Jacoco report step to publish the XML report generated by one of those failed configurations.
  3. run the configuration to see the result
Laba42 ·

Hi Steve,
I did as you asked, and the same mistake will happen.
The jacoco.xml file to be evaluated is probably 160 MB in size.
The runtime of the Publish-JaCoCo-Step is about 70 minutes.

Georg

steveluo ADMIN ·

Hi Georg,

Thank you very much. It seems that it took too long time to process and that may be the cause of "Sleep interrupted".
Do you have any smaller project to test? If possible, would you please send your xml report to me (steve at pmease) so I can do some tests?

Laba42 ·

Hi Steve,
sorry, but I cannot pass on the jacoco.xml file.
And unfortunately I cannot get the file smaller.

Georg

steveluo ADMIN ·

Hi Georg,

I have generated a Jacoco xml which is about 120M and I can publish it successfully in about 6min with a Mac agent allocated 2G memory.

jacoco.png

So, please click the log icon to see the publish-jacoco-step log and find out in which stage the issue occurred. Normally, the log looks like below:

10:59:30,452 INFO  - Checking step execute condition...
10:59:30,452 INFO  - Step execute condition satisfied, executing...
10:59:30,570 INFO  - Executing pre-execute action...
10:59:30,570 INFO  - Running step...
10:59:31,476 INFO  - Start generating report 'packages'.
10:59:44,939 INFO  - Finished generating report 'packages' successfully.
10:59:44,940 INFO  - Start generating report 'classes'.
11:00:52,683 INFO  - Finished generating report 'classes' successfully.
11:00:52,683 INFO  - Start generating report 'files'.
11:03:22,461 INFO  - Finished generating report 'files' successfully.
11:03:22,461 INFO  - Start generating report 'methods'.
11:05:07,275 INFO  - Finished generating report 'methods' successfully.
11:05:07,814 INFO  - Initialize overview data ...
11:05:07,959 INFO  - Executing post-execute action...

From above log, we can know that the files and methods reports use the most of the processing time.

Another question is do you publish the Jacoco report on the same agent on which you check out your source code? And is there any settings
changed when the error suddenly failed?

Laba42 ·

`
09:33:45,309 INFO - Checking step execute condition...
09:33:45,310 INFO - Step execute condition satisfied, executing...
09:33:45,444 INFO - Executing pre-execute action...
09:33:45,444 INFO - Running step...

09:33:45,446 DEBUG - Working directory [D:\Apps\QuickBuildAgent\temp\abstractpublisherf325e9bf-f921-4fce-950a-f566d98bd9f1] created.
09:33:45,446 DEBUG - Publish original reports in directory: D:\QuickBuild\Work\354-KM\build\temp\JaCoCo
09:33:45,446 DEBUG - Current workspace path: D:\QuickBuild\Work
09:33:45,446 DEBUG - Report Files/Patterns: JaCoCoReport.xml
10:11:10,322 DEBUG - Listing java files under directory [[D:\QuickBuild\Work]], cost 2244872 milliseconds, total [3285762]
10:11:10,961 INFO - Start generating report 'packages'.
10:11:10,961 DEBUG - Executing processor [processXML (com.pmease.quickbuild.plugin.report.jacoco.generator.PackagesProcessor)] ...
10:11:10,963 INFO - Start processing file: D:\QuickBuild\Work\354-KM\build\temp\JaCoCo\JaCoCoReport.xml
10:11:19,804 DEBUG - Executing processor [removeDuplicates (DUPLICATE)] ...
10:11:20,007 INFO - Finished generating report 'packages' successfully.
10:11:20,007 INFO - Start generating report 'classes'.
10:11:20,007 DEBUG - Executing processor [processXML (com.pmease.quickbuild.plugin.report.jacoco.generator.ClassesProcessor)] ...
10:11:20,009 INFO - Start processing file: D:\QuickBuild\Work\354-KM\build\temp\JaCoCo\JaCoCoReport.xml
10:44:28,262 DEBUG - Executing processor [removeDuplicates (DUPLICATE)] ...
10:44:28,574 DEBUG - Verifying file checksums ...
10:44:28,702 DEBUG - Deleting working directory [D:\Apps\QuickBuildAgent\temp\abstractpublisherf325e9bf-f921-4fce-950a-f566d98bd9f1].
10:44:28,704 INFO - Executing post-execute action...
10:44:28,704 ERROR - Step 'master>Publish-JaCoCo-Report' is failed.`

Another question is do you publish the Jacoco report on the same agent on which you check out your source code?

Yes

And is there any settings changed when the error suddenly failed?

No, only new or modified Sourcecode

steveluo ADMIN ·

Hi Georg,

From the log below, there are 3 million files in your workspace, to just list them the step cost more than 40 minutes.

10:11:10,322 DEBUG - Listing java files under directory [[D:\QuickBuild\Work]], cost 2244872 milliseconds, total [3285762]

Please just specify the directories needed for Jacoco report. For example, if your Jacoco report is only for 354-KM, then you can tell Jacoco-publish-step to only scan that directory by adding it to Source Code Directory field in publish-jacoco-step:

Screen Shot 2020-03-27 at 12.04.43 AM.png

BTW, you can also specify multiple source directories, one directory in one line.