You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "jamesfredley (via GitHub)" <gi...@apache.org> on 2025/09/17 19:22:29 UTC

[I] databasemigration.updateOnStart fails to find updateOnStartFileName [grails-core]

jamesfredley opened a new issue, #15078:
URL: https://github.com/apache/grails-core/issues/15078

   ### Issue description
   
   Example App:  https://github.com/jamesfredley/migration-test
   
   ```
   3:19:40 PM: Executing 'bootRun'…
   
   > Task :cleanGroovyCompilerConfig
   > Task :compileJava NO-SOURCE
   > Task :configureGroovyCompilerGrailsCore UP-TO-DATE
   > Task :configureGroovyCompiler UP-TO-DATE
   > Task :compileGroovy UP-TO-DATE
   > Task :buildProperties UP-TO-DATE
   > Task :processResources
   > Task :classes
   > Task :findMainClass UP-TO-DATE
   
   > Task :bootRun
   
   >                                                                            <
   >                            ____           _ _                              <
   >                           / ___|_ __ __ _(_) |___                          <
   >                          | |  _| '__/ _` | | / __|                         <
   >                          | |_| | | | (_| | | \__ \                         <
   >                           \____|_|  \__,_|_|_|___/                         <
   >                          https://grails.apache.org                         <
   >                                                                            <
   
   2025-09-17T15:19:46.439-04:00 ERROR 15228 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed
   
   liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CommandExecutionException: java.util.NoSuchElementException: Cannot access first() element from an empty Iterable
   	at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:259)
   	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
   	at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin$_doWithApplicationContext_closure2$_closure5.doCall(DatabaseMigrationGrailsPlugin.groovy:92)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
   	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
   	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
   	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:280)
   	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
   	at groovy.lang.Closure.call(Closure.java:433)
   	at groovy.lang.Closure.call(Closure.java:422)
   	at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:98)
   	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
   	at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:95)
   	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
   	at org.grails.plugins.databasemigration.DatabaseMigrationTransactionManager.withTransaction(DatabaseMigrationTransactionManager.groovy:143)
   	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
   	at org.grails.plugins.databasemigration.DatabaseMigrationTransactionManager.withTransaction(DatabaseMigrationTransactionManager.groovy:67)
   	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
   	at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin$_doWithApplicationContext_closure2.doCall(DatabaseMigrationGrailsPlugin.groovy:81)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
   	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
   	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
   	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:280)
   	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
   	at groovy.lang.Closure.call(Closure.java:433)
   	at groovy.lang.Closure.call(Closure.java:422)
   	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2394)
   	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2379)
   	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2432)
   	at org.codehaus.groovy.runtime.dgm$209.doMethodInvoke(Unknown Source)
   	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
   	at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin.doWithApplicationContext(DatabaseMigrationGrailsPlugin.groovy:65)
   	at org.grails.plugins.DefaultGrailsPlugin.doWithApplicationContext(DefaultGrailsPlugin.java:515)
   	at org.grails.plugins.AbstractGrailsPluginManager.doPostProcessing(AbstractGrailsPluginManager.java:220)
   	at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy:275)
   	at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy)
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:454)
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387)
   	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:1009)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:630)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:318)
   	at grails.boot.GrailsApp.run(GrailsApp.groovy:102)
   	at grails.boot.GrailsApp.run(GrailsApp.groovy:398)
   	at grails.boot.GrailsApp.run(GrailsApp.groovy:385)
   	at com.example.Application.main(Application.groovy:10)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
   	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50)
   Caused by: liquibase.exception.CommandExecutionException: java.util.NoSuchElementException: Cannot access first() element from an empty Iterable
   	at liquibase.command.CommandScope.execute(CommandScope.java:257)
   	at liquibase.Liquibase.lambda$update$0(Liquibase.java:245)
   	at liquibase.Scope.lambda$child$0(Scope.java:190)
   	at liquibase.Scope.child(Scope.java:199)
   	at liquibase.Scope.child(Scope.java:189)
   	at liquibase.Scope.child(Scope.java:168)
   	at liquibase.Liquibase.runInScope(Liquibase.java:1436)
   	at liquibase.Liquibase.update(Liquibase.java:234)
   	at liquibase.Liquibase.update(Liquibase.java:212)
   	at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:297)
   	at org.grails.plugins.databasemigration.liquibase.GrailsLiquibase.performUpdate(GrailsLiquibase.groovy:86)
   	at liquibase.integration.spring.SpringLiquibase.lambda$afterPropertiesSet$0(SpringLiquibase.java:249)
   	at liquibase.Scope.lambda$child$0(Scope.java:190)
   	at liquibase.Scope.child(Scope.java:199)
   	at liquibase.Scope.child(Scope.java:189)
   	at liquibase.Scope.child(Scope.java:168)
   	at liquibase.Scope.child(Scope.java:256)
   	at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:242)
   	... 61 common frames omitted
   Caused by: java.util.NoSuchElementException: Cannot access first() element from an empty Iterable
   	at org.codehaus.groovy.runtime.DefaultGroovyMethods.first(DefaultGroovyMethods.java:10368)
   	at org.codehaus.groovy.runtime.dgm$305.doMethodInvoke(Unknown Source)
   	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
   	at org.grails.plugins.databasemigration.liquibase.GroovyChangeLogParser.parseToNode(GroovyChangeLogParser.groovy:53)
   	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15)
   	at liquibase.command.core.helpers.DatabaseChangelogCommandStep.lambda$getDatabaseChangeLog$0(DatabaseChangelogCommandStep.java:129)
   	at liquibase.Scope.child(Scope.java:199)
   	at liquibase.Scope.child(Scope.java:175)
   	at liquibase.command.core.helpers.DatabaseChangelogCommandStep.getDatabaseChangeLog(DatabaseChangelogCommandStep.java:128)
   	at liquibase.command.core.helpers.DatabaseChangelogCommandStep.run(DatabaseChangelogCommandStep.java:87)
   	at liquibase.command.CommandScope.execute(CommandScope.java:219)
   	... 78 common frames omitted
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] databasemigration.updateOnStart fails to find updateOnStartFileName [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on issue #15078:
URL: https://github.com/apache/grails-core/issues/15078#issuecomment-3310614187

   Historically, I've had to add the following to my apps with the db plugin:
   
             sourceSets {
                 main {
                     resources {
                         srcDir 'grails-app/migrations'
                     }
                 }
             }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] databasemigration.updateOnStart fails to find updateOnStartFileName [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on issue #15078:
URL: https://github.com/apache/grails-core/issues/15078#issuecomment-3309119759

   The underlying issue, which also appears to be true for Grails 6, is that /grails-app/migrations/* are not added to /build/resources/main 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] databasemigration.updateOnStart fails to find updateOnStartFileName [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley closed issue #15078: databasemigration.updateOnStart fails to find updateOnStartFileName
URL: https://github.com/apache/grails-core/issues/15078


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org