SatelliteQE / robottelo

Robottelo is a test suite that exercises The Foreman.
GNU General Public License v3.0
61 stars 112 forks source link

test_create_libvirt_without_mac fails with 'undefined method `name' for nil:NilClass' #2865

Closed omaciel closed 8 years ago

omaciel commented 8 years ago

Our automation shows that the test_create_libvirt_without_mac fails with an error. At this point I am not yet sure whether this is an issue with Robottelo or Foreman yet.

# LANG=en_US.UTF-8  hammer -d -v -u admin -p changeme --output=csv host create --medium-id="26" --root-pass='foobarbaz' --organization-id="318" --interface="type=network" --location-id="319" --architecture-id="37" --operatingsystem-id="24" --name="otozxlcowtdkrlmekcuqlvlfioo" --environment-id="231" --compute-resource-id="89" --domain-id="38" --puppet-proxy-id="1" --partition-table-id="44"
[ INFO 2015-10-02 17:23:37 Init] Initialization of Hammer CLI (0.1.4.12) has started...
[DEBUG 2015-10-02 17:23:37 Init] Running at ruby 2.0.0-p598
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2015-10-02 17:23:37 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2015-10-02 17:23:38 Connection] Registered: foreman
[DEBUG 2015-10-02 17:23:38 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2015-10-02 17:23:38 Modules] Extension module hammer_cli_foreman (0.1.4.14) loaded
[ INFO 2015-10-02 17:23:38 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.2.7) loaded
[ INFO 2015-10-02 17:23:38 Modules] Extension module hammer_cli_foreman_discovery (0.0.1.10) loaded
[ INFO 2015-10-02 17:23:38 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2015-10-02 17:23:38 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2015-10-02 17:23:38 Modules] Extension module hammer_cli_gutterball (0.0.1.3) loaded
[ INFO 2015-10-02 17:23:38 Modules] Extension module hammer_cli_import (0.10.20) loaded
[ INFO 2015-10-02 17:23:38 Modules] Extension module hammer_cli_katello (0.0.7.17) loaded
[DEBUG 2015-10-02 17:23:38 Init] Using locale 'en'
[DEBUG 2015-10-02 17:23:38 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.4.12/locale'
[DEBUG 2015-10-02 17:23:38 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2015-10-02 17:23:38 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.4.14/locale'
[DEBUG 2015-10-02 17:23:38 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[DEBUG 2015-10-02 17:23:38 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.3.9/locale'
[DEBUG 2015-10-02 17:23:38 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.7.17/locale'
[ INFO 2015-10-02 17:23:38 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***", "option_output"=>"csv"}
[ INFO 2015-10-02 17:23:38 HammerCLIForeman::Host] Called with options: {}
[ INFO 2015-10-02 17:23:38 HammerCLIForeman::Host::CreateCommand] Called with options: {"option_managed"=>true, "option_build"=>true, "option_enabled"=>true, "option_volume_list"=>[], "option_interface_list"=>[{"type"=>"network"}], "option_location_id"=>"319", "option_organization_id"=>"318", "option_environment_id"=>"231", "option_architecture_id"=>"37", "option_domain_id"=>"38", "option_operatingsystem_id"=>"24", "option_medium_id"=>"26", "option_ptable_id"=>"44", "option_compute_resource_id"=>"89", "option_name"=>"otozxlcowtdkrlmekcuqlvlfioo", "option_puppet_proxy_id"=>"1", "option_root_pass"=>"foobarbaz"}
[ INFO 2015-10-02 17:23:39 API] POST /api/hosts
[DEBUG 2015-10-02 17:23:39 API] Params: {
    "host" => {
                              "name" => "otozxlcowtdkrlmekcuqlvlfioo",
                       "location_id" => "319",
                   "organization_id" => "318",
                    "environment_id" => "231",
                   "architecture_id" => "37",
                         "domain_id" => "38",
                   "puppet_proxy_id" => "1",
                "operatingsystem_id" => "24",
                         "medium_id" => "26",
                         "ptable_id" => "44",
               "compute_resource_id" => "89",
                         "root_pass" => "foobarbaz",
                             "build" => true,
                           "enabled" => true,
                           "managed" => true,
                "compute_attributes" => {
               "volumes_attributes" => {},
            "interfaces_attributes" => {
                "0" => {
                    "type" => "network"
                }
            },
                  "nics_attributes" => {
                "0" => {
                    "type" => "network"
                }
            }
        },
                          "owner_id" => nil,
                "puppet_ca_proxy_id" => nil,
                   "puppetclass_ids" => nil,
        "host_parameters_attributes" => {}
    }
}
[DEBUG 2015-10-02 17:23:39 API] Headers: {}
[DEBUG 2015-10-02 17:23:39 API] 422 Unprocessable Entity
{
    "error" => {
                   "id" => nil,
               "errors" => {
            "base" => [
                [0] "Failed to create a compute foobarbaz (Libvirt) instance otozxlcowtdkrlmekcuqlvlfioo.lhykeuwdqp: undefined method `name' for nil:NilClass\n "
            ]
        },
        "full_messages" => [
            [0] "Failed to create a compute foobarbaz (Libvirt) instance otozxlcowtdkrlmekcuqlvlfioo.lhykeuwdqp: undefined method `name' for nil:NilClass\n "
        ]
    }
}
[ERROR 2015-10-02 17:23:39 Exception] Failed to create a compute foobarbaz (Libvirt) instance otozxlcowtdkrlmekcuqlvlfioo.lhykeuwdqp: undefined method `name' for nil:NilClass

Could not create the host:
  Failed to create a compute foobarbaz (Libvirt) instance otozxlcowtdkrlmekcuqlvlfioo.lhykeuwdqp: undefined method `name' for nil:NilClass
omaciel commented 8 years ago

@sghai mind taking a peek?

sghai commented 8 years ago

@omaciel : Sure..looking now..

sghai commented 8 years ago

for me this test is working fine on our automation box

@Test: Create a libvirt host and not specify a MAC address. ... ok

----------------------------------------------------------------------
Ran 1 test in 46.819s

OK
sghai commented 8 years ago

I ran the same test on my local setup installed with 6.1.3 compose2 and it ran successfully.

omaciel commented 8 years ago

@sghai can we try this together today?

sghai commented 8 years ago

yeah.. sure @omaciel

elyezer commented 8 years ago

2884 will address the robottelo side failure when trying to format a stderr with unicode character, which is very common on robottelo random data.

This failure is visible on jenkins.

omaciel commented 8 years ago

@elyezer @sghai this is still failing for us.

sghai commented 8 years ago

@omaciel : I reproduced this issue on our auto box.

[root@qe-sat6-xxxxx ~]#  hammer -v -u admin -p changeme --output=csv host create --medium-id="30" --root-pass="redhat123" --organization-id="649" --interface="type=network, network=foreman" --location-id="650" --architecture-id="31" --operatingsystem-id="28" --name="ubwrlu" --environment-id="168" --compute-resource-id="38" --domain-id="44" --puppet-proxy-id="1" --partition-table-id="53"
[ERROR 2015-10-19 07:45:18 Exception] Failed to create a compute 穒砏麅哦簬捰昛阑 (Libvirt) instance ubwrlu.5vxswr4si9: undefined method `name' for nil:NilClass

Could not create the host:
  Failed to create a compute 穒砏麅哦簬捰昛阑 (Libvirt) instance ubwrlu.5vxswr4si9: undefined method `name' for nil:NilClass

but its hard to debug on automation box due to:

Next step is to reproduce it on fresh setup. In any case, this test case needs to be updated..

omaciel commented 8 years ago

@sghai agreed. This test is outdated or no longer valid.

elyezer commented 8 years ago

@sghai need any help on fixing this?