Skip to content

[Bug] [upgrade] postgre upgrade error #7229

@caishunfeng

Description

@caishunfeng

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

2021-12-07 11:51:55.774  INFO 10511 --- [           main] o.a.d.dao.upgrade.UpgradeDao             : sqlSQLFilePathclass path resource [sql/upgrade/2.0.0_schema/postgresql/dolphinscheduler_dml.sql]
2021-12-07 11:51:55.783 ERROR 10511 --- [           main] o.a.d.dao.upgrade.ProjectDao             : 错误: 字段 "code" 不存在
  Position: 11

org.postgresql.util.PSQLException: 错误: 字段 "code" 不存在
  Position: 11
        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.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) ~[postgresql-42.2.5.jar:42.2.5]
        at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106) ~[postgresql-42.2.5.jar:42.2.5]
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-4.0.3.jar:na]
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-4.0.3.jar:na]
        at org.apache.dolphinscheduler.dao.upgrade.ProjectDao.queryAllProject(ProjectDao.java:49) ~[dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.processDefinitionJsonSplit(UpgradeDao.java:422) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinSchedulerTo200(UpgradeDao.java:184) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.upgradeDolphinScheduler(DolphinSchedulerManager.java:104) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler$CreateRunner.run(CreateDolphinScheduler.java:58) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        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.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) [spring-boot-2.5.6.jar:2.5.6]
        at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler.main(CreateDolphinScheduler.java:40) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]

2021-12-07 11:51:55.783 ERROR 10511 --- [           main] o.a.d.dao.upgrade.UpgradeDao             : json split error

java.lang.RuntimeException: sql: SELECT id,code FROM t_ds_project
        at org.apache.dolphinscheduler.dao.upgrade.ProjectDao.queryAllProject(ProjectDao.java:60) ~[dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.processDefinitionJsonSplit(UpgradeDao.java:422) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinSchedulerTo200(UpgradeDao.java:184) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.upgradeDolphinScheduler(DolphinSchedulerManager.java:104) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler$CreateRunner.run(CreateDolphinScheduler.java:58) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        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.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) [spring-boot-2.5.6.jar:2.5.6]
        at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler.main(CreateDolphinScheduler.java:40) [dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
Caused by: org.postgresql.util.PSQLException: 错误: 字段 "code" 不存在
  Position: 11
        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.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) ~[postgresql-42.2.5.jar:42.2.5]
        at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106) ~[postgresql-42.2.5.jar:42.2.5]
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-4.0.3.jar:na]
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-4.0.3.jar:na]
        at org.apache.dolphinscheduler.dao.upgrade.ProjectDao.queryAllProject(ProjectDao.java:49) ~[dolphinscheduler-dao-2.0.1-SNAPSHOT.jar:2.0.1-SNAPSHOT]
        ... 9 common frames omitted

What you expected to happen

run postgre upgrade sh error.

How to reproduce

run postgre upgrade sh successfully.

Anything else

No response

Version

2.0.0

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for replyWaiting for replybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions