Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting hosts with updatable packages does not work #3

Open
bauruine opened this issue Oct 28, 2016 · 1 comment
Open

Deleting hosts with updatable packages does not work #3

bauruine opened this issue Oct 28, 2016 · 1 comment
Labels

Comments

@bauruine
Copy link

If you try to delete a system which has updatable packages it crashes with a PG::ForeignKeyViolation.

Started DELETE "/systems/5" for 10.0.3.1 at 2016-10-28 15:20:05 +0200
Processing by SystemsController#destroy as HTML
  Parameters: {"authenticity_token"=>"Uk1Ypi8sOCKFeI+JQc5l4OM6bMM/RWj3UcnMN7zG7+ZzRsYHb9NcX2q6sZh72va8DbDXqO5UL1LqUyCKRBApeA==", "id"=>"5"}
  User Load (0.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 11]]
  System Load (0.2ms)  SELECT  "systems".* FROM "systems" WHERE "systems"."id" = $1 LIMIT 1  [["id", 5]]
  SystemGroup Load (0.3ms)  SELECT  "system_groups".* FROM "system_groups" WHERE "system_groups"."id" = $1 LIMIT 1  [["id", 9]]
  Role Load (0.2ms)  SELECT  "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1  [["id", 5]]
   (0.1ms)  BEGIN
  SQL (1.7ms)  DELETE FROM "systems" WHERE "systems"."id" = $1  [["id", 5]]
PG::ForeignKeyViolation: ERROR:  update or delete on table "systems" violates foreign key constraint "fk_rails_0e3a405992" on table "concrete_package_versions"
DETAIL:  Key (id)=(5) is still referenced from table "concrete_package_versions".
: DELETE FROM "systems" WHERE "systems"."id" = $1
   (0.1ms)  ROLLBACK
Completed 500 Internal Server Error in 13ms (ActiveRecord: 2.8ms)

ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR:  update or delete on table "systems" violates foreign key constraint "fk_rails_0e3a405992" on table "concrete_package_versions"
DETAIL:  Key (id)=(5) is still referenced from table "concrete_package_versions".
: DELETE FROM "systems" WHERE "systems"."id" = $1):
  app/controllers/systems_controller.rb:56:in `destroy'


  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (6.9ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.9ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (27.1ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_markup.html.erb (0.4ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.3ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.3ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.3ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript (20.0ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript (0.4ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb (44.2ms)

@uelibo uelibo added the bug label Oct 31, 2016
@pikooh
Copy link
Contributor

pikooh commented Nov 23, 2016

Yeah, have to propagate the deletion, not sure if I'll get around to it in the next couple of days. Thanks for creating the issue though! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants