Hide Forgot
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'
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.
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/c3ef5af8873b7a7180022bd156001f88c3bac03d Fix for bug 1019876
Fixed with --> https://github.com/openshift/origin-server/pull/3915
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.
This PR is merged, move to verified according to comment 4