ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
247 stars 101 forks source link

Provisioning fails due to bad formatting of the AuthenticationRequired exception log #283

Open imriz opened 8 years ago

imriz commented 8 years ago
An unknown error happened in Vagrant OpenStack provider

To easily debug what happened, we recommend to set the environment
variable VAGRANT_OPENSTACK_LOG to debug

    $ export VAGRANT_OPENSTACK_LOG=debug

If doing this does not help fixing your issue, there may be a bug
in the provider. Please submit an issue on Github at
https://github.com/ggiamarchi/vagrant-openstack-provider
with the stracktrace and the logs.

We are looking for feedback, so feel free to ask questions or
describe features you would like to see in this provider.
/opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/ui.rb:320:in `format_message': Catched Error: Catched Error: undefined method `split' for #<VagrantPlugins::Openstack::Errors::AuthenticationRequired:0x000000027f5100> (NoMethodError)
    from (eval):6:in `warn'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/client/http_utils.rb:107:in `rescue in authenticated'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/client/http_utils.rb:103:in `authenticated'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/client/http_utils.rb:21:in `get'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/client/nova.rb:113:in `block in get_server_details'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/client/nova.rb:189:in `instance_exists'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/client/nova.rb:112:in `get_server_details'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_state.rb:26:in `read_state'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_state.rb:17:in `execute'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/connect_openstack.rb:32:in `execute'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:214:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:191:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:516:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:178:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:178:in `action'
    from /root/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/provider.rb:33:in `state'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:490:in `state'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:233:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/commands/provision/command.rb:29:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:174:in `<main>'

In https://github.com/ggiamarchi/vagrant-openstack-provider/blob/master/source/lib/vagrant-openstack-provider/client/http_utils.rb#L107, you probably want something in the lines of env[:ui].warn("#{e.class}: #{e.message}" + e.backtrace.join("\n")) or env[:ui].warn(e.to_s)?

tomzo commented 8 years ago

I am getting this error too. Even if this faulty logging line is commented out, it still fails

Bringing machine 'default' up with 'openstack' provider...==> default: Finding flavor for server...==> default: Finding image for server...==> default: Finding network(s) for server...==> default: Trying authentication...
       ==> default: Trying authentication...
       ==> default: Trying authentication...Authentication token is missing or no longer valid.
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider openstack ----
STDOUT: Bringing machine 'default' up with 'openstack' provider...
==> default: Finding flavor for server...
==> default: Finding image for server...
==> default: Finding network(s) for server...
==> default: Trying authentication...
==> default: Trying authentication...
==> default: Trying authentication...
STDERR: Authentication token is missing or no longer valid.
---- End output of vagrant up --no-provision --provider openstack ----
Ran vagrant up --no-provision --provider openstack returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Most likely it happens when auth token has expired.

tomzo commented 8 years ago

After some time I found out this openstack bug. This has nothing to do with vagrant-openstack-provider. Any client will experience these problems, related bugs

imriz commented 8 years ago

@tomzo My bug report is on the formatting of the log, not about the reason for the exception itself :)