Bamboo fail to upgrade due to duplicate constraints
Problem
Fail to upgrade Bamboo pre-6.4 to the latest version for Upgrade Task 60402 or 60501.
The following appears in the atlassian-bamboo.log
2018-09-18 06:07:57,032 INFO [localhost-startStop-1] [AbstractUpgradeManager] 60501 : Prepare for adding deletion cascades (bootstrap)
2018-09-18 06:07:57,032 INFO [localhost-startStop-1] [AbstractUpgradeManager] --------------------------------------------------------
2018-09-18 06:07:57,050 ERROR [localhost-startStop-1] [AbstractUpgradeManager] java.lang.IllegalArgumentException: expected one element but was: <fk_po3k8ns6fi8r5oe5f2p6o7pnh:FOREIGN_KEY:[plan_id], fkce081b6bd5badf1:FOREIGN_KEY:[plan_id]>
java.lang.IllegalArgumentException: expected one element but was: <fk_po3k8ns6fi8r5oe5f2p6o7pnh:FOREIGN_KEY:[plan_id], fkce081b6bd5badf1:FOREIGN_KEY:[plan_id]>
at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:317)
at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:289)
Cause
There are duplicate constraints from old version of Bamboo in the tables.
Resolution
- Shutdown Bamboo
Run the following SQL to delete the duplicate constraints:
ALTER TABLE acl_entry DROP CONSTRAINT fk2fb5f83d988cefe9; ALTER TABLE acl_object_identity DROP CONSTRAINT fk988cefe974d9e474; ALTER TABLE artifact_definition DROP CONSTRAINT fkf88809e0d324424a; ALTER TABLE artifact_subscription DROP CONSTRAINT fk4f23a6aad2a9566; ALTER TABLE artifact_subscription DROP CONSTRAINT fk4f23a6adef697da; ALTER TABLE branch_commit_info DROP CONSTRAINT fk13eab7994e9c6e49; ALTER TABLE branch_commit_info DROP CONSTRAINT fk13eab799ffa424ff; ALTER TABLE brs_artifact_link DROP CONSTRAINT fke1f6d10b3cf8cea8; ALTER TABLE brs_artifact_link DROP CONSTRAINT fke1f6d10b6a657612; ALTER TABLE brs_consumed_subscription DROP CONSTRAINT fkec405ed86eafb613; ALTER TABLE brs_consumed_subscription DROP CONSTRAINT fkec405ed8d7e7d97a; ALTER TABLE brs_linkedjiraissues DROP CONSTRAINT fk45b7017da958b29f; ALTER TABLE build DROP CONSTRAINT fk3c9ce4e645e1626; ALTER TABLE build DROP CONSTRAINT fk3c9ce4e707d72ee; ALTER TABLE build DROP CONSTRAINT fk3c9ce4e7c814e1c; ALTER TABLE build DROP CONSTRAINT fk3c9ce4ea77f0821; ALTER TABLE build DROP CONSTRAINT fk3c9ce4eb2b11c18; ALTER TABLE build_definition DROP CONSTRAINT fk611b4be4d96054ac; ALTER TABLE buildresultsummary DROP CONSTRAINT fk26506d3b9e6537b; ALTER TABLE buildresultsummary DROP CONSTRAINT fk26506d3bccacf65; ALTER TABLE buildresultsummary DROP CONSTRAINT fk26506d3bcedeef5f; ALTER TABLE buildresultsummary DROP CONSTRAINT fk26506d3be3b5b062; ALTER TABLE buildresultsummary_customdata DROP CONSTRAINT fk30932c1fa958b29f; ALTER TABLE buildresultsummary_label DROP CONSTRAINT fk9043ed0a77f0821; ALTER TABLE buildresultsummary_label DROP CONSTRAINT fk9043ed0a958b29f; ALTER TABLE buildresultsummary_label DROP CONSTRAINT fk9043ed0b9de8666; ALTER TABLE buildresultsummary_label DROP CONSTRAINT fk9043ed0d96054ac; ALTER TABLE capability DROP CONSTRAINT fkee341118a542349b; ALTER TABLE chain_stage DROP CONSTRAINT fkb613cfc0d96054ac; ALTER TABLE commit_files DROP CONSTRAINT fka9983d4f4d373123; ALTER TABLE dep_version_planresultkeys DROP CONSTRAINT fk939e88317bd9bbc; ALTER TABLE deployment_env_vcs_location DROP CONSTRAINT fkcae794fa1d68b66c; ALTER TABLE deployment_env_vcs_location DROP CONSTRAINT fkcae794faa248fee7; ALTER TABLE deployment_environment DROP CONSTRAINT fkc1b0cb79645e1626; ALTER TABLE deployment_environment DROP CONSTRAINT fkc1b0cb79707d72ee; ALTER TABLE deployment_environment DROP CONSTRAINT fkc1b0cb79b414bf2e; ALTER TABLE deployment_project_item DROP CONSTRAINT fk4ce273d3ba4939db; ALTER TABLE deployment_project_item_ba DROP CONSTRAINT fk2486042bdef697da; ALTER TABLE deployment_project_item_ba DROP CONSTRAINT fk2486042be12ae48b; ALTER TABLE deployment_result DROP CONSTRAINT fkb7acdad7a248fee7; ALTER TABLE deployment_result DROP CONSTRAINT fkb7acdad7e3b5b062; ALTER TABLE deployment_result DROP CONSTRAINT fkb7acdad7f4f36a02; ALTER TABLE deployment_result_customdata DROP CONSTRAINT fkc16165037c500f83; ALTER TABLE deployment_version DROP CONSTRAINT fk1178613ea77f0821; ALTER TABLE deployment_version DROP CONSTRAINT fk1178613ee3b5b062; ALTER TABLE deployment_version_changeset DROP CONSTRAINT fkf6ad40d11d68b66c; ALTER TABLE deployment_version_changeset DROP CONSTRAINT fkf6ad40d17bd9bbc; ALTER TABLE deployment_version_commit DROP CONSTRAINT fk6a5377581f560c5f; ALTER TABLE deployment_version_commit DROP CONSTRAINT fk6a537758fe0c684f; ALTER TABLE deployment_version_item DROP CONSTRAINT fkec5e1747bd9bbc; ALTER TABLE deployment_version_item_ba DROP CONSTRAINT fk2598a6ea18c479b2; ALTER TABLE deployment_version_item_ba DROP CONSTRAINT fk2598a6ea3cf8cea8; ALTER TABLE deployment_version_jira_issue DROP CONSTRAINT fk80b13a897bd9bbc; ALTER TABLE deployment_version_naming DROP CONSTRAINT fk7c536ea9ba4939db; ALTER TABLE deployment_version_status DROP CONSTRAINT fk85e21e137bd9bbc; ALTER TABLE ec2_image_script DROP CONSTRAINT fk435aaf5a12c89ce9; ALTER TABLE ec2_image_script DROP CONSTRAINT fk435aaf5ab4fe710f; ALTER TABLE elastic_image DROP CONSTRAINT fk581fb731a542349b; ALTER TABLE elastic_schedule DROP CONSTRAINT fk1c6b30e1581fb731; ALTER TABLE external_members DROP CONSTRAINT fkd8c8d8a5117d5fda; ALTER TABLE external_members DROP CONSTRAINT fkd8c8d8a5f25e5d5f; ALTER TABLE local_members DROP CONSTRAINT fk6b8fb445117d5fda; ALTER TABLE local_members DROP CONSTRAINT fk6b8fb445ce2b3226; ALTER TABLE notifications DROP CONSTRAINT fk594acc8707d72ee; ALTER TABLE plan_dependencies DROP CONSTRAINT fkf971f67f6bdf075c; ALTER TABLE plan_dependencies DROP CONSTRAINT fkf971f67f8d5e95ae; ALTER TABLE plan_vcs_history DROP CONSTRAINT fkffb92865b00a18da; ALTER TABLE plan_vcs_location DROP CONSTRAINT fkb7fed5e41d68b66c; ALTER TABLE plan_vcs_location DROP CONSTRAINT fkb7fed5e4d5badf1; ALTER TABLE queue DROP CONSTRAINT fk49d20f1581fb731; ALTER TABLE queue DROP CONSTRAINT fk49d20f1a542349b; ALTER TABLE relevant_changesets DROP CONSTRAINT fk34a3e6e3cbadfcbd; ALTER TABLE repository_changeset DROP CONSTRAINT fk4a5687dd1d68b66c; ALTER TABLE repository_changeset DROP CONSTRAINT fk4a5687dda958b29f; ALTER TABLE requirement DROP CONSTRAINT fk95fc7023645e1626; ALTER TABLE stage_variable_context DROP CONSTRAINT fk3bc0de0dcedeef5f; ALTER TABLE test_case DROP CONSTRAINT fk617bfabd2170166f; ALTER TABLE test_case_result DROP CONSTRAINT fkd6859fdf1f5e6ca9; ALTER TABLE test_case_result DROP CONSTRAINT fkd6859fdf5aa11ddd; ALTER TABLE test_class DROP CONSTRAINT fkce081b6bd5badf1; ALTER TABLE test_class_result DROP CONSTRAINT fk3521ff712170166f; ALTER TABLE test_class_result DROP CONSTRAINT fk3521ff71a958b29f; ALTER TABLE test_error DROP CONSTRAINT fkce2743fb39a4607d; ALTER TABLE trusted_apps_ips DROP CONSTRAINT fk257a172793e75e62; ALTER TABLE trusted_apps_urls DROP CONSTRAINT fk89ce4929d65ff53a; ALTER TABLE user_commit DROP CONSTRAINT fkf8936c2bcbadfcbd; ALTER TABLE user_commit DROP CONSTRAINT fkf8936c2bfe0c684f;
- Restart Bamboo
Last modified on Sep 27, 2018
Powered by Confluence and Scroll Viewport.