Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Friendlier error messages #168

Open
Lasering opened this issue Apr 13, 2017 · 1 comment
Open

Friendlier error messages #168

Lasering opened this issue Apr 13, 2017 · 1 comment

Comments

@Lasering
Copy link

Lasering commented Apr 13, 2017

Whenever I try to create/converge a new VM and I already surpassed my quota of CPU or RAM in openstack the output I get is something like:

-----> Creating <default-centos-7>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Create failed on instance <default-centos-7>.  Please see .kitchen/logs/default-centos-7.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Then if I check the logs I get:

I, [2017-04-13T10:56:15.774349 #5225]  INFO -- default-centos-7: -----> Creating <default-centos-7>...
E, [2017-04-13T10:56:19.576612 #5225] ERROR -- default-centos-7: Create failed on instance <default-centos-7>.
E, [2017-04-13T10:56:19.576877 #5225] ERROR -- default-centos-7: ------Exception-------
E, [2017-04-13T10:56:19.576932 #5225] ERROR -- default-centos-7: Class: Kitchen::ActionFailed
E, [2017-04-13T10:56:19.576965 #5225] ERROR -- default-centos-7: Message: Expected([200, 202]) <=> Actual(403 Forbidden)
excon.error.response
  :body          => "{\"forbidden\": {\"message\": \"Quota exceeded for ram: Requested 4096, but already used 8192 of 8193 ram\", \"code\": 403}}"
  :cookies       => [
  ]
  :headers       => {
    "Content-Length"               => "116"
    "Content-Type"                 => "application/json; charset=UTF-8"
    "Date"                         => "Thu, 13 Apr 2017 09:57:02 GMT"
    "Openstack-Api-Version"        => "compute 2.1"
    "Vary"                         => "OpenStack-API-Version, X-OpenStack-Nova-API-Version"
    "X-Compute-Request-Id"         => "req-8ee2340e-901e-481d-9c35-9ef6d9d28be5"
    "X-Openstack-Nova-Api-Version" => "2.1"
  }
  :host          => "<MYHOST>"
  :local_address => "<MYIP>"
  :local_port    => 60752
  :path          => "/v2.1/22cfa7276a884687b74e69c91aeb3784/servers.json"
  :port          => 8774
  :reason_phrase => "Forbidden"
  :remote_ip     => "<MYIP>"
  :status        => 403
  :status_line   => "HTTP/1.1 403 Forbidden\r\n"

E, [2017-04-13T10:56:19.577031 #5225] ERROR -- default-centos-7: ----------------------
E, [2017-04-13T10:56:19.577064 #5225] ERROR -- default-centos-7: ------Backtrace-------
E, [2017-04-13T10:56:19.577090 #5225] ERROR -- default-centos-7: /home/simon/.chefdk/gem/ruby/2.3.0/gems/kitchen-openstack-3.4.0/lib/kitchen/driver/openstack.rb:101:in `rescue in create'

E, [2017-04-13T10:56:19.577559 #5225] ERROR -- default-centos-7: /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/test-kitchen-1.16.0/lib/kitchen/command.rb:169:in `block (2 levels) in run_action'
E, [2017-04-13T10:56:19.577585 #5225] ERROR -- default-centos-7: ----End Backtrace-----
E, [2017-04-13T10:56:19.577610 #5225] ERROR -- default-centos-7: ---Nested Exception---
(an almost repetition of the above log lines, removed for clarity)

It would be much more productive if I saw this directly:

-----> Creating <default-centos-7>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Create failed on instance <default-centos-7> due to:
>>>>>>       "Quota exceeded for ram: Requested 4096, but already used 8192 of 8193 ram"
>>>>>>     Please see .kitchen/logs/default-centos-7.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
@jjasghar
Copy link
Contributor

makes sense, we'd have to do some parsing to get that information though. If someone is willing to get that done I'm all for the PR.

Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants