Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error failed to generate configuration report. Even reports are getting generated but build is failing due to this error. #2101

Closed
kreigy1310garg opened this issue May 21, 2020 · 14 comments

Comments

@kreigy1310garg
Copy link

SerenityCoreVersion = 2.2.8
SerenityCucumberVersion = 2.2.5
CucumberVersion = 5.5.0

Not sure what's going wrong.

Error


Failed to generate configuration report
net.thucydides.core.reports.ReportGenerationFailedError: Failed to generate configuration report
at net.thucydides.core.reports.ReportService.waitForReportGenerationToFinish(ReportService.java:204)
at net.thucydides.core.reports.ReportService.generateReportsFor(ReportService.java:181)
at net.thucydides.core.reports.ReportService.generateReportsFor(ReportService.java:127)
at io.cucumber.core.plugin.SerenityReporter.generateReports(SerenityReporter.java:948)
at io.cucumber.core.plugin.SerenityReporter.handleTestRunFinished(SerenityReporter.java:335)
at io.cucumber.core.eventbus.AbstractEventPublisher.send(AbstractEventPublisher.java:45)
at io.cucumber.core.eventbus.AbstractEventBus.send(AbstractEventBus.java:9)
at io.cucumber.junit.CucumberSerenityRunner$RunCucumber.evaluate(CucumberSerenityRunner.java:255)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:118)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.concurrent.ExecutionException: net.thucydides.core.reports.ReportGenerationFailedError: Failed to generate reports using net.thucydides.core.reports.html.HtmlAcceptanceTestReporter@744cd6f8
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at net.thucydides.core.reports.ReportService.waitForReportGenerationToFinish(ReportService.java:201)
... 40 more
Caused by: net.thucydides.core.reports.ReportGenerationFailedError: Failed to generate reports using net.thucydides.core.reports.html.HtmlAcceptanceTestReporter@744cd6f8
at net.thucydides.core.reports.ReportService.generateReportFor(ReportService.java:241)
at net.thucydides.core.reports.ReportService.lambda$generateReportsFor$0(ReportService.java:177)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more
Caused by: java.lang.RuntimeException: Failed to merge template: Failed to process FreeMarker template
at net.thucydides.core.reports.html.Merger$MergeBuilder.to(Merger.java:39)
at net.thucydides.core.reports.html.HtmlAcceptanceTestReporter.generateReportPage(HtmlAcceptanceTestReporter.java:139)
at net.thucydides.core.reports.html.HtmlAcceptanceTestReporter.generateReportFor(HtmlAcceptanceTestReporter.java:125)
at net.thucydides.core.reports.ReportService.generateReportFor(ReportService.java:239)
... 6 more
Caused by: net.thucydides.core.reports.templates.TemplateMergeException: Failed to process FreeMarker template
at net.thucydides.core.reports.templates.FreemarkerReportTemplate.merge(FreemarkerReportTemplate.java:42)
at net.thucydides.core.reports.html.Merger$MergeBuilder.to(Merger.java:37)
... 9 more
Caused by: freemarker.core._TemplateModelException: Java method "net.thucydides.core.reports.html.Formatter.renderText(String)" threw an exception when invoked on net.thucydides.core.reports.html.Formatter object "net.thucydides.core.reports.html.Formatter@1435a452"; see cause exception in the Java stack trace.


FTL stack trace ("~" means nesting-related):
- Failed at: ${formatter.renderText(restQuery.resp... [in template "freemarker/default.ftl" in macro "restQueryData" at line 434, column 46]
- Reached through: @restQueryData restQuery=step.restQue... [in template "freemarker/default.ftl" in macro "step_details" at line 509, column 45]
- Reached through: @step_details step=step step_number=s... [in template "freemarker/default.ftl" in macro "write_step" at line 376, column 21]
- Reached through: @write_step step=nestedStep step_numb... [in template "freemarker/default.ftl" in macro "write_step" at line 385, column 45]
- Reached through: @write_step step=step step_number=ste... [in template "freemarker/default.ftl" at line 594, column 21]

at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:289)
at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:252)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:77)
at freemarker.core.MethodCall._eval(MethodCall.java:62)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:100)
at freemarker.core.DollarVariable.accept(DollarVariable.java:63)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:373)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:872)
at freemarker.core.Environment.invokeMacro(Environment.java:809)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:373)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:872)
at freemarker.core.Environment.invokeMacro(Environment.java:809)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
at freemarker.core.Environment.visit(Environment.java:367)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:872)
at freemarker.core.Environment.invokeMacro(Environment.java:809)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:373)
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:643)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:373)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:872)
at freemarker.core.Environment.invokeMacro(Environment.java:809)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
at freemarker.core.Environment.visit(Environment.java:367)
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:643)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:337)
at freemarker.core.Environment.process(Environment.java:310)
at net.thucydides.core.reports.templates.FreemarkerReportTemplate.merge(FreemarkerReportTemplate.java:39)
... 10 more

Caused by: java.lang.OutOfMemoryError: Java heap space
at java.base/java.lang.AbstractStringBuilder.(AbstractStringBuilder.java:86)
at java.base/java.lang.StringBuffer.(StringBuffer.java:139)
at java.base/java.io.StringWriter.(StringWriter.java:69)
at org.apache.commons.lang3.text.translate.CharSequenceTranslator.translate(CharSequenceTranslator.java:63)
at net.thucydides.core.reports.html.Formatter.renderText(Formatter.java:150)
at jdk.internal.reflect.GeneratedMethodAccessor507.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:72)
at freemarker.core.MethodCall._eval(MethodCall.java:62)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:100)
at freemarker.core.DollarVariable.accept(DollarVariable.java:63)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:373)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:872)
at freemarker.core.Environment.invokeMacro(Environment.java:809)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:373)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:872)
at freemarker.core.Environment.invokeMacro(Environment.java:809)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
at freemarker.core.Environment.visit(Environment.java:367)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:872)
at freemarker.core.Environment.invokeMacro(Environment.java:809)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
at freemarker.core.Environment.visit(Environment.java:331)
at freemarker.core.Environment.visit(Environment.java:373)
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)

@wakaleo
Copy link
Member

wakaleo commented May 22, 2020

"java.lang.OutOfMemoryError: Java heap space" - looks like you need more heap space.

@kreigy1310garg
Copy link
Author

@wakaleo I have already assigned 8196M to Gradle and Jenkins. Still I am getting this error. Anything else that I can do resolve the same.

@wakaleo
Copy link
Member

wakaleo commented May 22, 2020

How many tests do you have?

@kreigy1310garg
Copy link
Author

@wakaleo I have 1340 test cases of rest services. and still more to add.

@wakaleo
Copy link
Member

wakaleo commented May 22, 2020

I can’t see anything obvious in the code that would cause this - you could try the following settings in your serenity.conf file:

report.threads = 1

And make sure you are assigning the heap memory available to the failsafe process, not just to the Jenkins job (see https://maven.apache.org/surefire/maven-failsafe-plugin/examples/fork-options-and-parallel-execution.html)

@kreigy1310garg
Copy link
Author

@wakaleo I am running it through Gradle not with maven. I have provided memory to specific gradle build. I hope it will help there as well.

@kreigy1310garg
Copy link
Author

@wakaleo I am running it through Gradle not with maven. I have provided memory to specific gradle build. I hope it will help there as well.

Also thanks @wakaleo for your expeditious response let me try the same.

@celestain
Copy link

@wakaleo The issue is with the serenity reports. When I run test cases directly from JUNIT everything is working fine but when we go with Gradle task then it is running out of memory as it is not able to write so much data from service in reports.

@kreigy1310garg
Copy link
Author

@wakaleo The issue is with the serenity reports. When I run test cases directly from JUNIT everything is working fine but when we go with Gradle task then it is running out of memory as it is not able to write so much data from service in reports. Is there any way that we can skip the index.html (serenity report ) and we can get only single page summary while running through gradle ?

I tried to comment the plugin for aggregate then it give error for serenity method for single page html.

@wakaleo
Copy link
Member

wakaleo commented Jun 4, 2020

You can not call the aggregate goal and just call the reports goal

@wakaleo wakaleo closed this as completed Feb 12, 2022
@sarikakotha
Copy link

sarikakotha commented Aug 7, 2023

Hi John, i was trying parallel execution and seeing the same error - full report seems okay but when click and view individual scenario is throws "Your file couldn’t be accessedIt may have been moved, edited, or deleted." below is the full error - please suggest if the project set up is required.

net.thucydides.core.reports.ReportGenerationFailedError: Failed to generate configuration report
at net.thucydides.core.reports.ReportService.waitForReportGenerationToFinish(ReportService.java:211)
at net.thucydides.core.reports.ReportService.generateReportsFor(ReportService.java:188)
at net.thucydides.core.reports.ReportService.generateReportsFor(ReportService.java:134)
at io.cucumber.core.plugin.SerenityReporter.generateReports(SerenityReporter.java:991)
at io.cucumber.core.plugin.SerenityReporter.handleTestRunFinished(SerenityReporter.java:375)
at io.cucumber.core.eventbus.AbstractEventPublisher.send(AbstractEventPublisher.java:51)
at io.cucumber.core.eventbus.AbstractEventBus.send(AbstractEventBus.java:12)
at io.cucumber.core.runtime.SynchronizedEventBus.send(SynchronizedEventBus.java:47)
at io.cucumber.core.runtime.CucumberExecutionContext.emitTestRunFinished(CucumberExecutionContext.java:111)
at io.cucumber.core.runtime.CucumberExecutionContext.finishTestRun(CucumberExecutionContext.java:98)
at io.cucumber.junit.CucumberSerenityBaseRunner$RunCucumber.evaluate(CucumberSerenityBaseRunner.java:364)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:405)
at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:362)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:405)
at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:362)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder$PC$1.run(ParallelComputerBuilder.java:590)
at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)
at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:157)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.apache.commons.lang3.time.StopWatch.createStarted()Lorg/apache/commons/lang3/time/StopWatch;
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at net.thucydides.core.reports.ReportService.waitForReportGenerationToFinish(ReportService.java:208)
... 45 more
Caused by: java.lang.NoSuchMethodError: org.apache.commons.lang3.time.StopWatch.createStarted()Lorg/apache/commons/lang3/time/StopWatch;
at net.thucydides.core.requirements.MultiSourceRequirementsService.getRequirements(MultiSourceRequirementsService.java:38)
at net.thucydides.core.requirements.BaseRequirementsService.getRequirementTypes(BaseRequirementsService.java:191)
at net.thucydides.core.reports.html.HtmlAcceptanceTestReporter.addTestOutcomeToContext(HtmlAcceptanceTestReporter.java:186)
at net.thucydides.core.reports.html.HtmlAcceptanceTestReporter.generateReportFor(HtmlAcceptanceTestReporter.java:104)
at net.thucydides.core.reports.ReportService.generateReportFor(ReportService.java:246)
at net.thucydides.core.reports.ReportService.lambda$generateReportsFor$0(ReportService.java:184)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

@wakaleo
Copy link
Member

wakaleo commented Aug 7, 2023

Caused by: java.lang.NoSuchMethodError: org.apache.commons.lang3.time.StopWatch.createStarted()Lorg/apache/commons/lang3/time/StopWatch;
at

You have a dependency conflict in your pom file. Do a dependency analysis and make sure you have the latest versions of your apache commons libraries.

@sarikakotha
Copy link

sarikakotha commented Aug 7, 2023 via email

@sarikakotha
Copy link

sarikakotha commented Aug 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants