You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/04/20 08:57:40 UTC

[GitHub] [dolphinscheduler] EricGao888 opened a new issue, #9628: [Bug] [DAO] Incorrect soft_version causes database initialization failure

EricGao888 opened a new issue, #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   * Running `sh create-schema.sh` to initialize database will give error `Duplicate key name 'idx_code_version'`, result in db initialization failure.
   * We should change soft_version from `2.0.4` to `3.0.0` https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-dao/src/main/resources/sql/soft_version to fix this bug.
   
   ### What you expected to happen
   
   * Running `sh create-schema.sh` will successfully initialize database.
   
   ### How to reproduce
   
   * Already described above.
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org.apache.org

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


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #9628: [Bug] [DAO] Incorrect soft_version causes database initialization failure

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1103653470

   Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
   * If you haven't received a reply for a long time, you can [join our slack](https://join.slack.com/t/asf-dolphinscheduler/shared_invite/zt-omtdhuio-_JISsxYhiVsltmC5h38yfw) and send your question to channel `#troubleshooting`


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] EricGao888 commented on issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1104720620

   > `Duplicate key name 'idx_code_version' `causes this problem to be caused by executing the create and update methods at the same time when executing the `sh create-schema.sh` file.
   
   @zhuangchong May I ask what is the expected behavior of `sh create-schema.sh`? Is there any method to avoid performing creation and update at the same time? It seems only 2.1.0_schema causes the duplicate errors and other updates seems fine.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] EricGao888 commented on issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1104274868

   Some wired issues appeared when I tried to fix this. It took me quite some time to figure out what was really going on here.
   
   Actually, db initialization failure is not caused by outdated `soft_version`. There are two main reasons: 
   1. `create-schema.sh` is outdated and some paths in it are incorrect, failing to get correct db type. https://github.com/apache/dolphinscheduler/blob/239be31ab732f5bbe68fca3033245125e8388657/dolphinscheduler-tools/src/main/bin/create-schema.sh#L22-L27
   2. SQL scripts in `dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema` causes a few duplicate key and duplicate index error. https://github.com/apache/dolphinscheduler/blob/239be31ab732f5bbe68fca3033245125e8388657/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql#L18-L30


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] berg-xu commented on issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
berg-xu commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1123151688

   @EricGao888  
   DS 3.0.0 
   problem  :  java.sql.SQLSyntaxErrorException: Duplicate key name 'idx_code_version'
   How to solve this problem ? 


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] EricGao888 commented on issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1104656446

   > > Some wired issues appeared when I tried to fix this. It took me quite some time to figure out what was really going on here.
   > > Actually, db initialization failure is not directly caused by outdated `soft_version`. There are two main reasons:
   > > 
   > > 1. `create-schema.sh` is outdated and some paths in it are incorrect, failing to get correct db type. https://github.com/apache/dolphinscheduler/blob/239be31ab732f5bbe68fca3033245125e8388657/dolphinscheduler-tools/src/main/bin/create-schema.sh#L22-L27
   > > 2. SQL scripts in `dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema` causes a few duplicate key and duplicate index error. https://github.com/apache/dolphinscheduler/blob/239be31ab732f5bbe68fca3033245125e8388657/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql#L18-L30
   > 
   > I don't think the second problem will appear after the upgrade soft_version to 3.0.0. Can you give it a try?
   
   I upgraded soft_version to 3.0.0, cleaned up and recompiled project and still have the second issue. Not sure whether I missed any steps. Anyway I will try again to confirm this.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] SbloodyS commented on issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1104654475

   > Some wired issues appeared when I tried to fix this. It took me quite some time to figure out what was really going on here.
   > 
   > Actually, db initialization failure is not directly caused by outdated `soft_version`. There are two main reasons:
   > 
   > 1. `create-schema.sh` is outdated and some paths in it are incorrect, failing to get correct db type. https://github.com/apache/dolphinscheduler/blob/239be31ab732f5bbe68fca3033245125e8388657/dolphinscheduler-tools/src/main/bin/create-schema.sh#L22-L27
   > 2. SQL scripts in `dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema` causes a few duplicate key and duplicate index error. https://github.com/apache/dolphinscheduler/blob/239be31ab732f5bbe68fca3033245125e8388657/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql#L18-L30
   
   I don't think the second problem will appear after the upgrade soft_version to 3.0.0. Can you give it a try?


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] zhuangchong commented on issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1104723193

   > > `Duplicate key name 'idx_code_version' `causes this problem to be caused by executing the create and update methods at the same time when executing the `sh create-schema.sh` file.
   > 
   > @zhuangchong May I ask what is the expected behavior of `sh create-schema.sh`? Is there any method to avoid performing creation and update at the same time? It seems only 2.1.0_schema causes the duplicate errors and other updates seems fine.
   
   When `sh create-schema.sh` executes the CreateDolphinScheduler method, the InitDolphinScheduler and UpgradeDolphinScheduler under the directory will also be scanned and injected, we need to distinguish.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] zhuangchong commented on issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on issue #9628:
URL: https://github.com/apache/dolphinscheduler/issues/9628#issuecomment-1104714712

   Duplicate key name 'idx_code_version' causes this problem to be caused by executing the create and update methods at the same time when executing the `sh create-schema.sh` file.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] SbloodyS closed issue #9628: [Bug] [DAO] Dev branch database initialization failure

Posted by GitBox <gi...@apache.org>.
SbloodyS closed issue #9628: [Bug] [DAO] Dev branch database initialization failure
URL: https://github.com/apache/dolphinscheduler/issues/9628


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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