Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1620601

Summary: hammer host update --enabled presents undefined method error
Product: Red Hat Satellite Reporter: Marc Sheermohamed <msheermo>
Component: HostsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: tstrych
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.2CC: apatel, dhlavacd, inecas, kgaikwad, mbacovsk, mhulan, msheermo, mshira, rabajaj, shisingh
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-02 12:33:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
production.log none

Description Marc Sheermohamed 2018-08-23 09:52:45 UTC
Description of problem:

Updating a newly provisioned host with either the API or by invoking `hammer host update --enabled true --id <id_number>` will present an error.


Could not update the host:

  Failed to update a compute vcs002 (VMware) instance rws-itvl-jpo003.workload.rws.local: undefined method `[]' for nil:NilClass


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

How reproducible:
Try to set enable flag either with hammer or by API

Steps to Reproduce:
1. hammer host update --enabled true --id <id_number>
2.
3.

Actual results:
  Failed to update a compute vcs002 (VMware) instance rws-itvl-jpo003.workload.rws.local: undefined method `[]' for nil:NilClass


Expected results:
Enabled instance.

Additional info:

debug output of hammer command

 hammer -dd host update --enabled true --id 1861

[ INFO 2018-08-23 11:34:08 Init] Initialization of Hammer CLI (0.11.0.1) has started...

[DEBUG 2018-08-23 11:34:08 Init] Running at ruby 2.3.6-p384

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_openscap.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_virt_who_configure.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /root/.hammer/cli_config.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /root/.hammer/defaults.yml has been loaded

[ INFO 2018-08-23 11:34:08 Init] Configuration from the file /root/.hammer/cli.modules.d/foreman.yml has been loaded

[DEBUG 2018-08-23 11:34:09 SSLoptions] SSL options: {

    :ssl_ca_file => "/etc/pki/katello/certs/katello-server-ca.crt",

     :verify_ssl => true

}

[DEBUG 2018-08-23 11:34:09 API] Global headers: {

        :content_type => "application/json",

              :accept => "application/json;version=2",

    "Accept-Language" => "en"

}

[DEBUG 2018-08-23 11:34:09 API] Follow redirects: never

[DEBUG 2018-08-23 11:34:09 Connection] Registered: foreman

[ INFO 2018-08-23 11:34:09 Modules] Extension module hammer_cli_foreman (0.11.0.6) loaded

[ INFO 2018-08-23 11:34:09 Modules] Extension module hammer_cli_foreman_admin (0.0.8) loaded

[ INFO 2018-08-23 11:34:09 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded

[ INFO 2018-08-23 11:34:09 Modules] Extension module hammer_cli_foreman_discovery (1.0.0) loaded

[ INFO 2018-08-23 11:34:09 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.

[ INFO 2018-08-23 11:34:09 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.

[ INFO 2018-08-23 11:34:09 Modules] Extension module hammer_cli_katello (0.11.3.5) loaded

[DEBUG 2018-08-23 11:34:09 Init] Using locale 'en'

[DEBUG 2018-08-23 11:34:09 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/locale'

[DEBUG 2018-08-23 11:34:09 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.11.0.6/locale'

[DEBUG 2018-08-23 11:34:09 Init] 'mo' files for locale domain 'hammer-cli-csv' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_csv-2.3.1/locale'

[DEBUG 2018-08-23 11:34:09 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.6/locale'

[DEBUG 2018-08-23 11:34:09 Init] 'mo' files for locale domain 'hammer-cli-foreman-virt-who-configure' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_virt_who_configure-0.0.3/locale'

[DEBUG 2018-08-23 11:34:09 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.11.3.5/locale'

[ INFO 2018-08-23 11:34:09 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}

[ INFO 2018-08-23 11:34:09 HammerCLIForeman::Host] Called with options: {}

[ INFO 2018-08-23 11:34:09 HammerCLIForeman::Host::UpdateCommand] Custom default value 1 was used for attribute --organization-id

[ INFO 2018-08-23 11:34:09 HammerCLIForeman::Host::UpdateCommand] Called with options: {"option_enabled"=>true, "option_volume_list"=>[], "option_interface_list"=>[], "option_organization_id"=>"1", "option_id"=>"1861"}

[ INFO 2018-08-23 11:34:09 API] Server: https://nwr-ipvl-sat006.mgm.rws.local/

[ INFO 2018-08-23 11:34:09 API] PUT /api/hosts/1861

[DEBUG 2018-08-23 11:34:09 API] Params: {

    "host" => {

                      "organization_id" => "1",

                              "enabled" => true,

                   "compute_attributes" => {

            "volumes_attributes" => {}

        },

             "content_facet_attributes" => {},

        "subscription_facet_attributes" => {},

           "host_parameters_attributes" => [],

                "interfaces_attributes" => []

    }

}

[DEBUG 2018-08-23 11:34:09 API] Headers: {}

[DEBUG 2018-08-23 11:34:09 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth

[ERROR 2018-08-23 11:34:10 API] 422 Unprocessable Entity

[DEBUG 2018-08-23 11:34:10 API] {

    "error" => {

                   "id" => 1861,

               "errors" => {

            "base" => [

                [0] "Failed to update a compute vcs002 (VMware) instance rws-itvl-jpo003.workload.rws.local: undefined method `[]' for nil:NilClass"

            ]

        },

        "full_messages" => [

            [0] "Failed to update a compute vcs002 (VMware) instance rws-itvl-jpo003.workload.rws.local: undefined method `[]' for nil:NilClass"

        ]

    }

}

[DEBUG 2018-08-23 11:34:10 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_unprocessable_entity

[ERROR 2018-08-23 11:34:10 Exception] Failed to update a compute vcs002 (VMware) instance rws-itvl-jpo003.workload.rws.local: undefined method `[]' for nil:NilClass

Could not update the host:

  Failed to update a compute vcs002 (VMware) instance rws-itvl-jpo003.workload.rws.local: undefined method `[]' for nil:NilClass

Comment 1 Amit Karsale 2018-08-23 10:12:15 UTC
Is this failure Compute Resource specific(VMWare) or generic failure. I've tried with LibVirt and the host update was successful. 

Also could you add the `production.log` file for more analysis.

Comment 2 Marc Sheermohamed 2018-08-23 10:20:12 UTC
Sorry, forgot to mention: VMware specific.
Production log attached.

Comment 3 Marc Sheermohamed 2018-08-23 10:20:50 UTC
Created attachment 1478125 [details]
production.log

Comment 4 Marc Sheermohamed 2018-08-23 13:42:54 UTC
Some more information that might be useful:

- Satellite server was upgraded from 6.2.15 to 6.3.2 without installation issues.
- After upgrade we are seeing this error related to the Compute Profile.
- Creation of new profile is a workaround (no issue on newly created profile).
- Editing the existing Compute Profile (adding a comment so it can be saved as new) and saving it does not fix the issue.

Comment 8 Marek Hulan 2018-08-24 20:21:03 UTC
This looks very similar to BZ 1551014, might be interesting to compare full production.log of both.

Comment 9 Bryan Kearney 2020-03-04 14:08:30 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 10 Bryan Kearney 2020-04-02 12:33:43 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.