Error in Jelastic after migrating to 6.5

Hi,
I really love combination of CUBA and Jelastic, for it allows me to deploy my updated application just with a click of a button. It was working well, until I migrated to v 6.5.0.
I tested it locally, and it run just fine. But when I deploy, application won’t start. Although the server was okay. I thought this is problem from layershift, so I asked customer service. They gave me the log of error:

2017-04-22 15:20:11.774 ERROR [localhost-startStop-1] com.haulmont.cuba.core.sys.singleapp.SingleAppCoreContextLoader - Error initializing application
java.lang.RuntimeException: java.lang.RuntimeException: Error running Groovy script
        at com.haulmont.cuba.core.sys.dbupdate.DbUpdaterImpl.doUpdate(DbUpdaterImpl.java:102) ~[cuba-core-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.dbupdate.DbUpdaterEngine.updateDatabase(DbUpdaterEngine.java:86) ~[cuba-core-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.AppContextLoader.updateDatabase(AppContextLoader.java:114) ~[cuba-core-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.AppContextLoader.afterInitAppContext(AppContextLoader.java:106) ~[cuba-core-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.AbstractWebAppContextLoader.contextInitialized(AbstractWebAppContextLoader.java:74) ~[cuba-global-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.singleapp.SingleAppCoreContextLoader.contextInitialized(SingleAppCoreContextLoader.java:56) [cuba-core-6.5.0.jar:6.5.0]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
        at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:216) [spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]
        at com.haulmont.cuba.core.sys.singleapp.SingleAppCoreServletListener.contextInitialized(SingleAppCoreServletListener.java:88) [cuba-core-6.5.0.jar:6.5.0]
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4716) [catalina.jar:8.5.3]
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5178) [catalina.jar:8.5.3]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152) [catalina.jar:8.5.3]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) [catalina.jar:8.5.3]
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702) [catalina.jar:8.5.3]
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.3]
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952) [catalina.jar:8.5.3]
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823) [catalina.jar:8.5.3]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_112]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_112]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
Caused by: java.lang.RuntimeException: Error running Groovy script
        at com.haulmont.cuba.core.sys.AbstractScripting.runGroovyScript(AbstractScripting.java:248) ~[cuba-global-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.dbupdate.DbUpdaterImpl.executeGroovyScript(DbUpdaterImpl.java:90) ~[cuba-core-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.dbupdate.DbUpdaterEngine.executeScript(DbUpdaterEngine.java:401) ~[cuba-core-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.dbupdate.DbUpdaterEngine.doUpdate(DbUpdaterEngine.java:228) ~[cuba-core-6.5.0.jar:6.5.0]
        at com.haulmont.cuba.core.sys.dbupdate.DbUpdaterImpl.doUpdate(DbUpdaterImpl.java:99) ~[cuba-core-6.5.0.jar:6.5.0]
        ... 24 common frames omitted
Caused by: groovy.util.ResourceException: Unable to find resource 20-reports/update/postgres/17/170201-migrateSecurityIndex.upgrade.groovy:
File ../pms-core/conf/20-reports/update/postgres/17/170201-migrateSecurityIndex.upgrade.groovy doesn't exist
File web-inf:db/20-reports/update/postgres/17/170201-migrateSecurityIndex.upgrade.groovy doesn't exist
Classpath resource 20-reports/update/postgres/17/170201-migrateSecurityIndex.upgrade.groovy doesn't exist

    at com.haulmont.cuba.core.sys.AbstractScripting$CubaResourceConnector.getResourceConnection(AbstractScripting.java:406) ~[cuba-global-6.5.0.jar:6.5.0]
    at groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.java:545) ~[groovy-all-2.4.4.jar:2.4.4]
    at groovy.util.GroovyScriptEngine.createScript(GroovyScriptEngine.java:605) ~[groovy-all-2.4.4.jar:2.4.4]
    at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:592) ~[groovy-all-2.4.4.jar:2.4.4]
    at com.haulmont.cuba.core.sys.AbstractScripting.runGroovyScript(AbstractScripting.java:227) ~[cuba-global-6.5.0.jar:6.5.0]
    ... 28 common frames omitted

I’ve been wondering what’s wrong here? I think the problem lays on DB script that doesn’t exist. If that so, but then I checked the db script, well there’s nothing like that either. And why it’s okay when it’s tested locally but not on deployment?

After a work around, I see that the problem is on report component.
Maybe migrating tools for studio 6.5.0 need to do bit more on this? Or maybe another reason? One thing for sure, after I remove my report module, the app goes just fine.

Hi Yosi,

Thank you for reporting the problem. I found that the problem is reproduced for groovy update scripts in Jelastic deployment. We’ll fix it in the next bugfix release of 6.5.

Hi Yosi,

I have found the workaround. It’s described in the topic

Thanks Andrey, I’ll wait for the next bugfix.

Hi Yosi,
The problem is fixed in the platform version 6.5.1.

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-9001