Actions
Bug #19631
closedActiveRecord::RecordNotSaved when deleting compute resources with key pairs
Status:
Closed
Priority:
High
Assignee:
Category:
Compute resources
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
Steps to Reproduce:
1.goto Infrastructure>Compute resources
2.Create EC2 compute resource
3.goto Infrastructure>Compute resources
4.delete the created compute resource
2017-05-23T11:30:56 24905450 [app] [I] Started DELETE "/compute_resources/6-ec2" for ::1 at 2017-05-23 11:30:56 +0000 2017-05-23T11:30:56 24905450 [app] [I] Processing by ComputeResourcesController#destroy as HTML 2017-05-23T11:30:56 24905450 [app] [I] Parameters: {"authenticity_token"=>"...", "id"=>"6-ec2"} 2017-05-23T11:30:56 24905450 [app] [I] Current user: admin (administrator) 2017-05-23T11:30:56 24905450 [app] [D] Setting current user thread-local variable to admin 2017-05-23T11:30:56 24905450 [app] [D] Setting current organization thread-local variable to none 2017-05-23T11:30:56 24905450 [app] [D] Setting current location thread-local variable to none 2017-05-23T11:30:56 24905450 [app] [I] removing EC2: ec2 key foreman-6532cca12-32bf-4841-b323-5d205e563e99 D, [2017-05-23T11:30:56.334010 #14496] DEBUG -- : String does not start with the prefix 'encrypted-', so Foreman::Model::EC2 ec2 was not decrypted 2017-05-23T11:30:56 24905450 [app] [D] String does not start with the prefix 'encrypted-', so Foreman::Model::EC2 ec2 was not decrypted 2017-05-23T11:30:57 24905450 [app] [I] Completed 422 Unprocessable Entity in 1251ms (ActiveRecord: 15.8ms) 2017-05-23T11:30:57 24905450 [app] [F] | ActiveRecord::RecordNotSaved (You cannot call create unless the parent is saved): | app/models/concerns/key_pair_compute_resource.rb:44:in `destroy_key_pair' | app/controllers/compute_resources_controller.rb:69:in `destroy' | app/controllers/concerns/application_shared.rb:15:in `set_timezone' | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller' | /home/vagrant/projects/katello/lib/katello/params_parser_wrapper.rb:12:in `call' | lib/middleware/catch_json_parse_errors.rb:8:in `call' | lib/middleware/tagged_logging.rb:18:in `call'
Actions