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 1639988 - Adding Host parameters is failing with Name has already been taken
Summary: Adding Host parameters is failing with Name has already been taken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.3.4
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: Unspecified
Assignee: Ivan Necas
QA Contact: jcallaha
URL:
Whiteboard:
: 1645727 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-17 05:57 UTC by Simon Reber
Modified: 2022-03-13 15:47 UTC (History)
6 users (show)

Fixed In Version: tfm-rubygem-foreman-tasks-0.9.6.10-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 15:23:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
hotfix against Satellite 6.3.4 (189.82 KB, application/x-rpm)
2018-10-17 08:51 UTC, Ivan Necas
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24493 0 Normal Closed Cannot add host parameters to hosts: Name has already been taken 2020-05-05 13:22:00 UTC
Red Hat Bugzilla 1609764 0 unspecified CLOSED Cannot add host parameters to hosts: Name has already been taken 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 3656801 0 None None None 2018-10-17 06:29:02 UTC
Red Hat Product Errata RHBA-2018:3411 0 None None None 2018-10-30 15:23:17 UTC

Internal Links: 1609764

Description Simon Reber 2018-10-17 05:57:30 UTC
Description of problem:

Starting with Red Hat Satellite 6.3.4 adding Host Parameters to an existing host is failing. Somehow the application logic seems to duplicate the Host Parameter added and then complains that the name is already taken.

Foreman production log looks as following.

2018-10-17 01:35:47 5d37ca92 [app] [I] Started PATCH "/hosts/1" for 10.36.116.118 at 2018-10-17 01:35:47 -0400
2018-10-17 01:35:47 5d37ca92 [app] [I] Processing by HostsController#update as */*
2018-10-17 01:35:47 5d37ca92 [app] [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"<removed>", "host"=>{"name"=>"test001", "hostgroup_id"=>"1", "content_facet_attributes"=>{"lifecycle_environment_id"=>"1", "content_view_id"=>"1", "content_source_id"=>"1"}, "environment_id"=>"1", "puppet_proxy_id"=>"1", "puppet_ca_proxy_id"=>"1", "openscap_proxy_id"=>"", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "mac"=>"00:00:00:00:00:00", "identifier"=>"", "name"=>"test001", "domain_id"=>"1", "ip"=>"", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"1", "execution"=>"1", "tag"=>"", "attached_to"=>"", "id"=>"1"}}, "architecture_id"=>"1", "operatingsystem_id"=>"1", "ptable_id"=>"92", "pxe_loader"=>"PXELinux BIOS", "disk"=>"", "host_parameters_attributes"=>{"1539754531336"=>{"name"=>"FIREWALL", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false"}}, "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "bare_metal_capabilities"=>"build", "id"=>"1"}
2018-10-17 01:35:47 5d37ca92 [app] [I] Current user: admin (administrator)
2018-10-17 01:35:47 5d37ca92 [app] [D] Setting current user thread-local variable to admin
2018-10-17 01:35:47 5d37ca92 [app] [I] Expire fragment views/tabs_and_title_records-3 (0.1ms)
2018-10-17 01:35:47 5d37ca92 [app] [D] Setting current location thread-local variable to none
2018-10-17 01:35:47 5d37ca92 [app] [D] Setting current organization thread-local variable to none
2018-10-17 01:35:47 5d37ca92 [app] [D] Setting current organization thread-local variable to none
2018-10-17 01:35:47 5d37ca92 [app] [D] Setting current location thread-local variable to none
2018-10-17 01:35:47 5d37ca92 [app] [D] Unpermitted parameters: utf8, _method, authenticity_token, bare_metal_capabilities, id, locale
2018-10-17 01:35:47 5d37ca92 [app] [I] Failed to save: Host parameters Please ensure the following parameters name are unique
2018-10-17 01:35:47 5d37ca92 [app] [D] Deface: 1 overrides found for 'hosts/_form'
2018-10-17 01:35:47 5d37ca92 [app] [D] Deface: 'add_execution_interface_js' matched 1 times with 'div#primary'
2018-10-17 01:35:47 5d37ca92 [app] [I] Deface: [WARNING] No :original defined for 'add_execution_interface_js', you should change its definition to include:
 |  :original => '6771be87072b3f2a046d4a6ab34d5432aa443ec6' 

Using `hammer` instead is not possible because of https://bugzilla.redhat.com/show_bug.cgi?id=1554774.

It also seems that this issue was found in Red Hat Satellite 6.4 BETA and was fixed in there https://bugzilla.redhat.com/show_bug.cgi?id=1609764

But since Red Hat Satellite 6.4 was just released we can not expect the customer to update right away and thus require a fix for the issue in Red Hat Satellite 6.3.4

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

 - satellite-6.3.4-2.el7sat.noarch

How reproducible:

 - Always

Steps to Reproduce:
1. Navigate to Hosts > All Hosts > *select* > Edit > Parameters
2. Button Add Parameter
3. Fill any values to Name and Value
4. Submit

Actual results:
All entered Host Parameters are shown twice and there is an error message saying "Name has already been taken" 

Expected results:
Host Parameter is added

Additional info:
This was working on Red Hat Satellite 6.3.3 and is therefore considered a regression

Comment 2 Ivan Necas 2018-10-17 07:53:26 UTC
This issue has been introduced as a regression of https://bugzilla.redhat.com/show_bug.cgi?id=1624020, we're going to backport fix from https://bugzilla.redhat.com/show_bug.cgi?id=1609764 on top of 6.3.4 and propose it for 6.3.5 + build a hotfix for people that would be blocked by this issue in the meantime.

Comment 5 Ivan Necas 2018-10-17 08:51:49 UTC
Created attachment 1494769 [details]
hotfix against Satellite 6.3.4

To apply:

yum install -y tfm-rubygem-foreman-tasks-0.9.6.8-2.HOTFIXRHBZ1639988.fm1_15.el7sat.noarch.rpm 
katello-service restart

Comment 6 Ivan Necas 2018-10-17 08:52:45 UTC
A workaround is to use hammer:

hammer host set-parameter --host host-name.example.com --name param-name --value param-value

Comment 8 jcallaha 2018-10-23 17:35:23 UTC
Verified in Satellite 6.3.5 Snap 1.

Followed the steps outlined in the report and had no issues.
The additional parameter was added successfully.

See attached video for verification.

Comment 11 errata-xmlrpc 2018-10-30 15:23:03 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/RHBA-2018:3411

Comment 12 jalviso 2018-12-19 06:38:12 UTC
*** Bug 1645727 has been marked as a duplicate of this bug. ***


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