Bug 1551014 - Failed to update a compute vmware (VMware) instance host.example.domain: undefined method `[]' for nil:NilClass
Summary: Failed to update a compute vmware (VMware) instance host.example.domain: unde...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.3.0
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: 6.4.0
Assignee: Ondřej Pražák
QA Contact: Sanket Jagtap
URL:
Whiteboard:
: 1596662 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-02 14:52 UTC by Sagar Lutade
Modified: 2022-03-13 14:44 UTC (History)
38 users (show)

Fixed In Version: foreman-1.18.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 18:52:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
hotfix-rpms (11.85 MB, application/x-tar)
2018-08-06 18:25 UTC, Chris Roberts
no flags Details
vmware-patch (2.12 KB, patch)
2018-09-17 16:01 UTC, Chris Roberts
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 19990 0 Normal Closed Failed to update a compute vmware (VMware) instance node.test.domain: undefined method `[]' for nil:NilClass 2020-11-10 14:17:21 UTC
Red Hat Bugzilla 1602289 0 high CLOSED Unable to provision on Vmware, no storage data submitted 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1610684 0 unspecified CLOSED Unable to provision host from CLI Unknown Network ID 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 3457701 0 Troubleshoot None On Red Hat Satellite 6.3, Updating a content host fails with "Failed to update a compute VMWare-Cluster (VMware) instanc... 2019-04-02 06:24:21 UTC
Red Hat Knowledge Base (Solution) 4123971 0 Customize or extend None Changing the location of a vm on VMWare compute resource via hammer fails on Red Hat Satellite 6 if VMWare hot plugin is... 2019-05-15 16:57:35 UTC

Internal Links: 1596662 1602289 1610684

Description Sagar Lutade 2018-03-02 14:52:38 UTC
Description of problem:

If I try to update the environment of a machine in a VMware compute instance we get the mentioned error.

Failed to update a compute vmware_rhel (VMware) instance node.test.domain: undefined method `[]' for nil:NilClass"


How reproducible:

Run the hammer command to update the host.

[root@test ~]# hammer host update --name node.test.domain --lifecycle-environment "test" --content-view "test" --organization "test"


Actual results:

Failed to update a compute vmware_rhel (VMware) instance node.test.domain: undefined method `[]' for nil:NilClass"


Expected results:
The host should be updated with the environment and content view.

Additional info:

The volume attributes are missing and arrises when the host is provisioned from the Satellite server.

"volumes_attributes" => {}

The same works from the Satellite web UI.

Comment 1 Brad Buckingham 2018-03-02 16:04:30 UTC
Hi Sagar,

Can you provide the full stack trace from the production.log?

Thanks!

Comment 3 Sijo Jose 2018-03-04 23:19:16 UTC
I am also facing same issue.
I have tried to update non-VMware host and it worked.


root@satellite ~# hammer --debug host update --id 190 --owner sijo
[ INFO 2018-03-05 10:12:49 Init] Initialization of Hammer CLI (0.11.0.1) has started...
[DEBUG 2018-03-05 10:12:49 Init] Running at ruby 2.3.1-p112
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_openscap.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_virt_who_configure.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /root/.hammer/cli_config.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /root/.hammer/defaults.yml has been loaded
[ INFO 2018-03-05 10:12:49 Init] Configuration from the file /root/.hammer/cli.modules.d/foreman.yml has been loaded
[DEBUG 2018-03-05 10:12:50 SSLoptions] SSL options: {
    :ssl_ca_file => "/etc/pki/katello/certs/katello-server-ca.crt",
     :verify_ssl => true
}
[DEBUG 2018-03-05 10:12:50 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[DEBUG 2018-03-05 10:12:50 API] Follow redirects: never
[DEBUG 2018-03-05 10:12:50 Connection] Registered: foreman
[ INFO 2018-03-05 10:12:50 Modules] Extension module hammer_cli_foreman (0.11.0.5) loaded
[ INFO 2018-03-05 10:12:50 Modules] Extension module hammer_cli_foreman_admin (0.0.8) loaded
[ INFO 2018-03-05 10:12:50 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded
[ INFO 2018-03-05 10:12:50 Modules] Extension module hammer_cli_foreman_discovery (1.0.0) loaded
[ INFO 2018-03-05 10:12:50 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2018-03-05 10:12:50 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2018-03-05 10:12:50 Modules] Extension module hammer_cli_katello (0.11.3.5) loaded
[DEBUG 2018-03-05 10:12:50 Init] Using locale 'en'
[DEBUG 2018-03-05 10:12:50 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-03-05 10:12:50 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.5/locale'
[DEBUG 2018-03-05 10:12:50 Init] 'mo' files for locale domain 'hammer-cli-csv' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_csv-2.3.0/locale'
[DEBUG 2018-03-05 10:12:50 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-03-05 10:12:50 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-03-05 10:12:50 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-03-05 10:12:50 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2018-03-05 10:12:50 HammerCLIForeman::Host] Called with options: {}
[ INFO 2018-03-05 10:12:50 HammerCLIForeman::Host::UpdateCommand] Custom default value 3 was used for attribute --organization-id
[ INFO 2018-03-05 10:12:50 HammerCLIForeman::Host::UpdateCommand] Called with options: {"option_user_login"=>"sijo", "option_volume_list"=>[], "option_interface_list"=>[], "option_organiz      ation_id"=>"3", "option_id"=>"190"}
[ INFO 2018-03-05 10:12:50 API] Server: https://satellite.test.com.au
[ INFO 2018-03-05 10:12:50 API] GET /api/users
[DEBUG 2018-03-05 10:12:50 API] Params: {
    :search => "login = \"sijo\""
}
[DEBUG 2018-03-05 10:12:50 API] Headers: {
    :params => {
        :search => "login = \"sijo\""
    }
}
[DEBUG 2018-03-05 10:12:50 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2018-03-05 10:12:50 API] Response: {
       "total" => 8,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 100,
      "search" => "login = \"sijo\"",
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                       "firstname" => "Sijo",
                        "lastname" => "Jose",
                            "mail" => "sijo.au",
                           "admin" => true,
                  "auth_source_id" => 1,
                "auth_source_name" => "Internal",
                        "timezone" => "Sydney",
                          "locale" => "en_GB",
                   "last_login_on" => "2018-03-04 10:52:58 UTC",
                      "created_at" => "2017-08-22 11:55:12 UTC",
                      "updated_at" => "2018-02-27 00:21:10 UTC",
                              "id" => 42,
                           "login" => "sijo",
                     "description" => "",
                        "ssh_keys" => [],
                "default_location" => {
                         "id" => 2,
                       "name" => "LOCATION",
                      "title" => "LOCATION",
                "description" => ""
            },
                       "locations" => [
                [0] {
                      "id" => 2,
                    "name" => "LOCATION"
                }
            ],
            "default_organization" => {
                         "id" => 3,
                       "name" => "1-test",
                      "title" => "1-test",
                "description" => "test LTD"
            },
                   "organizations" => [
                [0] {
                      "id" => 3,
                    "name" => "1-test"
                }
            ],
                 "effective_admin" => true
        }
    ]
}
[DEBUG 2018-03-05 10:12:50 API] Response headers: {
                                 :date => "Sun, 04 Mar 2018 23:12:50 GMT",
                               :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
                      :foreman_version => "1.15.6.34",
                  :foreman_api_version => "2",
                      :apipie_checksum => "99c16825713d805097aa043b06e4250c",
                        :cache_control => "max-age=0, private, must-revalidate",
                         :x_request_id => "126ba9bd-e829-4a65-a050-1472a66fe19a",
                            :x_runtime => "0.073920",
              :content_security_policy => "default-src 'self'; child-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data: *.gravatar.com; script-src 'unsafe-eval' 'unsafe-inline'       'self'; style-src 'unsafe-inline' 'self'",
            :strict_transport_security => "max-age=631152000; includeSubdomains",
               :x_content_type_options => "nosniff",
                   :x_download_options => "noopen",
                      :x_frame_options => "sameorigin",
    :x_permitted_cross_domain_policies => "none",
                     :x_xss_protection => "1; mode=block",
                         :x_powered_by => "Phusion Passenger 4.0.18",
                           :set_cookie => [
        [0] "_session_id=7627aa41368665c34cb6c45d943243bf; path=/; secure; HttpOnly"
    ],
                                 :etag => "W/\"12274330449be8660a1cff577b7b29d8-gzip\"",
                               :status => "200 OK",
                                 :vary => "Accept-Encoding",
                     :content_encoding => "gzip",
                       :content_length => "437",
                         :content_type => "application/json; charset=utf-8"
}
[ INFO 2018-03-05 10:12:50 API] Server: https://satellite.test.com.au
[ INFO 2018-03-05 10:12:50 API] PUT /api/hosts/190
[DEBUG 2018-03-05 10:12:50 API] Params: {
    "host" => {
                      "organization_id" => "3",
                   "compute_attributes" => {
            "volumes_attributes" => {}
        },
             "content_facet_attributes" => {},
        "subscription_facet_attributes" => {},
                             "owner_id" => 42,
           "host_parameters_attributes" => [],
                "interfaces_attributes" => []
    }
}
[DEBUG 2018-03-05 10:12:50 API] Headers: {}
[DEBUG 2018-03-05 10:12:50 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[ERROR 2018-03-05 10:12:51 API] 422 Unprocessable Entity
[DEBUG 2018-03-05 10:12:51 API] {
    "error" => {
                   "id" => 190,
               "errors" => {
            "base" => [
                [0] "Failed to update a compute rack-1-vc-4.ne4vxr01.test.com.au (VMware) instance clsoet31.test.com.au: undefined method `[]' for nil:NilClass"
            ]
        },
        "full_messages" => [
            [0] "Failed to update a compute rack-1-vc-4.ne4vxr01.test.com.au (VMware) instance clsoet31.test.com.au: undefined method `[]' for nil:NilClass"
        ]
    }
}
[DEBUG 2018-03-05 10:12:51 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_unprocessable_entity
[ERROR 2018-03-05 10:12:51 Exception] Failed to update a compute rack-1-vc-4.ne4vxr01.test.com.au (VMware) instance clsoet31.test.com.au: undefined method `[]' for nil:NilClass
Could not update the host:
  Failed to update a compute rack-1-vc-4.ne4vxr01.test.com.au (VMware) instance clsoet31.test.com.au: undefined method `[]' for nil:NilClass
root@satellite ~#

Comment 4 mhaverkamp 2018-03-07 20:30:18 UTC
I am experiencing the same issue.  I included the output from my /var/log/foreman/production.log below.  This appears to be related to https://projects.theforeman.org/issues/19990.



2018-03-07 13:39:56 766f6118 [app] [W] Failed to update a compute ESXi (VMware) instance machine1.localdomain: undefined method `[]' for nil:NilClass
 | NoMethodError: undefined method `[]' for nil:NilClass
 | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:435:in `block in save_vm'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-core-1.42.0/lib/fog/core/collection.rb:19:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-core-1.42.0/lib/fog/core/collection.rb:19:in `each'
 | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:433:in `save_vm'
 | /usr/share/foreman/app/models/concerns/orchestration/compute.rb:203:in `setComputeUpdate'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:216:in `execute'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:144:in `block in process'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:136:in `each'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:136:in `process'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:44:in `around_save_orchestration'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:432:in `block in make_lambda'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_save_callbacks'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/callbacks.rb:302:in `create_or_update'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/persistence.rb:120:in `save'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/validations.rb:37:in `save'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_methods/dirty.rb:21:in `save'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:286:in `block in save'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:285:in `save'
 | /usr/share/foreman/app/models/concerns/foreman/sti.rb:29:in `save_with_type'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6.4/app/models/foreman_tasks/concerns/action_triggering.rb:25:in `block in save_with_dynflow_task_wrap'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6.4/app/models/foreman_tasks/concerns/action_triggering.rb:119:in `dynflow_task_wrap'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6.4/app/models/foreman_tasks/concerns/action_triggering.rb:25:in `save_with_dynflow_task_wrap'
 | /usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:153:in `update'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:198:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/rendering.rb:10:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:117:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /usr/share/foreman/app/controllers/api/v2/base_controller.rb:152:in `disable_json_root'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:432:in `block in make_lambda'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:432:in `block in make_lambda'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:432:in `block in make_lambda'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:432:in `block in make_lambda'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.4.1/lib/audited/sweeper.rb:14:in `around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:455:in `public_send'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:455:in `block in make_lambda'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/rescue.rb:29:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `block in instrument'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `instrument'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:137:in `process'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionview-4.2.6/lib/action_view/rendering.rb:30:in `process'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal.rb:196:in `dispatch'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal.rb:237:in `block in action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:43:in `serve'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:43:in `block in serve'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:30:in `each'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:30:in `serve'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:817:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/static_dispatcher.rb:65:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/extractor/recorder.rb:136:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/etag.rb:24:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/conditionalget.rb:38:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/head.rb:13:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.58/lib/katello/params_parser_wrapper.rb:12:in `call'
 | /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/flash.rb:260:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:225:in `context'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:220:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/cookies.rb:560:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/query_cache.rb:36:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/rack/logger.rb:38:in `call_app'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/rack/logger.rb:22:in `call'
 | /usr/share/foreman/lib/middleware/tagged_logging.rb:18:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/request_id.rb:21:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/methodoverride.rb:22:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/runtime.rb:18:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/sendfile.rb:113:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-3.4.1/lib/secure_headers/middleware.rb:12:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/engine.rb:518:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/application.rb:165:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `public_send'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `method_missing'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:66:in `block in call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `each'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `call'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
2018-03-07 13:39:56 766f6118 [app] [E] Unprocessable entity Host::Managed (id: 89):
 |   Failed to update a compute ESXi (VMware) instance machine1.localdomain: undefined method `[]' for nil:NilClass
 |

Comment 7 Sijo Jose 2018-04-09 11:44:51 UTC
Any update on this bug.
In our environment, we use hammer script to create the vm and again hammer host update to update the build name and comments. Since hammer host update is failing we had to remove the step from the VM build. This will make our VMs un-owned. Please provide a solution to this.

Comment 11 Tomer Brisker 2018-05-30 14:35:46 UTC
Connecting redmine issue http://projects.theforeman.org/issues/19990 from this bug

Comment 13 Satellite Program 2018-05-31 08:16:06 UTC
Upstream bug assigned to oprazak

Comment 14 Satellite Program 2018-05-31 08:16:11 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/19990 has been resolved.

Comment 20 Sanket Jagtap 2018-08-06 09:34:46 UTC
Build: Satellite 6.4.0 snap 15

1) Create a host on Satellite using CLI and using the Compute profile workaround mentioned https://bugzilla.redhat.com/show_bug.cgi?id=1610684#c4

hammer host info --id 4
Id:                       4
UUID:                     501e1695-94e7-11cb-918a-27105670d6a9
Name:                     test-host-cp1.domain
        Name: rhel7_cv
    Lifecycle Environment: 
        ID:   2
        Name: DEV
    Content Source:        
        ID:   1
        Name: qe-testing-rhel7.domain


2) Updated the host lifecycle environment

hammer -d host update --name "test-host-cp1.domain" --lifecycle-environment "QE" --content-view "rhel7_cv" --organization "Default Organization"

Host was updated successfully 

hammer host info --id 4 |  grep Lifecycle -C 2
        ID:   2
        Name: rhel7_cv
    Lifecycle Environment: 
        ID:   3
        Name: QE

PFA to get debug output

Comment 22 Chris Roberts 2018-08-06 18:25:27 UTC
Created attachment 1473706 [details]
hotfix-rpms

Comment 23 Chris Roberts 2018-08-06 18:26:46 UTC
Confirmed hotfix works:

Host Create:

hammer> host create --name testhost --hostgroup RHEL7_redhat00 --compute-resource-id 1 --compute-profile-id 1 --location-id 2 --organization-id 1 --compute-attributes "start=1" --subnet-id 1

Before patch:

hammer> host update --id 2 --content-view-id 3 --organization-id 1
Could not update the host:
  Failed to update a compute VMware (VMware) instance testhost.satellite.lab.eng.rdu2.redhat.com: undefined method `[]' for nil:NilClass

After patch:

hammer> host update --id 2 --content-view-id 3 --organization-id 1
Host updated

Comment 24 Chris Roberts 2018-08-06 18:30:17 UTC
Steps to Apply HOTFIX, this was created against 6.3.1 so this will not work on 6.3.2

1. Download hotfix-rpms attachment from Bugzilla

2. Untar into a new directory such as /root/hotfix

3. If using SELinux, run restorecon to correct SELinux context on the rpms.

4. # katello-service stop

5. In the directory with all the rpms run # yum localupdate *

6. # katello-service start

Comment 33 Chris Roberts 2018-09-17 16:01:51 UTC
Created attachment 1484096 [details]
vmware-patch

To apply this patch do the following:

Download to /usr/share/foreman/

# patch -p1 < 5577.patch

# katello-service restart

Comment 36 Bryan Kearney 2018-10-16 18:52:33 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:2927

Comment 53 Ondřej Ezr 2019-05-15 16:57:36 UTC
*** Bug 1596662 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.