iam_service 0.10.0稳定版 初始化脚本执行报错

  • Choerodon平台版本: 0.6.0

  • 遇到问题的执行步骤:
    执行 sh init-local-database.sh 时

  • 文档地址:
    https://github.com/choerodon/iam-service

  • 环境信息(如:节点信息):
    本地

  • 报错日志:
    groovy.lang.MissingPropertyException: No such property: helper for class: org.liquibase.groovy.delegate.ChangeSetDelegate
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307) ~[groovy-2.4.10.jar!/:2.4.10]
    at db.Script1$_run_closure1$_closure2.doCall(Script1.groovy:5) ~[na:na]
    at db.Script1$_run_closure1$_closure2.doCall(Script1.groovy) ~[na:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.liquibase.groovy.delegate.DatabaseChangeLogDelegate.changeSet(DatabaseChangeLogDelegate.groovy:115) ~[liquibase-groovy-dsl-1.2.2.jar!/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174) ~[groovy-2.4.10.jar!/:2.4.10]
    at db.Script1$_run_closure1.doCall(Script1.groovy:4) ~[na:na]
    at db.Script1$_run_closure1.doCall(Script1.groovy) ~[na:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) ~[groovy-2.4.10.jar!/:2.4.10]
    at liquibase.parser.ext.GroovyLiquibaseChangeLogParser.processDatabaseChangeLogRootElement(GroovyLiquibaseChangeLogParser.groovy:136) ~[liquibase-groovy-dsl-1.2.2.jar!/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182) ~[groovy-2.4.10.jar!/:2.4.10]
    at liquibase.parser.ext.GroovyLiquibaseChangeLogParser$_getChangeLogMethodMissing_closure3.doCall(GroovyLiquibaseChangeLogParser.groovy:93) ~[liquibase-groovy-dsl-1.2.2.jar!/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:84) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:944) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1267) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1220) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125) ~[groovy-2.4.10.jar!/:2.4.10]
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174) ~[groovy-2.4.10.jar!/:2.4.10]
    at db.Script1.run(Script1.groovy:3) ~[na:na]
    at db.Script1$run.call(Unknown Source) ~[na:na]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) ~[groovy-2.4.10.jar!/:2.4.10]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) ~[groovy-2.4.10.jar!/:2.4.10]
    at liquibase.parser.ext.GroovyLiquibaseChangeLogParser.parse(GroovyLiquibaseChangeLogParser.groovy:64) ~[liquibase-groovy-dsl-1.2.2.jar!/:na]
    at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229) ~[liquibase-core-3.5.3.jar!/:na]
    at liquibase.Liquibase.update(Liquibase.java:202) ~[liquibase-core-3.5.3.jar!/:na]
    at liquibase.Liquibase.update(Liquibase.java:192) ~[liquibase-core-3.5.3.jar!/:na]
    at liquibase.Liquibase.update(Liquibase.java:188) ~[liquibase-core-3.5.3.jar!/:na]
    at io.choerodon.liquibase.LiquibaseExecutor.load(LiquibaseExecutor.java:236) ~[classes!/:0.5.2.RELEASE]
    at io.choerodon.liquibase.LiquibaseExecutor.simpleExec(LiquibaseExecutor.java:181) ~[classes!/:0.5.2.RELEASE]
    at io.choerodon.liquibase.LiquibaseExecutor.run(LiquibaseExecutor.java:77) ~[classes!/:0.5.2.RELEASE]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:747) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
    at io.choerodon.liquibase.LiquibaseTools.main(LiquibaseTools.java:16) [classes!/:0.5.2.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [choerodon-tool-liquibase.jar:0.5.2.RELEASE]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [choerodon-tool-liquibase.jar:0.5.2.RELEASE]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [choerodon-tool-liquibase.jar:0.5.2.RELEASE]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [choerodon-tool-liquibase.jar:0.5.2.RELEASE]

  • 原因分析:

    提出您分析问题的过程,以便我们能更准确的找到问题所在

  • 疑问:

    提出您对于遇到和解决该问题时的疑问

线上部署的话,使用0.5.6的dbtool镜像>>image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/dbtool:0.5.6
本地初始化数据库测试的话,使用0.6.3以上版本的jar包 >>choerodon-tool-liquibase-0.6.3.RELEASE.jar

then
curl http://nexus.choerodon.com.cn/repository/choerodon-release/io/choerodon/choerodon-tool-liquibase/0.5.2.RELEASE/choerodon-tool-liquibase-0.5.2.RELEASE.jar -o target/choerodon-tool-liquibase.jar
fi

这个脚本哪些地方需要改的?我把0.5.2替换成0.6.3,执行还是报错

什么数据库

mysql,这是修改后的执行脚本
mkdir -p target
if [ ! -f target/choerodon-tool-liquibase.jar ]
then
curl http://nexus.choerodon.com.cn/repository/choerodon-release/io/choerodon/choerodon-tool-liquibase/0.6.3.RELEASE/choerodon-tool-liquibase-0.6.3.RELEASE.jar -o target/choerodon-tool-liquibase.jar
fi
java -Dspring.datasource.url=“jdbc:mysql://47.106.119.52/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false”
-Dspring.datasource.username=username
-Dspring.datasource.password=password
-Ddata.drop=false -Ddata.init=true
-Ddata.dir=src/main/resources
-jar target/choerodon-tool-liquibase.jar

执行还是报错

不应该啊,换了jar包还是报一样的错误吗?先把targer里面的包删掉在跑脚本,不然不会重新下载的

肯定删掉了的,报错信息是Error: Invalid or corrupt jarfile target/choerodon-tool-liquibase.jar

ok,已经可以了
我自己通过浏览器下载,然后重命名的方式放到target目录下,再执行脚本 执行成功

提个建议:
下次如果需要换版本的话,先把readme里的改了

好,感谢建议
贴一个可以的脚本

#!/usr/bin/env bash
mkdir -p target
if [ ! -f target/choerodon-tool-liquibase.jar ]
then
    curl http://nexus.choerodon.com.cn/repository/choerodon-release/io/choerodon/choerodon-tool-liquibase/0.6.3.RELEASE/choerodon-tool-liquibase-0.6.3.RELEASE.jar -L  -o target/choerodon-tool-liquibase.jar
fi
#java -Dspring.datasource.url="jdbc:oracle:thin:@127.0.0.1:1521:xe" \
java -Dspring.datasource.url="jdbc:mysql://localhost/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false" \
 -Dspring.datasource.username=root \
 -Dspring.datasource.password=root \
 -Ddata.drop=false -Ddata.init=true \
 -Ddata.dir=src/main/resources \
 -jar target/choerodon-tool-liquibase.jar