Red Hat Bugzilla – Bug 983994
Ugly error when creating org with initial env of "Library"
Last modified: 2014-11-09 17:52:55 EST
Description of problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create org with initial env "Library"
ERROR: update or delete on table "organizations" violates foreign key constraint "environments_organization_id_fk" on table "environments" DETAIL: Key (id)=(44) is still referenced from table "environments". (PGError)
Something about name already taken or "Library is not a valid environment name".
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.
Can't reproduce this. ON_QA
I was able to reproduce. I get this error:
[FATAL 2013-10-10 10:33:45 app]
| PG::ForeignKeyViolation (ERROR: update or delete on table "organizations" violates foreign key constraint "environments_organization_id_fk" on table "environments"
| DETAIL: Key (id)=(27) is still referenced from table "environments".
| app/models/glue.rb:93:in `destroy'
| app/controllers/organizations_controller.rb:130:in `ensure in create'
| app/controllers/organizations_controller.rb:130:in `create'
| app/lib/util/thread_session.rb:110:in `thread_locals'
| config/initializers/quiet_paths.rb:11:in `call_with_quiet'
| lib/katello/middleware/log_request_uuid.rb:22:in `call'
| app/controllers/organizations_controller.rb:108:in `create'
I've opened a PR to address this:
*** Bug 1017629 has been marked as a duplicate of this bug. ***
katello SHA 6e204be06eb836faf2b59139ec09b8847b842b59
983994: Fixing organization create with bad environment
Bug where organization was not getting deleted due to the library not being
deletable. The library is only deletable if the org is being destroyed (and has
a deletion task), therefore this was trigging a foreign key error.
Created attachment 814597 [details]
initial env library disallowed now
We now do get a notification saying "Library" is a built-in env
This was verified and delivered with MDP2. Closing it out.
This was delivered and verified with MDP2. Closing the bug.