如何调试卡住的迁移
how to debug a stuck migration
我正在处理一个带有遗留 grails 堆栈的项目,并且在启动应用程序时遇到问题,它在特定迁移时失败
grails dbm-status
我在特定迁移上失败了(我认为?)
| Error Error executing script DbmUpdate:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsApplication':
Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.codehaus.groovy.grails.commons.DefaultGrailsApplication]:
Constructor threw exception;
nested exception is org.codehaus.groovy.grails.exceptions.GrailsConfigurationException:
Class not found loading Grails application: v0212.changelog
(Use --stacktrace to see the full trace)
所以我认为top都是'something failed',具体是找不到名为v0212.changelog
的迁移。然而,迁移在我的项目中,并且与我能看到的所有其他迁移相同。
我还能做些什么来研究这个?
- 如何找到 "current" 迁移
- 如何启动 grails 而不是尝试 运行 所有迁移?
FWIW grails console
也因同样的错误而失败。
我尝试删除其他一些迁移,但该应用程序将在下一个迁移时失败。
我尝试删除整个迁移文件夹,但不知何故它仍然无法找到同一个文件。
▶ grails --version
Grails version: 2.5.6
▶ java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
▶ mysql --version
mysql Ver 14.14 Distrib 5.6.47, for osx10.15 (x86_64) using EditLine wrapper
Grails 迁移插件将在数据库中创建 databasechangelog
table。您可以通过执行以下命令简单地查询 table 以检查上次执行的迁移脚本:
select * from databasechangelog
order by orderexecuted desc;
我正在处理一个带有遗留 grails 堆栈的项目,并且在启动应用程序时遇到问题,它在特定迁移时失败
grails dbm-status
我在特定迁移上失败了(我认为?)
| Error Error executing script DbmUpdate:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsApplication':
Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.codehaus.groovy.grails.commons.DefaultGrailsApplication]:
Constructor threw exception;
nested exception is org.codehaus.groovy.grails.exceptions.GrailsConfigurationException:
Class not found loading Grails application: v0212.changelog
(Use --stacktrace to see the full trace)
所以我认为top都是'something failed',具体是找不到名为v0212.changelog
的迁移。然而,迁移在我的项目中,并且与我能看到的所有其他迁移相同。
我还能做些什么来研究这个? - 如何找到 "current" 迁移 - 如何启动 grails 而不是尝试 运行 所有迁移?
FWIW grails console
也因同样的错误而失败。
我尝试删除其他一些迁移,但该应用程序将在下一个迁移时失败。 我尝试删除整个迁移文件夹,但不知何故它仍然无法找到同一个文件。
▶ grails --version
Grails version: 2.5.6
▶ java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
▶ mysql --version
mysql Ver 14.14 Distrib 5.6.47, for osx10.15 (x86_64) using EditLine wrapper
Grails 迁移插件将在数据库中创建 databasechangelog
table。您可以通过执行以下命令简单地查询 table 以检查上次执行的迁移脚本:
select * from databasechangelog
order by orderexecuted desc;