Bug 1011867 - rhc-admin-migrate-datastore is broken with "undefined method `saved_values' for #<BSON::OrderedHash:0x00000007ea83a8> (NoMethodError)"
rhc-admin-migrate-datastore is broken with "undefined method `saved_values' f...
Product: OpenShift Online
Classification: Red Hat
Component: Pod (Show other bugs)
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Abhishek Gupta
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-09-25 05:43 EDT by Jianwei Hou
Modified: 2015-05-14 20:21 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-17 09:31:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jianwei Hou 2013-09-25 05:43:31 EDT
Description of problem:
Given there are some app pending_ops with type 'set_group_overrides' in mongodb, execute the mongo migration, and the program is broken with error "undefined method `saved_values' for #<BSON::OrderedHash:0x00000007ea83a8> (NoMethodError)"

Digged into code, and found the error generating line:
update_sets["pending_op_groups.#{op_group_index}.pending_ops.#{op_index}.saved_group_overrides"] = op.saved_values["group_overrides"]

the op's class was BSON::OrderedHash, worked around it by updating 'op.saved_values' to op["saved_values"]

Version-Release number of selected component (if applicable):
On devenv_3824

How reproducible:

Steps to Reproduce:
1. Create all types of pending_ops on devenv-stage ami
2. Upgrade server to latest following wiki to test fork_ami migration
3. Do non-compatible datastore migration
/usr/bin/rhc-admin-migrate-datastore --non-compatible --version 2.0.34

Actual results:
After step 3:
[root@ip-10-236-138-5 ~]# /usr/bin/rhc-admin-migrate-datastore --non-compatible --version 2.0.34
Starting migration: non_compatible
/usr/bin/rhc-admin-migrate-datastore:278:in `migrate_app_pending_ops': undefined method `saved_values' for #<BSON::OrderedHash:0x0000000841eb48> (NoMethodError)
	from /usr/bin/rhc-admin-migrate-datastore:186:in `block (2 levels) in migrate_pending_ops'
	from /usr/bin/rhc-admin-migrate-datastore:185:in `each'
	from /usr/bin/rhc-admin-migrate-datastore:185:in `each_with_index'
	from /usr/bin/rhc-admin-migrate-datastore:185:in `block in migrate_pending_ops'
	from /opt/rh/ruby193/root/usr/local/share/gems/gems/mongo-1.8.1/lib/mongo/cursor.rb:286:in `each'
	from /usr/bin/rhc-admin-migrate-datastore:181:in `migrate_pending_ops'
	from /usr/bin/rhc-admin-migrate-datastore:140:in `migrate'
	from /usr/bin/rhc-admin-migrate-datastore:466:in `<main>'

Expected results:
Program should not be broken

Additional info:
Comment 1 openshift-github-bot 2013-09-25 13:18:17 EDT
Commits pushed to master at https://github.com/openshift/li

Fix for bug 1011867

Merge pull request #1924 from abhgupta/abhgupta-dev

Fix for bug 1011867
Comment 2 Abhishek Gupta 2013-09-25 13:23:04 EDT
Fixed with --> https://github.com/openshift/li/pull/1924
Comment 3 Jianwei Hou 2013-09-25 23:14:00 EDT
Verified on devenv_3829, the problem is fixed, the program migrated mongodb successfully.

Note You need to log in before you can comment on or make changes to this bug.