Debugging of geb.error.UnableToLoadException: Unable to load configuration from class...

625 views
Skip to first unread message

thirsch...@gmail.com

unread,
Apr 12, 2019, 8:43:04 AM4/12/19
to Geb User Mailing List
I am getting this stacktrace when running on Jenkins, so far I have been unable to reproduce it on my development machine (MacOS):

14:52:38 spec.MySpec > classMethod FAILED
14:52:38     geb.error.UnableToLoadException: Unable to load configuration @ 'file:/var/lib/jenkins/workspace/<pipeline-name>/<project-name>/build/resources/test/GebConfig.groovy' (with environment: )
14:52:38         at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:293)
14:52:38         at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:272)
14:52:38         at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:127)
14:52:38         at geb.ConfigurationLoader.doGetConf(ConfigurationLoader.groovy:236)
14:52:38         at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:88)
14:52:38         at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:107)
14:52:38         at geb.spock.GebSpec.createConf(GebSpec.groovy:34)
14:52:38         at geb.spock.GebSpec.createBrowser(GebSpec.groovy:38)
14:52:38         at geb.spock.GebSpec.getBrowser(GebSpec.groovy:43)
14:52:38         at geb.spock.GebSpec.methodMissing(GebSpec.groovy:60)
14:52:38         at spec.MySpec.doSomething(MySpec.groovy:209)
14:52:38         at spec.MySpec.cleanupSpec(MySpec.groovy:202)
14:52:38 14:52:38 Caused by: 14:52:38 geb.error.UnableToLoadException: Unable to load configuration from class 'class script15549871574581670056198' (with environment: ) 14:52:38 at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:305) 14:52:38 at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:291) 14:52:38 ... 11 more

I have tried a manual cloning of the directory, and then the problem does not happen.
But I am unable to go further with this, because the diff of the two checkout directories says that they are identical.
What could be causing this? 

thirsch...@gmail.com

unread,
Apr 12, 2019, 9:26:03 AM4/12/19
to Geb User Mailing List
I found the problem.
It was related to an exception that I throw myself in GebConfig.groovy, if some parameter are not provided, which might happen as a result of not doing a clean build.
I was confused because it did not print the message of that root exception, which would've helped greatly.
I only got to read it when I remote debugged the process, and inspect the throwable in this line:

ConfigurationLoader.groovy, line 304 - 306:

} catch (Throwable e) {
throw new UnableToLoadException(source, slurper.environment, e)
}

Is there a generic way to make Java/Gradle/Whatever print the message of "e" also?

I tried exceptionFormat = 'full' in the Gradle Test task, but it didn't do anything for me.






Marcin Erdmann

unread,
Apr 14, 2019, 2:58:34 PM4/14/19
to geb-...@googlegroups.com
Thanks for your email and the report of the issue you've encountered. The root exception, also referred to as cause is ignored in this case and not passed on in the constructor of UnableToLoadException: https://github.com/geb/geb/blob/a948be381fd2e25b5b170a421a555b8bd90128d0/module/geb-core/src/main/groovy/geb/error/UnableToLoadException.groovy#L24. If it was passed on to the super constructor then you'd see its message and stacktrace would be included in your original stacktrace. This is clearly a bug which I've recently accidentally introduced and not the intended behaviour so I've created an issue for it: https://github.com/geb/issues/issues/572.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/962a50a9-69d3-48f7-a7e1-06f8736e9b6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Charles Moga

unread,
May 21, 2019, 5:11:50 PM5/21/19
to Geb User Mailing List
Hello Marcin,
Any idea when this will be released? I am facing this same error and I cannot get to the bottom at all of the root cause. I am currently on 2.3.1.

Regards
Charles


On Sunday, 14 April 2019 19:58:34 UTC+1, Marcin Erdmann wrote:
Thanks for your email and the report of the issue you've encountered. The root exception, also referred to as cause is ignored in this case and not passed on in the constructor of UnableToLoadException: https://github.com/geb/geb/blob/a948be381fd2e25b5b170a421a555b8bd90128d0/module/geb-core/src/main/groovy/geb/error/UnableToLoadException.groovy#L24. If it was passed on to the super constructor then you'd see its message and stacktrace would be included in your original stacktrace. This is clearly a bug which I've recently accidentally introduced and not the intended behaviour so I've created an issue for it: https://github.com/geb/issues/issues/572.

On Fri, Apr 12, 2019 at 2:26 PM <thirsc...@gmail.com> wrote:
I found the problem.
It was related to an exception that I throw myself in GebConfig.groovy, if some parameter are not provided, which might happen as a result of not doing a clean build.
I was confused because it did not print the message of that root exception, which would've helped greatly.
I only got to read it when I remote debugged the process, and inspect the throwable in this line:

ConfigurationLoader.groovy, line 304 - 306:

} catch (Throwable e) {
throw new UnableToLoadException(source, slurper.environment, e)
}

Is there a generic way to make Java/Gradle/Whatever print the message of "e" also?

I tried exceptionFormat = 'full' in the Gradle Test task, but it didn't do anything for me.






--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-...@googlegroups.com.

Marcin Erdmann

unread,
May 22, 2019, 4:07:05 AM5/22/19
to geb-...@googlegroups.com
Hi Charles,

The plan is to release 3.0 which will contain the fix that's already on master early next week. I'm not planning to make any changes between now and the release so you might as well use 3.0-SNAPSHOT until then, see http://www.gebish.org/manual/current/#snapshot-repository. Be warned that there is a number of breaking changes in 3.0, see http://www.gebish.org/manual/snapshot/#breaking-changes.

Regards,
Marcin

To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.

To post to this group, send email to geb-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages