Project

General

Profile

Actions

Bug #3468

closed

host deletion fails when token exists

Added by Martin Bacovsky over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Host creation
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

This has happened when I tried to destroy the host


x ERROR: update or delete on table "hosts" violates foreign key constraint "tokens_host_id_fk" on table "tokens" DETAIL: Key (id)=(63) is still referenced from table "tokens".

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
PG::Error
ERROR: update or delete on table "hosts" violates foreign key constraint "tokens_host_id_fk" on table "tokens" DETAIL: Key (id)=(63) is still referenced from table "tokens".
app/controllers/hosts_controller.rb:120:in `destroy'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #3379: It's not possible to destroy hosts that have entries in the tokens tableRejectedSam Kottler10/21/2013Actions
Actions #1

Updated by Dominic Cleal over 10 years ago

Heh, #3379 too, but I couldn't reproduce it. Maybe I didn't have foreign keys working properly?

Actions #2

Updated by Dominic Cleal over 10 years ago

  • Related to Bug #3379: It's not possible to destroy hosts that have entries in the tokens table added
Actions #3

Updated by Martin Bacovsky over 10 years ago

  • Description updated (diff)

I fixed the misleading information in the description

I cen reproduce it when I set token expiration to 1 min and try to delete the host after that time.

Actions #4

Updated by Martin Bacovsky over 10 years ago

To workaround this issue just cancel the build before deletion

Actions #5

Updated by Greg Sutcliffe over 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Greg Sutcliffe
  • Target version set to 1.10.0
Actions #6

Updated by Dominic Cleal over 10 years ago

  • Status changed from Assigned to Ready For Testing
  • translation missing: en.field_release set to 3
Actions #7

Updated by Greg Sutcliffe over 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF