Stack over flow error when using Cucumber

Hi

I have recently hit an error that reads:

...com.kms.katalon.core.exception.StepFailedException: Keyword runFeatureFile was failed (Root cause: java.lang.StackOverflowError
	at cucumber.runtime.io.FileResourceIterator$FileIterator.next(FileResourceIterator.java:73)...

I appear to only get this issue when running test suites from the command line (i can run them without issue in the IDE), which is problematic as i cant use Jenkins to kick off test suites.

Its a problem that has recently occurred (last 3 days), but also to boot, i have seen java messages pop up in the IDE that break all links to step definitions (has been an issue for around 4 weeks), so i have restart the IDE to fix, only to get the same issue pop up later in the day.

Im not too sure where or how to solve this issue, has anyone else had this issue? Could it be an IDE bug? Cucumber bug?

Thanks.

1 Like

Im still getting this issue but its only present on Mac (Windows 10 dosnt seem to suffer the issue).

I have noticed a pattern, the first test case fails, but the 2nd (3rd, 4th etc) run without issue.

I cant actually pass a test suite as the first one always fails.

I dont know whether this is Mac specific, but id like to setup an Ubuntu AWS instance and have tests run on that, but im not confident ill be able to run test suites from Jenkins.

Is anyone able to look into this? It feels like a fundamental Katalon issue, as i have tried various test suites with varying complexity and the issue is still persistent.

Happy to provide more detail if needed.

Thanks.

1 Like

Yeah I get the smiliar issue

com.kms.katalon.core.exception.StepFailedException: Keyword runFeatureFile was failed (Root cause: java.lang.StackOverflowError
at cucumber.runtime.io.FileResourceIterator$FileIterator.next(FileResourceIterator.java:73)
at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:29)
at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)

This issue is intermittent but quite annoying because always happens on some test cases in my test suites.

I hope someone have the solution

2 Likes

Thanks @Dimas_Tekad_Santosa its good to know im not the only one with this issue. Are you using a Mac by any chance? I dont recall seeing this issue on Ubuntu, and dont currently see it when running tests on Windows.

I have bumped the start and maximum memory allocation in the katalon.ini on Mac (where im seeing the issues), and think 4GB should be fine, see my katalon.ini below:

-startup

../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar

--launcher.library

../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.401.v20161122-1740

-data

@noDefault

-vm

../../Contents/Eclipse/jre/Contents/Home/jre/lib/jli/libjli.dylib

-vmargs

-Xms4096m

-Xmx4096m

-XstartOnFirstThread

-Dorg.eclipse.swt.internal.carbon.smallFonts

For reference, this post helped - Katalon Studio, memory issue adding variables for data driven testing

yeah ā€¦ 256 for xms is ā€¦ hilarious in this epoch.
i have suggested already to katalon devs to reconsider the default values, hope with next releases they will change it.
cc @ThanhTo

Hi,

I develop on mac OS, but I run the test cases from windows envā€¦

@Ibus yeah i would say 256 also is really rather limited, a larger default would be better

@Dimas_Tekad_Santosa that is interesting, could this indeed be a MacOS bug?

i will not say it is strictly a bug, but rather a particular behavior of jvm

Hi @devalex88 @Jass , I am also getting the same error for a while. Do not know what to do, had already tried different combination of limit set in katalon.ini config file.
Any help will be appreciated.
Using Katalon 7.2.6
Windows -10

My katalon.ini file looks like this, any suggestions will be appreciated.

-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
ā€“launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740
-data
@noDefault
-vmargs
-XX:+UseParallelGC
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=3
-XX:GCLogFileSize=256m
-Xloggc:./gc.log

-XX:+UseStringDeduplication

-Xms4096m
-Xmx8192m
-XX:MaxMetaspaceSize=8192m
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=./java_pid1234.hprof
-XX:+UseGCOverheadLimit

-Xss4096m
-Dfile.encoding=utf-8
-XstartOnFirstThread

Hi @Dimas_Tekad_Santosa, did you find any solution for this issue.

Any input would be appreciated.

Regards
Paul

hello @Dimas_Tekad_Santosa, @jason_carney and @kirpal_s_bhogal,
did you find a solution for this issue ?

I have this error since friday morning on my jenkins server (which is hosted on windows server 2012)

test case launched from katalonc.exe fail everytime I launch all my cucumber tests :

[2021-10-18T12:25:56.903539800] 2021-10-18 12:25:56.903 INFO c.k.katalon.core.main.TestSuiteExecutor - START Test Suites/sTests Cucumber Tags Sentence
[2021-10-18T12:25:57.037593300] 2021-10-18 12:25:57.037 INFO c.k.katalon.core.main.TestSuiteExecutor - hostName = svc_katalon - sgetrfxauto.fmlogistic.fr
[2021-10-18T12:25:57.037593300] 2021-10-18 12:25:57.037 INFO c.k.katalon.core.main.TestSuiteExecutor - os = Windows Server 2012 R2 64bit
[2021-10-18T12:25:57.037593300] 2021-10-18 12:25:57.037 INFO c.k.katalon.core.main.TestSuiteExecutor - hostAddress = 10.0.9.241
[2021-10-18T12:25:57.049673700] 2021-10-18 12:25:57.037 INFO c.k.katalon.core.main.TestSuiteExecutor - katalonVersion = 8.0.0.208
[2021-10-18T12:25:57.957887600] 2021-10-18 12:25:57.950 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
[2021-10-18T12:25:57.957887600] 2021-10-18 12:25:57.950 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/Cucumber - Tags Sentence
[2021-10-18T12:25:58.033893500] pandemic ; flag : false
[2021-10-18T12:25:58.160957800] 2021-10-18 12:25:58.151 INFO k.k.c.m.CustomKeywordDelegatingMetaClass - com.kazurayam.ksbackyard.HighlightElement.pandemic is PASSED
[2021-10-18T12:25:58.283223800] 2021-10-18 12:25:58.283 DEBUG testcase.Cucumber - Tags Sentence - 1: runFeatureFileWithTags(ā€œInclude/features/ā€, ā€œnot @skip and not @0_AvoidOnVersionā€ + version + " and (" + cucumberTagsSentence + ā€œ)ā€)
[2021-10-18T12:25:58.831020700] 2021-10-18 12:25:58.827 INFO c.k.k.c.c.k.CucumberBuiltinKeywords - Starting run keyword runFeatureFile: ā€˜Include/features/ā€™ and extract report to folder: ā€˜D:\Tools\Jenkins\workspace\Cucumber Tests 9.18 Static Data\Reports\20211018_122548\sTests Cucumber Tags Sentence\20211018_122552/cucumber_report/1634552758805ā€™ā€¦
[2021-10-18T12:26:00.230638] 2021-10-18 12:26:00.227 ERROR c.k.k.core.keyword.internal.KeywordMain - ? Keyword runFeatureFileWithTags was failed (Root cause: java.lang.StackOverflowError
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FileResourceIterator$FileIterator.next(FileResourceIterator.java:73)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:29)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.230638] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
ā€¦
[2021-10-18T12:26:00.241292] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.241292] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
[2021-10-18T12:26:00.241292] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.241292] )
[2021-10-18T12:26:00.278311700] 2021-10-18 12:26:00.278 ERROR c.k.katalon.core.main.TestCaseExecutor - ? Test Cases/Cucumber - Tags Sentence FAILED.
[2021-10-18T12:26:00.278311700] Reason:
[2021-10-18T12:26:00.278311700] com.kms.katalon.core.exception.StepFailedException: Keyword runFeatureFileWithTags was failed (Root cause: java.lang.StackOverflowError
[2021-10-18T12:26:00.278311700] at cucumber.runtime.io.FileResourceIterator$FileIterator.next(FileResourceIterator.java:73)
[2021-10-18T12:26:00.278311700] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:29)
[2021-10-18T12:26:00.278311700] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.278311700] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
[2021-10-18T12:26:00.278311700] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
[2021-10-18T12:26:00.278311700] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
ā€¦
[2021-10-18T12:26:00.320310800] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:32)
[2021-10-18T12:26:00.320310800] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)
[2021-10-18T12:26:00.320310800] )
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:50)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:70)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.keyword.internal.KeywordMain$runKeyword.call(Unknown Source)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFileWithTags(CucumberBuiltinKeywords.groovy:162)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFileWithTags.callStatic(Unknown Source)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFileWithTags(CucumberBuiltinKeywords.groovy:285)
[2021-10-18T12:26:00.320310800] at Cucumber - Tags Sentence.run(Cucumber - Tags Sentence:22)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:398)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:389)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:368)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:360)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:255)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:203)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:152)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:95)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
[2021-10-18T12:26:00.320310800] at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
[2021-10-18T12:26:00.320310800] at TempTestSuite1634552752387.run(TempTestSuite1634552752387.groovy:39)
[2021-10-18T12:26:00.320310800] Caused by: java.lang.StackOverflowError
[2021-10-18T12:26:00.320310800] at cucumber.runtime.io.FileResourceIterator$FileIterator.next(FileResourceIterator.java:73)
[2021-10-18T12:26:00.320310800] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:29)
[2021-10-18T12:26:00.320310800] at cucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:27)

I tried to modify -xms -xmx values in my katalon.ini file but it does not help

last week, I installed jdk11 on my server instead of jdk8 for my jenkins. Could it have an impact ? (it should not as Katalon use its own jdk I think)

hello finally no more probleme for me.
I found that the problem was coming from a bad purge of my katalon Reports folder in my Jenkins Job
When purge is ok, I have no more these ā€œcucumber.runtime.io.FlatteningIterator.moveToNext(FlatteningIterator.java:29)ā€ ERROR messages

1 Like

Hi staniere

Thanks for sharing.

I havenā€™t come across the issue for quite some time (possibly because i delete my local Katalon project and pull from Git every few months).

My Git repo doesnā€™t contain the reports folder so that gets created afresh when using the newly pulled project. Perhaps id have seen the issue more recently if i let the reports folder build up - out of interest, did you notice the amount of report folders that caused the error to occur? It would be good to know the tipping point.

Most of the time this error occurred because the Test suite path is not configured in Jenkins properly

Is ā€œcucumber.runtime.io.FlatteningIteratorā€ in a private repository somewhere? Iā€™d like to see the code to get a clue for why this stackoverflow is happening. I assumed it would be on github, but my reasonable guesses for what artifact this is in havenā€™t found this class.