Bugzilla::Migrate crashes trying to create bugs with resolutions

RESOLVED FIXED in Bugzilla 4.0

Status

()

Bugzilla
Bug Import/Export & Moving
--
major
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: eevee, Assigned: eevee)

Tracking

Bugzilla 4.0
Bug Flags:
approval +
approval4.0 +

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
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
(Assignee)

Comment 1

7 years ago
Created attachment 500426 [details] [diff] [review]
teeny patch

Comment 2

7 years ago
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

Updated

7 years ago
Attachment #500426 - Flags: review+

Updated

7 years ago
Flags: approval4.0+
Flags: approval+
Target Milestone: --- → Bugzilla 4.0
Assignee: import-export → bugzilla
Status: NEW → ASSIGNED
Version: unspecified → 4.0

Comment 3

7 years ago
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
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.