Bug 1019876 - Exception: NoMethodError: undefined method `list_user_env_vars' for #<Gear:0x000000080814e0>
Summary: Exception: NoMethodError: undefined method `list_user_env_vars' for #<Gear:0x...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-16 14:38 UTC by Jessica Forrester
Modified: 2015-05-15 00:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 03:24:31 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Jessica Forrester 2013-10-16 14:38:04 UTC
Exception was reported in prod:

NoMethodError: undefined method `list_user_env_vars' for #<Gear:0x000000080814e0> 
…are/gems/gems/mongoid-3.0.21/lib/mongoid/
attributes.rb: 249:in `method_missing'
…openshift-origin-controller-1.15.13/app/models/
gear.rb: 224:in `method_missing'
…ft-origin-controller-1.15.13/app/models/
application.rb: 437:in `list_user_env_variables'
…13/app/controllers/
environment_variables_controller.rb:  12:in `index'
…troller-1.15.13/lib/openshift/controller/
action_log.rb:  80:in `set_logged_request'
…sr/share/gems/gems/journey-1.0.4/lib/journey/
router.rb:  68:in `block in call'
…sr/share/gems/gems/journey-1.0.4/lib/journey/
router.rb:  56:in `each'
…sr/share/gems/gems/journey-1.0.4/lib/journey/
router.rb:  56:in `call'
…per-0.11.1/lib/mongo_mapper/middleware/
identity_map.rb:  10:in `call'
…oid-3.0.21/lib/rack/mongoid/middleware/
identity_map.rb:  34:in `block in call'
…e/gems/gems/mongoid-3.0.21/lib/mongoid/
unit_of_work.rb:  39:in `unit_of_work'
…oid-3.0.21/lib/rack/mongoid/middleware/
identity_map.rb:  34:in `call'
…3/root/usr/share/gems/gems/rack-1.4.1/lib/rack/
etag.rb:  23:in `call'
…/share/gems/gems/rack-1.4.1/lib/rack/
conditionalget.rb:  25:in `call'
…e/gems/gems/rack-1.4.1/lib/rack/session/abstract/
id.rb: 205:in `context'
…e/gems/gems/rack-1.4.1/lib/rack/session/abstract/
id.rb: 200:in `call'
…/share/gems/gems/rack-1.4.1/lib/rack/
methodoverride.rb:  21:in `call'
…oot/usr/share/gems/gems/rack-1.4.1/lib/rack/
runtime.rb:  17:in `call'
…3/root/usr/share/gems/gems/rack-1.4.1/lib/rack/
lock.rb:  15:in `call'
…are/gems/gems/rack-cache-1.2/lib/rack/cache/
context.rb: 136:in `forward'
…are/gems/gems/rack-cache-1.2/lib/rack/cache/
context.rb: 245:in `fetch'
…are/gems/gems/rack-cache-1.2/lib/rack/cache/
context.rb: 185:in `lookup'
…are/gems/gems/rack-cache-1.2/lib/rack/cache/
context.rb:  66:in `call!'
…are/gems/gems/rack-cache-1.2/lib/rack/cache/
context.rb:  51:in `call'
…r-3.0.21/lib/phusion_passenger/rack/
request_handler.rb:  97:in `process_request'
…0.21/lib/phusion_passenger/
abstract_request_handler.rb: 521:in `accept_and_process_next_request'
…0.21/lib/phusion_passenger/
abstract_request_handler.rb: 274:in `main_loop'
…0.21/lib/phusion_passenger/rack/
application_spawner.rb: 206:in `start_request_handler'
…0.21/lib/phusion_passenger/rack/
application_spawner.rb:  79:in `block in spawn_application'
…s/gems/passenger-3.0.21/lib/phusion_passenger/
utils.rb: 470:in `safe_fork'
…0.21/lib/phusion_passenger/rack/
application_spawner.rb:  64:in `spawn_application'
…assenger-3.0.21/lib/phusion_passenger/
spawn_manager.rb: 264:in `spawn_rack_application'
…assenger-3.0.21/lib/phusion_passenger/
spawn_manager.rb: 137:in `spawn_application'
…assenger-3.0.21/lib/phusion_passenger/
spawn_manager.rb: 275:in `handle_spawn_application'
…senger-3.0.21/lib/phusion_passenger/
abstract_server.rb: 357:in `server_main_loop'
…senger-3.0.21/lib/phusion_passenger/
abstract_server.rb: 206:in `start_synchronously'

Comment 1 Abhishek Gupta 2013-10-17 19:26:53 UTC
This happened since the application was stuck fetching the active_capacity fact from the node and the gear did not have the server_identity set. With the application in this state, when the REST API call to fetch environment variables is made, the proxy cannot be instantiated and hence missing_method error. 

Subsequently, about an hour later, when the stuck pending_op was re-triggered, it succeeded and the application was successfully created.

To fix this issue, we need to check the presence of the server_identity and if it is not set, then raise an appropriate exception rather than throwing the method missing exception.

Comment 3 Abhishek Gupta 2013-10-17 23:15:15 UTC
Fixed with --> https://github.com/openshift/origin-server/pull/3915

Comment 4 Jianwei Hou 2013-10-18 05:49:45 UTC
Tested on devenv_3912 with the modified code, set server_identity to null in application's group_instaces, and restrieve its evironment variables, will get response:
{"api_version":1.6,"data":null,"messages":[{"exit_code":null,"field":null,"index":null,"severity":"error","text":"Unable to complete the requested operation due to: The node to create the gear on has not yet been identified.\nReference ID: dc386b55fb1be4bffb7be9e5e7f29256"}],"status":"internal_server_error","supported_api_versions":[1.0,1.1,1.2,1.3,1.4,1.5,1.6],"type":null,"version":"1.6"}

This bug will be moved to verified once the PR is merged.

Comment 5 Jianwei Hou 2013-10-21 02:37:43 UTC
This PR is merged, move to verified according to comment 4


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