Bug 807216 - cannot migrate successfully with script migrate-2.0.8
cannot migrate successfully with script migrate-2.0.8
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
1.x
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Rob Millner
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-27 06:10 EDT by Meng Bo
Modified: 2013-11-17 19:39 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-13 14:30:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2012-03-27 06:10:58 EDT
Description of problem:
prepare some data and try to update and migrate instance from devenv_stg_148, script migrate-2.0.8 will not be executed successfully.

Version-Release number of selected component (if applicable):
migrate-2.0.8

How reproducible:
always

Steps to Reproduce:
1.start devenv_stg_148
2.prepare some test data
3.update packages
4.run migrate-mongo-2.0.8
5.run migrate-2.0.8
  
Actual results:
will get error when running script migrate-2.0.8

Expected results:
migration should be successful.


Additional info:
[root@ip-10-224-114-177 bin]# ./migrate-2.0.8 
Getting all RHLogins...
/usr/lib/ruby/gems/1.8/gems/activemodel-3.0.10/lib/active_model/attribute_methods.rb:392:in `method_missing': undefined method `optimize=' for #<Application:0x7f9191ec7e88> (NoMethodError)
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/model.rb:133:in `send'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/model.rb:133:in `attributes='
	from /usr/lib/ruby/gems/1.8/gems/bson-1.5.2/lib/bson/ordered_hash.rb:81:in `each'
	from /usr/lib/ruby/gems/1.8/gems/bson-1.5.2/lib/bson/ordered_hash.rb:81:in `each'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/model.rb:132:in `attributes='
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/user_model.rb:79:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.3/lib/stickshift-controller/app/models/application.rb:219:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.3/lib/stickshift-controller/app/models/cloud_user.rb:149:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.3/lib/stickshift-controller/app/models/cloud_user.rb:148:in `each'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.3/lib/stickshift-controller/app/models/cloud_user.rb:148:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/user_model.rb:12:in `find'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.3/lib/stickshift-controller/app/models/cloud_user.rb:201:in `find'
	from ./migrate-2.0.8:175:in `migrate'
	from ./migrate-2.0.8:174:in `each'
	from ./migrate-2.0.8:174:in `migrate'
	from ./migrate-2.0.8:521
Comment 1 Rob Millner 2012-03-27 16:09:48 EDT
There were a few namespace changes that happened in this sprint.  Migrate needed to catch up.

From my last run...

#####################################################
Summary:
# of users: 16
# of apps: 20
# of failures: 0
Application counts per thread: [20]
Total execution time: 136s
#####################################################
Comment 2 Meng Bo 2012-03-28 01:55:13 EDT
still get the same problem (NoMethodError) when run migrate-2.0.8,
follow the steps in https://engineering.redhat.com/trac/Libra/ticket/158
Comment 3 Lili Nader 2012-03-28 15:24:48 EDT
please run migrate-mongo-2.0.8 first.
Comment 4 Rob Millner 2012-03-28 17:10:06 EDT
Still seeing the issue.  Migrate-mongo fixes a similar issue with user.namespace to app.domain.namespace.

The missing attribute, "optimize" doesn't appear in our code.  This must be driven by an update in activemodel.

[root@ip-10-110-178-90 ~]# ./li-test/misc/maintenance/bin/migrate-2.0.8
Getting all RHLogins...
/usr/lib/ruby/gems/1.8/gems/activemodel-3.0.10/lib/active_model/attribute_methods.rb:392:in `method_missing': undefined method `optimize=' for #<Application:0x7f8405d10660> (NoMethodError)
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/model.rb:133:in `send'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/model.rb:133:in `attributes='
	from /usr/lib/ruby/gems/1.8/gems/bson-1.5.2/lib/bson/ordered_hash.rb:81:in `each'
	from /usr/lib/ruby/gems/1.8/gems/bson-1.5.2/lib/bson/ordered_hash.rb:81:in `each'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/model.rb:132:in `attributes='
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/user_model.rb:79:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.4/lib/stickshift-controller/app/models/application.rb:218:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.4/lib/stickshift-controller/app/models/cloud_user.rb:149:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.4/lib/stickshift-controller/app/models/cloud_user.rb:148:in `each'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.4/lib/stickshift-controller/app/models/cloud_user.rb:148:in `hash_to_obj'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/user_model.rb:26:in `find_all'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/user_model.rb:25:in `map!'
	from /usr/lib/ruby/gems/1.8/gems/stickshift-common-0.7.2/lib/stickshift-common/models/user_model.rb:25:in `find_all'
	from ./li-test/misc/maintenance/bin/migrate-2.0.8:185:in `migrate'
	from ./li-test/misc/maintenance/bin/migrate-2.0.8:530
Comment 5 Rob Millner 2012-03-28 17:18:58 EDT
Found it - we used to have an optimize parameter on the Application model.

git diff origin/stage -- ./stickshift/controller/lib/stickshift-controller/app/models/application.rb

...

-  attr_accessor :user, :creation_time, :uuid, :aliases, :cart_data, :optimize,
+  attr_accessor :user, :creation_time, :uuid, :aliases, :cart_data, 

The migrate-mongo script needs to remove this parameter from mongodb.
Comment 6 Rob Millner 2012-03-28 17:23:35 EDT
Fixed in commit 03a190a.
Comment 7 Meng Bo 2012-03-29 02:55:35 EDT
verified with latest script migrate-mongo-2.0.8 and migrate-2.0.8
issue has been fixed.

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