Project

General

Profile

Actions

Bug #32277

closed

Seed fails with PG::ForeignKeyViolation: ERROR: insert or update on table "foreman_tasks_tasks" violates foreign key constraint "fk_rails_a56904dd86"

Added by Justin Sherrill about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

ESC[32m2021-04-06T21:12:34ESC[0m [ESC[32mIESC[0m|ESC[36mdynESC[0m|] Backtrace for 'Error on on_execution_plan_save event' error (ActiveRecord::InvalidForeignKey): PG::ForeignKeyViolation: ERROR:  insert or update on table "foreman_tasks_tasks" violates foreign key constraint "fk_rails_a56904dd86" 
 | DETAIL:  Key (user_id)=(3) is not present in table "users".
 | 

You might also see:

ESC[32m2021-04-06T21:12:34ESC[0m [ESC[33mWESC[0m|ESC[36mdynESC[0m|] Error on on_execution_plan_save event
ESC[32m2021-04-06T21:12:34ESC[0m [ESC[32mIESC[0m|ESC[36mdynESC[0m|] Backtrace for 'Error on on_execution_plan_save event' error (NoMethodError): undefined method `update_from_dynflow' for nil:NilClass
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/foreman-tasks-4.0.0/lib/foreman_tasks/dynflow/persistence.rb:36:in `on_execution_plan_save'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/foreman-tasks-4.0.0/lib/foreman_tasks/dynflow/persistence.rb:11:in `block in save_execution_plan'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/foreman-tasks-4.0.0/lib/foreman_tasks/dynflow/persistence.rb:10:in `tap'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/foreman-tasks-4.0.0/lib/foreman_tasks/dynflow/persistence.rb:10:in `save_execution_plan'

or even:

ESC[32m2021-04-06T21:12:34ESC[0m [ESC[31mEESC[0m|ESC[36mbacESC[0m|] PG::ForeignKeyViolation: ERROR:  insert or update on table "katello_environments" violates foreign key constraint "katello_environments_organization_fk" 
 | DETAIL:  Key (organization_id)=(1) is not present in table "taxonomies".
 |  (ActiveRecord::InvalidForeignKey)
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `exec_params'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.6/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.6/lib/active_record/

Related issues 2 (0 open2 closed)

Related to Foreman - Bug #32086: db seed triggered by sidekiq resulting in duplicate provisioning-templatesClosedActions
Related to Katello - Bug #33952: Creating Organization produces two Audit logsClosedOndřej EzrActions
Actions #1

Updated by Justin Sherrill about 3 years ago

  • Target version set to Katello 4.1.0
Actions #2

Updated by Justin Sherrill about 3 years ago

  • Related to Bug #32086: db seed triggered by sidekiq resulting in duplicate provisioning-templates added
Actions #3

Updated by The Foreman Bot about 3 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Jonathon Turel
  • Pull request https://github.com/Katello/katello/pull/9270 added
Actions #4

Updated by Chris Roberts about 3 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by The Foreman Bot about 3 years ago

  • Fixed in Releases Katello 4.2.0 added
Actions #6

Updated by Jonathon Turel about 3 years ago

  • Status changed from Ready For Testing to Closed
Actions #7

Updated by Ondřej Ezr over 2 years ago

  • Related to Bug #33952: Creating Organization produces two Audit logs added
Actions

Also available in: Atom PDF