Actions
Bug #21168
closedCan't create a location
Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
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.
Updated by Adam Ruzicka over 7 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'
Updated by Adam Ruzicka over 7 years ago
- Related to Bug #20427: REX doesnt start with rails 5 added
Updated by Ivan Necas over 7 years ago
- Related to Bug #11805: error creating organization in assign_default_templates added
Updated by Ivan Necas over 7 years ago
- Blocked by Bug #11825: Adding template types from plugins doesn't work with taxonomies added
Updated by The Foreman Bot over 7 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
Updated by Ivan Necas over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_plugin|806f03af1a67c85990404e00e6f4250868bc372b.
Updated by The Foreman Bot about 7 years ago
- Pull request https://github.com/theforeman/foreman_remote_execution/pull/284 added
Updated by Ivan Necas about 7 years ago
- Translation missing: en.field_release set to 321
Actions