{"action":"created","issue":{"url":"https://api.github.com/repos/quintel/etmoses/issues/463","labels_url":"https://api.github.com/repos/quintel/etmoses/issues/463/labels{/name}","comments_url":"https://api.github.com/repos/quintel/etmoses/issues/463/comments","events_url":"https://api.github.com/repos/quintel/etmoses/issues/463/events","html_url":"https://github.com/quintel/etmoses/issues/463","id":108326450,"number":463,"title":"NoMethodError: undefined method `curves' for nil:NilClass","user":{"login":"dennisschoenmakers","id":104830,"avatar_url":"https://avatars.githubusercontent.com/u/104830?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisschoenmakers","html_url":"https://github.com/dennisschoenmakers","followers_url":"https://api.github.com/users/dennisschoenmakers/followers","following_url":"https://api.github.com/users/dennisschoenmakers/following{/other_user}","gists_url":"https://api.github.com/users/dennisschoenmakers/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisschoenmakers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisschoenmakers/subscriptions","organizations_url":"https://api.github.com/users/dennisschoenmakers/orgs","repos_url":"https://api.github.com/users/dennisschoenmakers/repos","events_url":"https://api.github.com/users/dennisschoenmakers/events{/privacy}","received_events_url":"https://api.github.com/users/dennisschoenmakers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/quintel/etmoses/labels/airbrake","name":"airbrake","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-25T13:27:41Z","updated_at":"2015-09-25T21:17:10Z","closed_at":"2015-09-25T21:17:10Z","body":"Check full details on Airbrake: [#1517362082736486053](https://quintel.airbrake.io/projects/111227/groups/1517362082736486053)\n\nBacktrace:\n```\n[PROJECT_ROOT]/app/models/installed_technology.rb:145:in profile_components\n[PROJECT_ROOT]/app/models/installed_technology.rb:129:in profile_curves\n[PROJECT_ROOT]/app/models/installed_technology.rb:104:in profile_curve\n[PROJECT_ROOT]/app/models/calculation/context.rb:42:in block in length\n[PROJECT_ROOT]/app/models/calculation/context.rb:41:in map\n[PROJECT_ROOT]/app/models/calculation/context.rb:41:in length\n[PROJECT_ROOT]/app/models/calculation/technology_load.rb:12:in run\n[PROJECT_ROOT]/app/models/calculation/technology_load.rb:4:in call\n[PROJECT_ROOT]/app/models/testing_ground.rb:63:in block in to_calculated_graph\n[PROJECT_ROOT]/app/models/testing_ground.rb:62:in each\n[PROJECT_ROOT]/app/models/testing_ground.rb:62:in reduce\n[PROJECT_ROOT]/app/models/testing_ground.rb:62:in to_calculated_graph\n[PROJECT_ROOT]/app/models/testing_ground.rb:38:in as_json\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/json/encoding.rb:34:in encode\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/json/encoding.rb:21:in encode\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/core_ext/object/json.rb:37:in to_json_with_active_support_encoder\n[PROJECT_ROOT]/app/controllers/testing_grounds_controller.rb:71:in data\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal/implicit_render.rb:4:in send_action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/abstract_controller/base.rb:189:in process_action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal/rendering.rb:10:in process_action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/abstract_controller/callbacks.rb:20:in block in process_action\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:113:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:113:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in block in halting_and_conditional\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in block in halting_and_conditional\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in block in halting_and_conditional\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in block in halting_and_conditional\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:215:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:215:in block in halting_and_conditional\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:215:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:215:in block in halting_and_conditional\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in block in halting\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in block in halting\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in block in halting\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in block in halting\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in block in halting\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in block in halting\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in block in halting_and_conditional\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in run_callbacks\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/abstract_controller/callbacks.rb:19:in process_action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal/rescue.rb:29:in process_action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal/instrumentation.rb:31:in block in process_action\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/notifications.rb:159:in block in instrument\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/notifications/instrumenter.rb:20:in instrument\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/notifications.rb:159:in instrument\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal/instrumentation.rb:30:in process_action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal/params_wrapper.rb:250:in process_action\n[GEM_ROOT]/gems/activerecord-4.1.8/lib/active_record/railties/controller_runtime.rb:18:in process_action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/abstract_controller/base.rb:136:in process\n[GEM_ROOT]/gems/actionview-4.1.8/lib/action_view/rendering.rb:30:in process\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal.rb:196:in dispatch\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal/rack_delegation.rb:13:in dispatch\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_controller/metal.rb:232:in block in action\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:82:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:82:in dispatch\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:50:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:73:in block in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:59:in each\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:59:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:678:in call\n[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:35:in block in call\n[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:34:in catch\n[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:34:in call\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/etag.rb:23:in call\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in call\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/head.rb:11:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/params_parser.rb:27:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/flash.rb:254:in call\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in context\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/cookies.rb:560:in call\n[GEM_ROOT]/gems/activerecord-4.1.8/lib/active_record/query_cache.rb:36:in call\n[GEM_ROOT]/gems/activerecord-4.1.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/callbacks.rb:29:in block in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:82:in run_callbacks\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/callbacks.rb:27:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/remote_ip.rb:76:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/debug_exceptions.rb:17:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/show_exceptions.rb:30:in call\n[GEM_ROOT]/gems/railties-4.1.8/lib/rails/rack/logger.rb:38:in call_app\n[GEM_ROOT]/gems/railties-4.1.8/lib/rails/rack/logger.rb:20:in block in call\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/tagged_logging.rb:68:in block in tagged\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/tagged_logging.rb:26:in tagged\n[GEM_ROOT]/gems/activesupport-4.1.8/lib/active_support/tagged_logging.rb:68:in tagged\n[GEM_ROOT]/gems/railties-4.1.8/lib/rails/rack/logger.rb:20:in call\n[GEM_ROOT]/gems/actionpack-4.1.8/lib/action_dispatch/middleware/request_id.rb:21:in call\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in call\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/runtime.rb:17:in call\n[GEM_ROOT]/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in call\n[GEM_ROOT]/gems/railties-4.1.8/lib/rails/engine.rb:514:in call\n[GEM_ROOT]/gems/railties-4.1.8/lib/rails/application.rb:144:in call\n[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:576:in process_client\n[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:670:in worker_loop\n[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in spawn_missing_workers\n[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in start\n[GEM_ROOT]/gems/unicorn-4.8.3/bin/unicorn_rails:209:in <top (required)>\n[GEM_ROOT]/bin/unicorn_rails:23:in load\n[GEM_ROOT]/bin/unicorn_rails:23:in <main>\n```"},"comment":{"url":"https://api.github.com/repos/quintel/etmoses/issues/comments/143356647","html_url":"https://github.com/quintel/etmoses/issues/463#issuecomment-143356647","issue_url":"https://api.github.com/repos/quintel/etmoses/issues/463","id":143356647,"user":{"login":"antw","id":4383,"avatar_url":"https://avatars.githubusercontent.com/u/4383?v=3","gravatar_id":"","url":"https://api.github.com/users/antw","html_url":"https://github.com/antw","followers_url":"https://api.github.com/users/antw/followers","following_url":"https://api.github.com/users/antw/following{/other_user}","gists_url":"https://api.github.com/users/antw/gists{/gist_id}","starred_url":"https://api.github.com/users/antw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antw/subscriptions","organizations_url":"https://api.github.com/users/antw/orgs","repos_url":"https://api.github.com/users/antw/repos","events_url":"https://api.github.com/users/antw/events{/privacy}","received_events_url":"https://api.github.com/users/antw/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T21:17:10Z","updated_at":"2015-09-25T21:17:10Z","body":"This no longer seems to be an issue; the [LES calculates fine](http://beta.moses.et-model.com/testing_grounds/301). In theory this would be caused by deleting a load profile [which is in use by an LES](https://github.com/quintel/etmoses/blob/e90bbbb28a8dd3ec07a94bc7692c5d3981ab2228/app/models/installed_technology.rb#L211).\r\n\r\nI think we need a better strategy for dealing with what happens when profiles are deleted. Similar to #418."}}