Project

General

Profile

Actions

Bug #3379

closed

It's not possible to destroy hosts that have entries in the tokens table

Added by Sam Kottler almost 11 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Sam Kottler
Category:
Unattended installations
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When you create a new host and provisioning is enabled, it's not possible to delete it (at least with postgresql) until the callback during preseed/kickstart has hit the endpoint to notify foreman that the build is done and the token is deleted.

foreman_dev=# delete from hosts where id=3;
ERROR:  update or delete on table "hosts" violates foreign key constraint "tokens_host_id_fk" on table "tokens" 
DETAIL:  Key (id)=(3) is still referenced from table "tokens".
foreman_dev=# select id from tokens;
 id 
----
  3
(1 row)

foreman_dev=# delete from tokens where id=3;
DELETE 1
foreman_dev=# delete from hosts where id=3;
DELETE 1

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #3468: host deletion fails when token existsClosedGreg Sutcliffe10/22/2013Actions
Actions

Also available in: Atom PDF