-
Notifications
You must be signed in to change notification settings - Fork 5k
[Bug] [deploy on k8s by helm] db-init-job failed when use pg as metadata #9963
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
[Bug] [deploy on k8s by helm] db-init-job failed when use pg as metadata
What you expected to happen
helm install
kubectl logs xxx-db-init-job-xxx
org.postgresql.util.PSQLException: ERROR: cannot drop table t_ds_process_instance because other objects depend on it
Detail: constraint foreign_key_instance_id on table t_ds_task_instance depends on table t_ds_process_instance
Hint: Use DROP ... CASCADE to drop the dependent objects too.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266) ~[postgresql-42.2.5.jar:42.2.5]
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na]
at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:118) [dolphinscheduler-common-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:73) [dolphinscheduler-common-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.runInitSql(UpgradeDao.java:110) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.initSchema(UpgradeDao.java:96) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.DolphinSchedulerManager.initDolphinSchedulerSchema(DolphinSchedulerManager.java:78) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.DolphinSchedulerManager.initDolphinScheduler(DolphinSchedulerManager.java:58) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.InitDolphinScheduler$InitRunner.run(InitDolphinScheduler.java:45) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:791) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:775) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) [spring-boot-2.5.6.jar:2.5.6]
at org.apache.dolphinscheduler.tools.datasource.CreateDolphinScheduler.main(CreateDolphinScheduler.java:30) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
2022-05-10 10:59:40.419 ERROR 7 --- [ main] o.a.d.common.utils.ScriptRunner : Error executing: DROP TABLE IF EXISTS t_ds_process_instance
2022-05-10 10:59:40.419 ERROR 7 --- [ main] o.a.d.tools.datasource.dao.UpgradeDao : ERROR: cannot drop table t_ds_process_instance because other objects depend on it
Detail: constraint foreign_key_instance_id on table t_ds_task_instance depends on table t_ds_process_instance
Hint: Use DROP ... CASCADE to drop the dependent objects too.
org.postgresql.util.PSQLException: ERROR: cannot drop table t_ds_process_instance because other objects depend on it
Detail: constraint foreign_key_instance_id on table t_ds_task_instance depends on table t_ds_process_instance
Hint: Use DROP ... CASCADE to drop the dependent objects too.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266) ~[postgresql-42.2.5.jar:42.2.5]
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na]
at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:118) ~[dolphinscheduler-common-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:73) ~[dolphinscheduler-common-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.runInitSql(UpgradeDao.java:110) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.initSchema(UpgradeDao.java:96) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.DolphinSchedulerManager.initDolphinSchedulerSchema(DolphinSchedulerManager.java:78) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.DolphinSchedulerManager.initDolphinScheduler(DolphinSchedulerManager.java:58) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.InitDolphinScheduler$InitRunner.run(InitDolphinScheduler.java:45) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:791) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:775) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) [spring-boot-2.5.6.jar:2.5.6]
at org.apache.dolphinscheduler.tools.datasource.CreateDolphinScheduler.main(CreateDolphinScheduler.java:30) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
2022-05-10 10:59:40.421 INFO 7 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-05-10 10:59:40.440 ERROR 7 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:794) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:775) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) [spring-boot-2.5.6.jar:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) [spring-boot-2.5.6.jar:2.5.6]
at org.apache.dolphinscheduler.tools.datasource.CreateDolphinScheduler.main(CreateDolphinScheduler.java:30) [dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
Caused by: java.lang.RuntimeException: ERROR: cannot drop table t_ds_process_instance because other objects depend on it
Detail: constraint foreign_key_instance_id on table t_ds_task_instance depends on table t_ds_process_instance
Hint: Use DROP ... CASCADE to drop the dependent objects too.
at org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.runInitSql(UpgradeDao.java:113) ~[dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.initSchema(UpgradeDao.java:96) ~[dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.DolphinSchedulerManager.initDolphinSchedulerSchema(DolphinSchedulerManager.java:78) ~[dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.DolphinSchedulerManager.initDolphinScheduler(DolphinSchedulerManager.java:58) ~[dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.InitDolphinScheduler$InitRunner.run(InitDolphinScheduler.java:45) ~[dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:791) [spring-boot-2.5.6.jar:2.5.6]
... 5 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: cannot drop table t_ds_process_instance because other objects depend on it
Detail: constraint foreign_key_instance_id on table t_ds_task_instance depends on table t_ds_process_instance
Hint: Use DROP ... CASCADE to drop the dependent objects too.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270) ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266) ~[postgresql-42.2.5.jar:42.2.5]
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na]
at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:118) ~[dolphinscheduler-common-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:73) ~[dolphinscheduler-common-3.0.0-alpha.jar:3.0.0-alpha]
at org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.runInitSql(UpgradeDao.java:110) ~[dolphinscheduler-tools-3.0.0-alpha.jar:3.0.0-alpha]
... 10 common frames omitted
How to reproduce
deploy succeeded
Anything else
No response
Version
dev
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct