Project

General

Profile

Actions

Bug #21168

closed

Can't create a location

Added by Ori Rabin over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Fixed in Releases:
Found in Releases:

Description

Trying to create a location silently fails, the server log only shows: "Failed to save: "
In the taxonomy controller using save! instead of save gives: ActiveRecord::RecordInvalid: Validation failed: Taxonomy has already been taken.

The sql logs show this insert right before rollback:

2017-10-02T16:41:58 471cb7ee [sql] [D]   SQL (0.6ms)  INSERT INTO "taxable_taxonomies" ("taxonomy_id", "taxable_id", "taxable_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["taxonomy_id", 23], ["taxable_id", 104], ["taxable_type", "JobTemplate"], ["created_at", "2017-10-02 13:41:58.701252"], ["updated_at", "2017-10-02 13:41:58.701252"]]
2017-10-02T16:41:58 471cb7ee [sql] [D]   TaxableTaxonomy Exists (0.9ms)  SELECT  1 AS one FROM "taxable_taxonomies" WHERE "taxable_taxonomies"."taxonomy_id" = $1 AND "taxable_taxonomies"."taxable_id" = $2 AND "taxable_taxonomies"."taxable_type" = $3 LIMIT $4  [["taxonomy_id", 23], ["taxable_id", 100], ["taxable_type", "JobTemplate"], ["LIMIT", 1]]
2017-10-02T16:41:59 471cb7ee [sql] [D]    (0.4ms)  ROLLBACK

After deleting all of the job templates (including the seeded ones) the location can be saved.


Related issues 3 (0 open3 closed)

Related to Foreman Remote Execution - Bug #20427: REX doesnt start with rails 5ClosedAdam Ruzicka07/27/2017Actions
Related to Foreman Remote Execution - Bug #11805: error creating organization in assign_default_templatesClosed09/14/2015Actions
Blocked by Foreman - Bug #11825: Adding template types from plugins doesn't work with taxonomiesClosedIvan Necas09/15/2015Actions
Actions #1

Updated by Adam Ruzicka over 6 years ago

While trying to reproduce this I encountered a possibly related error

pry(main)> loc.save!
ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR:  insert or update on table "taxable_taxonomies" violates foreign key constraint "taxable_taxonomies_taxonomy_id_fk" 
DETAIL:  Key (taxonomy_id)=(5) is not present in table "taxonomies".
: INSERT INTO "taxable_taxonomies" ("taxonomy_id", "taxable_id", "taxable_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" 
from /home/aruzicka/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.6/lib/active_record/connection_adapters/postgresql_adapter.rb:598:in `async_exec'

Actions #2

Updated by Ivan Necas over 6 years ago

  • Priority changed from Normal to High
Actions #3

Updated by Adam Ruzicka over 6 years ago

  • Related to Bug #20427: REX doesnt start with rails 5 added
Actions #4

Updated by Ivan Necas over 6 years ago

  • Related to Bug #11805: error creating organization in assign_default_templates added
Actions #5

Updated by Ivan Necas over 6 years ago

  • Blocked by Bug #11825: Adding template types from plugins doesn't work with taxonomies added
Actions #6

Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ivan Necas
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/277 added
Actions #7

Updated by Ivan Necas over 6 years ago

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

Updated by The Foreman Bot over 6 years ago

  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/284 added
Actions #9

Updated by Ivan Necas over 6 years ago

  • translation missing: en.field_release set to 321
Actions

Also available in: Atom PDF