ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
245 stars 102 forks source link

during vagrant destroy vagrant-hostmanager end up with error #376

Open tstrych opened 5 years ago

tstrych commented 5 years ago

Hi, I am using forklift, where I create VM with openstack provider. vagrant >> forklift >> openstack provider This error occurs on vagrant destroy with all VM.

I am newbie with forklift and also with vagrant openstack provider.

What is fine, the machine is deleted from openstack. But it ends with error, looks like hostmanager wants to update guests and host, but machine is already deleted. It's awkward when you destroy one machine but it is problem if you want destroy all machines you will delete only the first VM.

What is interesting, when I was doing the same thing but without forklift layer, just vagrant >> vagrant openstack provider, everything works well. The reason why I use forklift is you are able to use even libvirt and openstack with the same configuration and also because of the simple configuration of new box.

I am not sure if I should provide this error here, or if the problem is in hostmanager.

Versions I use: vagrant-hostmanager (1.8.9) vagrant-libvirt (0.0.40, system) vagrant-openstack-provider (0.13.0)

Providing log with DEBUG level

==> rhel6-qa: Deleting server...
==> centos7-qa: Waiting for the server to be deleted...
2018-11-16 16:56 | DEBUG | Waiting for instance to be DELETED
2018-11-16 16:56 | DEBUG | block in get_server_details - start
2018-11-16 16:56 | DEBUG | request  => method  : GET
2018-11-16 16:56 | DEBUG | request  => url     *****
2018-11-16 16:56 | DEBUG | response => code    : 200
2018-11-16 16:56 | DEBUG | response => headers :*****
2018-11-16 16:56 | DEBUG | response => body   :*****
2018-11-16 16:56 | DEBUG | block in get_server_details - end
2018-11-16 16:56 | DEBUG | Waiting for instance to be DELETED
2018-11-16 16:56 | DEBUG | block in get_server_details - start
2018-11-16 16:56 | DEBUG | request  => method  : GET
2018-11-16 16:56 | DEBUG | request  => url  :*****
2018-11-16 16:56 | DEBUG | response => code    : 404
2018-11-16 16:56 | DEBUG | response => headers :*****
2018-11-16 16:56 |  INFO | Start delete stacks action
==> centos7-qa: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines...
==> centos7-qa: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
2018-11-16 16:56 |  INFO | Reading SSH info
An unknown error happened in Vagrant OpenStack provider

#<Thread:0x0000561842b85c08@/usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/batch_action.rb:71 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
    38: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
    37: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `action'
    36: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `call'
    35: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/environment.rb:592:in `lock'
    34: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:in `block in action'
    33: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in `action_raw'
    32: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
    31: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
    30: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
    29: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
    28: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
    27: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    26: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
    25: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/action/update_all.rb:46:in `call'
    24: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:74:in `update_host'
    23: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:84:in `update_file'
    22: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:94:in `update_content'
    21: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:94:in `map'
    20: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:94:in `block in update_content'
    19: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:100:in `get_hosts_file_entry'
    18: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:121:in `get_ip_address'
    17: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:428:in `ssh_info'
    16: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/provider.rb:25:in `ssh_info'
    15: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `action'
    14: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:184:in `block in action'
    13: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:in `block in action'
    12: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in `action_raw'
    11: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
    10: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
     9: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
     8: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
     7: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
     6: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
     5: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
     4: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
     3: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/connect_openstack.rb:32:in `execute'
     2: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
     1: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
/home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/read_ssh_info.rb:23:in `execute': Catched Error: Catched Error: undefined method `to_sym' for nil:NilClass (NoMethodError)
Traceback (most recent call last):
    38: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
    37: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `action'
    36: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `call'
    35: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/environment.rb:592:in `lock'
    34: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:in `block in action'
    33: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in `action_raw'
    32: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
    31: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
    30: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
    29: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
    28: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
    27: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    26: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
    25: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/action/update_all.rb:46:in `call'
    24: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:74:in `update_host'
    23: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:84:in `update_file'
    22: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:94:in `update_content'
    21: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:94:in `map'
    20: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:94:in `block in update_content'
    19: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:100:in `get_hosts_file_entry'
    18: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:121:in `get_ip_address'
    17: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:428:in `ssh_info'
    16: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/provider.rb:25:in `ssh_info'
    15: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `action'
    14: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:184:in `block in action'
    13: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:in `block in action'
    12: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in `action_raw'
    11: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
    10: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
     9: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
     8: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
     7: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
     6: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
     5: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
     4: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
     3: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/connect_openstack.rb:32:in `execute'
     2: from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
     1: from /home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
/home/tstrych/.vagrant.d/gems/2.5.1/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/read_ssh_info.rb:23:in `execute': Catched Error: Catched Error: undefined method `to_sym' for nil:NilClass (NoMethodError)

If you need more info, just let me know and I will provide it :)

jhutar commented 5 years ago

Just for a reference, mentioned Forklift is here: https://github.com/theforeman/forklift

Relevant Forklift code is here: https://github.com/theforeman/forklift/tree/master/vagrant/lib

Boxes definition is here: https://github.com/theforeman/forklift/tree/master/vagrant/boxes.d