Bug 983994 - Ugly error when creating org with initial env of "Library"
Ugly error when creating org with initial env of "Library"
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
Nightly
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: David Davis
Kedar Bidarkar
: Regression, Triaged
: 1017629 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-12 09:36 EDT by Jeff Weiss
Modified: 2014-11-09 17:52 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-24 13:10:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
initial env library disallowed now (65.23 KB, image/png)
2013-10-21 09:13 EDT, Kedar Bidarkar
no flags Details

  None (edit)
Description Jeff Weiss 2013-07-12 09:36:34 EDT
Description of problem:


Version-Release number of selected component (if applicable):
1.4.2-1.git.837.d2ca1b8.el6

How reproducible:


Steps to Reproduce:
1. Create org with initial env "Library"
2.
3.

Actual results:
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) 

Expected results:
Something about name already taken or "Library is not a valid environment name".

Additional info:
Comment 1 RHEL Product and Program Management 2013-09-17 00:23:06 EDT
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.
Comment 5 Mike McCune 2013-10-10 00:36:51 EDT
Can't reproduce this.  ON_QA
Comment 6 David Davis 2013-10-10 10:34:26 EDT
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:

https://github.com/Katello/katello/pull/3156
Comment 7 Mike McCune 2013-10-10 12:18:20 EDT
*** Bug 1017629 has been marked as a duplicate of this bug. ***
Comment 8 David Davis 2013-10-14 12:49:43 EDT
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.
Comment 11 Kedar Bidarkar 2013-10-21 09:13:28 EDT
Created attachment 814597 [details]
initial env library disallowed now

We now do get a notification saying "Library" is a built-in env
Comment 12 Bryan Kearney 2014-04-24 13:10:21 EDT
This was verified and delivered with MDP2. Closing it out.
Comment 13 Bryan Kearney 2014-04-24 13:11:39 EDT
This was delivered and verified with MDP2. Closing the bug.

Note You need to log in before you can comment on or make changes to this bug.