Bug 1180004 - Moving gear from non-district node to district node will fail when set USE_PREDICTABLE_GEAR_UUIDS=true
Summary: Moving gear from non-district node to district node will fail when set USE_PR...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1171002
TreeView+ depends on / blocked
 
Reported: 2015-01-08 03:13 UTC by Jianwei Hou
Modified: 2015-05-15 00:30 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1171002
Environment:
Last Closed: 2015-03-05 19:56:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jianwei Hou 2015-01-08 03:13:43 UTC
+++ This bug was initially created as a clone of Bug #1171002 +++

Description of problem:
Moving gear from non-district node to district node will fail when set USE_PREDICTABLE_GEAR_UUIDS=true in broker.conf.

Version-Release number of selected component (if applicable):
ose2.2/2014-12-02.3

How reproducible:
Always

Steps to Reproduce:
1.Prepare env with 2 small gear size nodes, node1 in district, node2 not in district. Set USE_PREDICTABLE_GEAR_UUIDS=true in broker.conf.
2.Create app on node2(not in district). 
# rhc app create pl1 perl-5.10
Make sure gear's uid available in district.
# id -u hanli1dom-pl1-1
1001
3.Move app gear from node2 to node1.
# oo-admin-move --gear_uuid hanli1dom-pl1-1 -i node1.ose22-move.com.cn


Actual results:
3.Moving failed.
# oo-admin-move --gear_uuid hanli1dom-pl1-1 -i node1.ose22-move.com.cn
URL: http://pl1-hanli1dom.ose22-20141201.com.cn
Login: hanli1
App UUID: 548166218e45f07eb8000016
Gear UUID: 548166218e45f07eb8000016
/opt/rh/ruby193/root/usr/share/ruby/mcollective/ddl/base.rb:145:in `rescue in validate_input_argument': Cannot validate input gear_uuid: value should match ^[a-zA-Z0-9]+$ (MCollective::DDLValidationError)
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/ddl/base.rb:126:in `validate_input_argument'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/ddl/agentddl.rb:194:in `block in validate_rpc_request'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/ddl/agentddl.rb:186:in `each'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/ddl/agentddl.rb:186:in `validate_rpc_request'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/client.rb:169:in `validate_request'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/client.rb:240:in `method_missing'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1.1/lib/openshift/mcollective_application_container_proxy.rb:2873:in `block in get_gear_uid'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1.1/lib/openshift/mcollective_application_container_proxy.rb:2440:in `rpc_exec'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1.1/lib/openshift/mcollective_application_container_proxy.rb:2872:in `get_gear_uid'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1.1/lib/openshift/mcollective_application_container_proxy.rb:1947:in `move_gear'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1.1/lib/openshift/mcollective_application_container_proxy.rb:1937:in `block in move_gear_secure'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.32.3.2/app/models/lock.rb:62:in `run_in_app_lock'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1.1/lib/openshift/mcollective_application_container_proxy.rb:1934:in `move_gear_secure'
	from /usr/sbin/oo-admin-move:114:in `<main>'


Expected results:
3.Should move gear successfully.

Additional info:
Moving gear between districts or moving gear between nodes in the same district work well when USE_PREDICTABLE_GEAR_UUIDS=true.
If set USE_PREDICTABLE_GEAR_UUIDS=false in broker.conf, repeat the step 2 and 3, move will succeed.

--- Additional comment from Luke Meyer on 2014-12-05 21:28:52 CST ---

Another validation to correct. Thank you for catching this.

--- Additional comment from Luke Meyer on 2014-12-06 04:43:36 CST ---

https://github.com/openshift/origin-server/pull/6001

--- Additional comment from openshift-github-bot on 2014-12-06 04:55:32 CST ---

Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/544c81e62f9b1e2eb9cb06cb064a53844a7c7c34
openshift.ddl: fix gear UUID regexes

Bug 1171002 - Moving gear from non-district node to district node will
fail when set USE_PREDICTABLE_GEAR_UUIDS=true
https://bugzilla.redhat.com/show_bug.cgi?id=1171002

Comment 1 Luke Meyer 2015-01-08 13:49:05 UTC
*should* be fixed in online/origin at this time...

Comment 2 Jianwei Hou 2015-01-09 07:54:52 UTC
Tested on devenv_5383, this bug is still reproducible.
[root@ip-10-233-92-118 ~]# oo-admin-move --gear_uuid jhou-py33s-1 -i ip-10-179-168-150
URL: http://py33s-jhou.dev.rhcloud.com
Login: jhou
App UUID: 54afc3849c96d580ae00005f
Gear UUID: 54afc4d39c96d580ae0000d2
/opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/client.rb:972:in `process_results_with_block': Input gear_uuid did not pass validation: value should match (?-mix:^[a-zA-Z0-9]+$) (MCollective::InvalidRPCData)
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/client.rb:891:in `block in call_agent'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/client.rb:212:in `block in start_receiver'
	from /opt/rh/ruby193/root/usr/share/ruby/timeout.rb:69:in `timeout'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/client.rb:209:in `start_receiver'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/client.rb:164:in `unthreaded_req'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/client.rb:150:in `req'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/client.rb:887:in `call_agent'
	from /opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/client.rb:264:in `method_missing'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1/lib/openshift/mcollective_application_container_proxy.rb:2873:in `block in get_gear_uid'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1/lib/openshift/mcollective_application_container_proxy.rb:2440:in `rpc_exec'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1/lib/openshift/mcollective_application_container_proxy.rb:2872:in `get_gear_uid'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1/lib/openshift/mcollective_application_container_proxy.rb:1947:in `move_gear'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1/lib/openshift/mcollective_application_container_proxy.rb:1937:in `block in move_gear_secure'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.34.1/app/models/lock.rb:62:in `run_in_app_lock'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.31.1/lib/openshift/mcollective_application_container_proxy.rb:1934:in `move_gear_secure'
	from /usr/sbin/oo-admin-move:114:in `<main>'

Comment 3 Luke Meyer 2015-01-09 21:14:46 UTC
Agent code was needlessly re-validating uuid with an outdated regex.

https://github.com/openshift/origin-server/pull/6039

Comment 4 Jianwei Hou 2015-01-13 03:23:20 UTC
Verified on devenv_5389.

[root@ip-10-41-166-24 ~]# oo-admin-move --gear_uuid jhou-php1s-1 -i ip-10-95-206-57
URL: http://php1s-jhou.dev.rhcloud.com
Login: jhou
App UUID: 54b4d29309744e6927000001
Gear UUID: 54b4d2e509744e6927000025
DEBUG: Source district uuid: NONE
DEBUG: Destination district uuid: NONE
Error moving gear. Move gear only allowed from non-districted/districted node to districted node.


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