Closed Bug 341091 Opened 19 years ago Closed 19 years ago

checksetup breaks if there are duplicate versions for a product

Categories

(Bugzilla :: Installation & Upgrading, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: mkgnu, Assigned: mkanat)

Details

Attachments

(2 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20060505 Firefox/1.0.4 (Debian package 1.0.4-2sarge7) Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20060505 Firefox/1.0.4 (Debian package 1.0.4-2sarge7) When attempting to upgrade from Bugzilla 2.10 to 2.20.2 I noticed the following output from checksetup.pl Updating column value in table versions ... Old: tinytext New: varchar(64) NOT NULL Adding new index 'versions_product_id_idx' to the versions table ... DBD::mysql::db do failed: Duplicate entry '4-ROUNDTABLE_REL_1-2-0' for key 1 at Bugzilla/DB.pm line 475 Bugzilla::DB::bz_add_index_raw('Bugzilla::DB::Mysql=HASH(0x8847970)', 'versions', 'versions_product_id_idx', 'HASH(0x93f2848)') called at Bugzilla/DB.pm line 448 Bugzilla::DB::bz_add_index('Bugzilla::DB::Mysql=HASH(0x8847970)', 'versions', 'versions_product_id_idx', 'HASH(0x93f2848)') called at ./checksetup.pl line 4004 I know we had version numbers listed as: ROUNDTABLE_REL_1-2-0 ROUNDTABLE_REL_1-2-1 ... so I don't know where the "4-" came in above in "4-ROUNDTABLE_REL_1-2-0". Reproducible: Always Steps to Reproduce: 1. I suppose you need the 2.10 database data I have 2. run checksetup.pl Actual Results: It apprears that when I now browse to Products->Edit Product->Edit versions, there are 15 copies of the version ROUNDTABLE_REL_1-2-0 (and other versions too). I know I run the checksetup.pl script 3 times total to make sure this wasn't a one-time problem. There weren't duplicates in the 2.10 database instance Expected Results: Update the database schema without somehow inserting duplicate versions. Also don't give the errors shown above that seem to persist. If I keep rerunning checksetup.pl, the warnings still appear. How can this be fixed ? What can I do ? Perhaps this is just an issue only when upgrading from 2.10, or in any case the much older releases, and not of high enough priority. There must be something checksetup is missing when upgrading.
I have code that fixes this, I'm just waiting on my client to release to copyright so that I can contribute it to Bugzilla.
Assignee: installation → mkanat
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.22
Summary: checksetup problem adding indices → checksetup breaks if there are duplicate versions for a product
(In reply to comment #0) > There weren't duplicates in the 2.10 database instance > fixed ? What can I do ? I manually went in table versions and cleared all duplicates. Still, after rerunning the script I get the same error: Adding new index 'versions_product_id_idx' to the versions table ... DBD::mysql::db do failed: Duplicate entry '2-CAIDD_BUILD_9' for key 1 at Bugzilla/DB.pm line 475 Bugzilla::DB::bz_add_index_raw('Bugzilla::DB::Mysql=HASH(0x88479d0)', 'versions', 'versions_product_id_idx', 'HASH(0x91cc12c)') called at Bugzilla/DB.pm line 448 Bugzilla::DB::bz_add_index('Bugzilla::DB::Mysql=HASH(0x88479d0)', 'versions', 'versions_product_id_idx', 'HASH(0x91cc12c)') called at ./checksetup.pl line 4004 I was 100% sure now that there was no duplicate entry for version CAIDD_BUILD_9. So why the error ? I don't see any syntax for mysql 3.23.55 to show indices or let me somehow manually fix the problem.
I now wonder if this bug is responsible for also having only the last comment entered displayed when accessing any bug (both existing and brand new).
Max suggested in the mailing list that the missing comments problem sounds like checksetup did not complete properly, probably because of this issue
(In reply to comment #2) > > I was 100% sure now that there was no duplicate entry for version > CAIDD_BUILD_9. So why the error ? I was incorrect. There must have been a duplicate entry for this version. Running ./checksetup for yet another time went through correctly: Adding new index 'versions_product_id_idx' to the versions table ... Updating column creation_ts in table bugs ... Old: datetime NOT NULL New: datetime Adding group editclassifications ... Adding group admin ... Adding new index 'attachments_submitter_id_idx' to the attachments table ... Adding group bz_canusewhines ... Adding group bz_canusewhineatothers ... Adding a new user setting called 'display_quips' Adding a new user setting called 'comment_sort_order' Adding a new user setting called 'csv_colsepchar' And now the issue of no longer viewing all comments went away.
Attached patch v1 - tipSplinter Review
Here's the fix for the tip. I've used this on upgrading installations successfully, so I'm granting myself review as module owner.
Attachment #236333 - Flags: review+
Attached patch v1 - 2.22Splinter Review
This is the same code as above, but for 2.22. It's just moved into the right place for 2.22.
Attachment #236335 - Flags: review?(kevin.benton)
Oh, and thanks to Akamai, whose funded the writing of this patch. Their credits in checksetup.pl are already posted as part of another patch, I'm pretty sure. Otherwise I'll add their "contributor" credit on checkin.
Status: NEW → ASSIGNED
Comment on attachment 236335 [details] [diff] [review] v1 - 2.22 Works fine when upgrading from 2.18 to 2.22. Note that I had to hack the DB manually to add duplicated versions for the same product. The UI didn't let me do so. r=LpSolit
Attachment #236335 - Flags: review?(kevin.benton) → review+
Flags: approval?
Flags: approval2.22?
Flags: approval?
Flags: approval2.22?
Flags: approval2.22+
Flags: approval+
tip: Checking in Bugzilla/Install/DB.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm,v <-- DB.pm new revision: 1.15; previous revision: 1.14 done 2.22: Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.469.2.12; previous revision: 1.469.2.11 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: