Project

General

Profile

Actions

Bug #5616

closed

Delete of Host fails when Reports are present

Added by Martin Ducar almost 10 years ago. Updated almost 10 years ago.

Status:
Duplicate
Priority:
High
Assignee:
-
Category:
Host creation
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi, we are using foreman 1.4.2 with postgresql DB backend. When trying to delete host that has reports present I get this error:

Warning!
ERROR: update or delete on table "hosts" violates foreign key constraint "reports_host_id_fk" on table "reports" DETAIL: Key (id)=(624) is still referenced from table "reports". 
...

PGError
ERROR: update or delete on table "hosts" violates foreign key constraint "reports_host_id_fk" on table "reports" DETAIL: Key (id)=(624) is still referenced from table "reports".
app/controllers/hosts_controller.rb:124:in `destroy'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call' 

This feature was working before when host didn't recieve any report


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Bug #3530: Unable to destroy a host when user have permissions to "destroy_hosts" but no premissions to "destroy_reports".Resolved10/28/2013Actions
Actions #1

Updated by Daniel Lobato Garcia almost 10 years ago

This is a duplicate of http://projects.theforeman.org/issues/3530

This error happens because the user performing the deletion needs to have some role with the permission :destroy_reports, otherwise there would be some reports hanging around in the DB without host.

Actions #2

Updated by Dominic Cleal almost 10 years ago

  • Is duplicate of Bug #3530: Unable to destroy a host when user have permissions to "destroy_hosts" but no premissions to "destroy_reports". added
Actions #3

Updated by Dominic Cleal almost 10 years ago

  • Status changed from New to Duplicate
Actions

Also available in: Atom PDF