Closed Bug 622204 Opened 14 years ago Closed 14 years ago

Bugzilla::Migrate crashes trying to create bugs with resolutions

Categories

(Bugzilla :: Bug Import/Export & Moving, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: eevee, Assigned: eevee)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20101230 Firefox-4.0/4.0b9pre
Build Identifier: 4.0rc1

Got the following crash trying a fairly simple migration:

Can't use string ("Bugzilla::Bug") as a HASH ref while "strict refs" in use at Bugzilla/Bug.pm line 3296.
 at Bugzilla/Install/Util.pm line 633
        Bugzilla::Install::Util::_console_die('Can\'t use string ("Bugzilla::Bug") as a HASH ref while "stri...') called at Bugzilla/Bug.pm line 3296
        Bugzilla::Bug::status('Bugzilla::Bug') called at Bugzilla/Bug.pm line 1744
        Bugzilla::Bug::_check_resolution('Bugzilla::Bug', 'INVALID', 'resolution', 'HASH(0x9a6a820)') called at Bugzilla/Object.pm line 475
        Bugzilla::Object::run_create_validators('Bugzilla::Bug', 'HASH(0x94e02e4)') called at Bugzilla/Bug.pm line 713
        Bugzilla::Bug::run_create_validators('Bugzilla::Bug', 'HASH(0x94e02e4)') called at Bugzilla/Bug.pm line 607
        Bugzilla::Bug::create('Bugzilla::Bug', 'HASH(0x94e02e4)') called at Bugzilla/Migrate.pm line 770
        Bugzilla::Migrate::insert_bugs('Bugzilla::Migrate::xxx=HASH(0x96bf7c4)', 'ARRAY(0x967aa48)') called at Bugzilla/Migrate.pm line 185
        Bugzilla::Migrate::do_migration('Bugzilla::Migrate::xxx=HASH(0x96bf7c4)') called at ./migrate.pl line 53

_check_resolution isn't designed to be called as a class method.  According to mkanat, Bugzilla::Bug used to delete the {resolution} key and no longer does.  I have a trivial patch that deletes it in insert_bugs instead.

Reproducible: Always
Attached patch teeny patchSplinter Review
For the record, the problem was caused by the addition of VALIDATOR_DEPENDENCIES. We still do delete $bug->{resolution} in run_create_validators, but it doesn't matter because SUPER::run_create_validators still tries to validate the resolution.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #500426 - Flags: review+
Flags: approval4.0+
Flags: approval+
Target Milestone: --- → Bugzilla 4.0
Assignee: import-export → bugzilla
Status: NEW → ASSIGNED
Version: unspecified → 4.0
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Migrate.pm
Committed revision 7651.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified Bugzilla/Migrate.pm
Committed revision 7512.
Status: ASSIGNED → RESOLVED
Closed: 14 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: