Bug 807216 - cannot migrate successfully with script migrate-2.0.8
Summary: cannot migrate successfully with script migrate-2.0.8
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 1.x
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-27 10:10 UTC by Meng Bo
Modified: 2013-11-18 00:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-13 18:30:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Meng Bo 2012-03-27 10:10:58 UTC
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 20:09:48 UTC
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 05:55:13 UTC
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 19:24:48 UTC
please run migrate-mongo-2.0.8 first.

Comment 4 Rob Millner 2012-03-28 21:10:06 UTC
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 21:18:58 UTC
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 21:23:35 UTC
Fixed in commit 03a190a.

Comment 7 Meng Bo 2012-03-29 06:55:35 UTC
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.