Project

General

Profile

Bug #32277

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 7 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
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

Related to Foreman - Bug #32086: db seed triggered by sidekiq resulting in duplicate provisioning-templatesClosed

Associated revisions

Revision 4670bc21 (diff)
Added by Jonathon Turel 6 months ago

Fixes #32277 - make org creation idempotent and async from seeding

History

#1 Updated by Justin Sherrill 7 months ago

  • Target version set to Katello 4.1.0

#2 Updated by Justin Sherrill 7 months ago

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

#3 Updated by The Foreman Bot 7 months ago

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

#4 Updated by Chris Roberts 7 months ago

  • Triaged changed from No to Yes

#5 Updated by The Foreman Bot 6 months ago

  • Fixed in Releases Katello 4.2.0 added

#6 Updated by Jonathon Turel 6 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF