Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1268012 - Unable to delete Default Location from Satellite 6.1
Summary: Unable to delete Default Location from Satellite 6.1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Organizations and Locations
Version: 6.1.1
Hardware: All
OS: All
medium
medium
Target Milestone: Unspecified
Assignee: Daniel Lobato Garcia
QA Contact: Tomer Brisker
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1281220 (view as bug list)
Depends On: 1302515
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-01 14:49 UTC by Nagoor Shaik
Modified: 2021-06-10 11:00 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:41:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18226 0 Normal Closed Unable to delete Default Location from katello 2020-11-27 19:04:10 UTC
Red Hat Knowledge Base (Solution) 2884471 0 None None None 2017-01-23 08:38:25 UTC

Description Nagoor Shaik 2015-10-01 14:49:18 UTC
Description of problem:
It is impossible to delete an unused "Default Location" from Satellite 6.1 either through webUI or hammer CLI

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Install fresh Satellite 6.1 without specifying --foreman-initial-location and --foreman-initial-organization parameters, which would create a Default Organization and Default Location
2. Create a new Organization and Location of choice in Satellite webUI
3. Try to delete the old "Default Location" which fails with error "Cannot delete the default Location" 

Same result from the hammer CLI as well
hammer> location list
[Foreman] Username: admin
[Foreman] Password for admin: 
---|-----------------
ID | NAME            
---|-----------------
2  | Default Location
4  | ACME_Corp             
---|-----------------
hammer> location delete --id 2
Could not delete the location:
  Cannot delete the default Location

Actual results:
Cannot delete the default location 

Expected results:
Satellite should allow delete unused locations 

Additional info:

# foreman-rake console
Loading production environment (Rails 3.2.8)     
irb(main):001:0> Location.all
2015-10-01 20:15:03 [D]   Location Load (0.7ms)  SELECT "taxonomies".* FROM "taxonomies" WHERE "taxonomies"."type" IN ('Location') ORDER BY title
=> [#<Location id: 2, name: "Default Location", type: "Location", created_at: "2015-08-31 15:13:09", updated_at: "2015-08-31 15:13:09", ignore_types: ["ConfigTemplate", "Hostgroup"], description: nil, label: nil, apply_info_task_id: nil, ancestry: nil, title: "Default Location", katello_default: true>, #<Location id: 4, name: "ACME_Corp", type: "Location", created_at: "2015-09-02 12:13:08", updated_at: "2015-09-21 16:25:28", ignore_types: ["ConfigTemplate", "Hostgroup"], description: "", label: nil, apply_info_task_id: nil, ancestry: nil, title: "ACME_Corp", katello_default: false>]

As from the above rake output if the "katello_default: true" parameter is set for the location, Satellite 6 would not allow to delete it.

Comment 3 Brad Buckingham 2015-11-16 19:03:36 UTC
*** Bug 1281220 has been marked as a duplicate of this bug. ***

Comment 4 David O'Brien 2016-04-18 00:47:31 UTC
Reset docs contact <> daobrien

Comment 6 Tomas Strachota 2016-08-12 11:15:16 UTC
Unassigning myself since I'm not actively working on the bug.

Comment 8 Pavel Moravec 2017-01-23 08:38:25 UTC
Please specify if below procedure in manually changing default location is safe and can be offered to customers as a workaround:

https://access.redhat.com/solutions/2884471

(basically: stop all services to prevent concurrent issues, start psql, manually change katello_default, start everything)

Thanks.

Comment 9 Daniel Lobato Garcia 2017-01-24 20:02:59 UTC
Created redmine issue http://projects.theforeman.org/issues/18226 from this bug

Comment 10 Daniel Lobato Garcia 2017-01-24 20:17:41 UTC
Pavel, 

From what I gathered by talking to the devs who wrote the feature that keeps the user from removing the default location, it's a bad idea. 

The reason is that the Default Location is used to have a place to put registered hosts via subscription manager, and puppet environments for a content view publish. Without it, those operations will fail.

I am working on a patch that allows the user to set the default location for each of these things in Administer > Settings, which would let you remove the default one provided after the install.

Comment 11 Satellite Program 2017-01-25 17:09:22 UTC
Upstream bug assigned to dlobatog

Comment 12 Satellite Program 2017-01-25 17:09:27 UTC
Upstream bug assigned to dlobatog

Comment 13 Satellite Program 2017-02-14 21:09:48 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18226 has been resolved.

Comment 14 Tomer Brisker 2017-08-02 12:48:19 UTC
Verified on Satellite 6.3.0 snap 9.
Locations set in "Default Location Puppet content" or "Default Location subscribed hosts" settings can not be deleted. Changing both these settings to a location other then the Default Location allows deletion of the default location.

Comment 15 Bryan Kearney 2018-02-21 16:39:26 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336

Comment 16 Bryan Kearney 2018-02-21 16:41:09 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336

Comment 17 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336


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