Closed Bug 382275 Opened 19 years ago Closed 19 years ago

recode.pl fails to run on upgrades from certain versions

Categories

(Bugzilla :: Installation & Upgrading, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: justdave, Unassigned)

Details

checksetup.pl apparently tries to do the utf8 recode as part of the 2.22 to 3.0 update, but if it's necessary to run recode.pl it tells you this before it upgrades the schema, which leaves your schema in a state that recode.pl doesn't understand and complains about (because of lack of keys on some of the tables). This has apparently been a point of confusion for several folks coming into IRC. checksetup.pl should upgrade your database to the point where recode.pl will actually work before telling you to run it.
text shown is: WARNING: We are about to convert your table storage format to UTF8. This allows Bugzilla to correctly store and sort international characters. However, if you have any non-UTF-8 data in your database, it ***WILL BE DELETED*** by this process. So, before you continue with checksetup.pl, if you have any non-UTF-8 data (or even if you're not sure) you should press Ctrl-C now to interrupt checksetup.pl, and run contrib/recode.pl to make all the data in your database into UTF-8. You should also back up your database before continuing. This will affect every single table in the database, even non-Bugzilla tables. If you ever used a version of Bugzilla before 2.22, we STRONGLY recommend that you stop checksetup.pl NOW and run contrib/recode.pl. Press Enter to continue or Ctrl-C to exit... Believe it or not, the workaround for this was: 1) modify Bugzilla/DB/Schema.pm to comment out the comment_id and extra_data tags before running contrib/recode.pl 2) remove the modification to Bugzilla/DB/Schema.pm before re-running checksetup.pl Everything's working fine now.
Could you explain what version you were upgrading from? I'm not able to reproduce this problem. recode.pl is written in such a way that it should be runnable when upgrading from any version. If it can't, this isn't a bug in checksetup, it's a bug in recode.
Also, if you could show whatever error recode.pl was giving you, I'll need that too.
Summary: checksetup.pl shouldn't tell you to run recode.pl or recode the database to utf8 until after schema conversion from 2.22 is done → recode.pl fails to run on upgrades from certain versions
Here's the error that is seen: $ perl contrib/recode.pl --charset=UTF-8 ... Reading ./localconfig... Checking for DBD-mysql (v2.9003) ok: found v4.0011 WARNING: We are about to convert your table storage format to UTF8. This allows Bugzilla to correctly store and sort international characters. However, if you have any non-UTF-8 data in your database, it ***WILL BE DELETED*** by this process. So, before you continue with checksetup.pl, if you have any non-UTF-8 data (or even if you're not sure) you should press Ctrl-C now to interrupt checksetup.pl, and run contrib/recode.pl to make all the data in your database into UTF-8. You should also back up your database before continuing. This will affect every single table in the database, even non-Bugzilla tables. If you ever used a version of Bugzilla before 2.22, we STRONGLY recommend that you stop checksetup.pl NOW and run contrib/recode.pl. Press Enter to continue or Ctrl-C to exit... [root@roundup2 bugzilla-3.0.1]# /tools/x2/current/perl-5.8.8/bin/perl contrib/recode.pl --charset=UTF-8 Converting attachments.description... Converting attachments.filename... Converting attachments.mimetype... Converting bug_severity.value... Converting bug_status.value... Converting bugs.priority... Converting bugs.keywords... Converting bugs.bug_file_loc... Converting bugs.rep_platform... Converting bugs.short_desc... Converting bugs.status_whiteboard... Converting bugs.bug_severity... Converting bugs.bug_status... Converting bugs.version... Converting bugs.resolution... Converting bugs.target_milestone... Converting bugs.alias... Converting bugs.op_sys... Converting bugs_activity.added... Converting bugs_activity.removed... Converting classifications.name... Converting classifications.description... Converting components.name... Converting components.description... Converting fielddefs.name... DBD::mysql::st execute failed: Unknown column 'id' in 'field list' [for Statement "SELECT name, id FROM fielddefs WHERE name IS NOT NULL AND name != ''"] at contrib/recode.pl line 248
oops, the initial warning output was from 'checksetup.pl'. the error was from running contrib/recode.pl.
For some reason, your bz_schema table is out of sync with your actual database. recode.pl never tries to get a column unless that column actually exists, so that means it thinks that column exists when it doesn't. Unfortunately, that would make this a local problem, as far as I can see.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Target Milestone: Bugzilla 3.0 → ---
You need to log in before you can comment on or make changes to this bug.