Project

General

Profile

Actions

Bug #5616

closed

Delete of Host fails when Reports are present

Added by Martin Ducar over 10 years ago. Updated over 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

Also available in: Atom PDF