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

kitchen create fails when container does not exist #208

Closed
emeshuris opened this issue Nov 19, 2020 · 9 comments · Fixed by #211
Closed

kitchen create fails when container does not exist #208

emeshuris opened this issue Nov 19, 2020 · 9 comments · Fixed by #211

Comments

@emeshuris
Copy link

emeshuris commented Nov 19, 2020

Description

kitchen converge causes the following error

Message: Failed to complete #create action: [no implicit conversion of nil into String (TypeError)]

Version

Chef Workstation version: 20.11.180
Chef Infra Client version: 16.6.14
Chef InSpec version: 4.23.15
Chef CLI version: 3.0.33
Chef Habitat version: 1.6.56
Test Kitchen version: 2.7.2
Cookstyle version: 7.2.1
kitchen-dokken: 2.11.1
docker desktop 2.5.0.1,49550

Environment

macosx: Catalina 10.15.7
Darwin M-C02V535PHTDF.secret.net 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64

Scenario

kitchen converge

Opinion after some debugging

there is a problem with getting container info, the conn.get call fails.

From: /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:374 Kitchen::Driver::Dokken#create_chef_container:

    369: def create_chef_container(state)
    370:   lockfile = Lockfile.new "#{home_dir}/.dokken-#{chef_container_name}.lock"
    371:   begin
    372:     lockfile.lock
    373:     binding.pry
 => 374:     with_retries { ::Docker::Container.get(chef_container_name, {}, docker_connection) }
    375:   rescue ::Docker::Error::NotFoundError
    376:     with_retries do
    377:       begin
    378:         debug "driver - creating volume container #{chef_container_name} from #{chef_image}"
    379:         config = {
    380:           'name' => chef_container_name,
    381:           'Cmd' => 'true',
    382:           'Image' => "#{repo(chef_image)}:#{tag(chef_image)}",
    383:           'HostConfig' => {
    384:             'NetworkMode' => self[:network_mode],
    385:           },
    386:         }
    387:         chef_container = create_container(config)
    388:         state[:chef_container] = chef_container.json
    389:       rescue ::Docker::Error => e
    390:         raise "driver - #{chef_container_name} failed to create #{e}"
    391:       end
    392:     end
    393:   ensure
    394:     lockfile.unlock
    395:   end
    396: end
From: /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/container.rb:336 Docker::Container.get:

    335: def self.get(id, opts = {}, conn = Docker.connection)
 => 336:   container_json = conn.get("/containers/#{id}/json", opts)
    337:   hash = Docker::Util.parse_json(container_json) || {}
    338:   new(conn, hash)
    339: end

[1] pry(Docker::Container)> p conn.get("/containers/#{id}/json", opts)
Excon::Error::Socket: no implicit conversion of nil into String (TypeError)
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
Caused by TypeError: no implicit conversion of nil into String
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
Caused by Excon::Error::Socket: no implicit conversion of nil into String (TypeError)
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
Caused by TypeError: no implicit conversion of nil into String
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
Caused by Excon::Error::Socket: no implicit conversion of nil into String (TypeError)
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
Caused by TypeError: no implicit conversion of nil into String
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
Caused by Excon::Error::Socket: no implicit conversion of nil into String (TypeError)
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
Caused by TypeError: no implicit conversion of nil into String
from /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
[2] pry(Docker::Container)> p conn
#<Docker::Connection:0x00007f956d199dd0 @url="unix:///", @options={:socket=>"/var/run/docker.sock", :read_timeout=>3600, :write_timeout=>3600}>
=> #<Docker::Connection:0x00007f956d199dd0 @options={:socket=>"/var/run/docker.sock", :read_timeout=>3600, :write_timeout=>3600}, @url="unix:///">
[3] pry(Docker::Container)> p id
"chef-latest"
=> "chef-latest"
[4] pry(Docker::Container)> p opts
{}
=> {}

Steps to Reproduce

kitchen converge on this kitchen.yml

---
driver:
  name:         dokken
provisioner:
  name:         dokken

platforms:
  - name:       centos-7
    driver:
      image:    dokken/centos-7

suites:
  - name:       default
    run_list:
    attributes:

Expected Result

no error is expected

Actual Result

-----> Starting Test Kitchen (v2.7.2)
-----> Creating <default-centos-7>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [no implicit conversion of nil into String (TypeError)] on default-centos-7
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

➕ Additional context

debug log

-----> Starting Test Kitchen (v2.7.2)
-----> Creating <default-centos-7>...
D      driver - pulling chef/chef:latest dokken/centos-7 latest
D      driver - pulling chef/chef:latest chef/chef latest
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [no implicit conversion of nil into String (TypeError)] on default-centos-7
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

D      ------Exception-------
D      Class: Kitchen::ActionFailed
D      Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [no implicit conversion of nil into String (TypeError)] on default-centos-7
D      ----------------------
D      ------Backtrace-------
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:181:in `report_errors'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:172:in `run_action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command/action.rb:35:in `block in call'
D      /opt/chef-workstation/embedded/lib/ruby/2.7.0/benchmark.rb:293:in `measure'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command/action.rb:33:in `call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/cli.rb:52:in `perform'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/cli.rb:198:in `block (2 levels) in <class:CLI>'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/bin/kitchen:11:in `block in <top (required)>'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/errors.rb:170:in `with_friendly_errors'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/bin/kitchen:11:in `<top (required)>'
D      /usr/local/bin/kitchen:352:in `load'
D      /usr/local/bin/kitchen:352:in `<main>'
D      ----End Backtrace-----
D      -Composite Exception--
D      Class: Kitchen::ActionFailed
D      Message: Failed to complete #create action: [no implicit conversion of nil into String (TypeError)] on default-centos-7
D      ----------------------
D      ------Backtrace-------
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/response.rb:128:in `parse'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/response_parser.rb:7:in `response_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/excon/middlewares/hijack.rb:45:in `response_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:456:in `response'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:287:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/connection.rb:40:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/connection.rb:65:in `block (2 levels) in <class:Connection>'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/container.rb:336:in `get'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:374:in `block in create_chef_container'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:572:in `with_retries'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:374:in `create_chef_container'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:78:in `create'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:495:in `public_send'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:495:in `block in perform_action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:563:in `synchronize_or_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:524:in `block in action'
D      /opt/chef-workstation/embedded/lib/ruby/2.7.0/benchmark.rb:293:in `measure'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:523:in `action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:495:in `perform_action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:404:in `create_action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:392:in `block (2 levels) in transition_to'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/lifecycle_hooks.rb:44:in `run_with_hooks'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:391:in `block in transition_to'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:390:in `each'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:390:in `transition_to'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:139:in `converge'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:195:in `public_send'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:195:in `run_action_in_thread'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:166:in `block (2 levels) in run_action'
D      ----End Backtrace-----
D      ---Nested Exception---
D      Class: Kitchen::ActionFailed
D      Message: Failed to complete #create action: [no implicit conversion of nil into String (TypeError)]
D      ----------------------
D      ------Backtrace-------
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/response.rb:128:in `parse'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/response_parser.rb:7:in `response_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/excon/middlewares/hijack.rb:45:in `response_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:456:in `response'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:287:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/connection.rb:40:in `request'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/connection.rb:65:in `block (2 levels) in <class:Connection>'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/container.rb:336:in `get'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:374:in `block in create_chef_container'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:572:in `with_retries'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:374:in `create_chef_container'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/kitchen-dokken-2.11.1/lib/kitchen/driver/dokken.rb:78:in `create'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:495:in `public_send'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:495:in `block in perform_action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:563:in `synchronize_or_call'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:524:in `block in action'
D      /opt/chef-workstation/embedded/lib/ruby/2.7.0/benchmark.rb:293:in `measure'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:523:in `action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:495:in `perform_action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:404:in `create_action'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:392:in `block (2 levels) in transition_to'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/lifecycle_hooks.rb:44:in `run_with_hooks'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:391:in `block in transition_to'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:390:in `each'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:390:in `transition_to'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/instance.rb:139:in `converge'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:195:in `public_send'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:195:in `run_action_in_thread'
D      /opt/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.7.2/lib/kitchen/command.rb:166:in `block (2 levels) in run_action'
D      ----End Backtrace-----

kitchen diagnose --all

---
timestamp: 2020-11-19 16:39:51 UTC
kitchen_version: 2.7.2
plugins:
  driver:
    Dokken:
      class: Kitchen::Driver::Dokken
      version:
      api_version:
  provisioner:
    Dokken:
      class: Kitchen::Provisioner::Dokken
      version: 2.7.2
      api_version: 2
  transport:
    Ssh:
      class: Kitchen::Transport::Ssh
      version: 2.7.2
      api_version: 1
  verifier:
    Busser:
      class: Kitchen::Verifier::Busser
      version: 2.7.2
      api_version: 1
loader:
  process_erb: true
  process_local: true
  process_global: true
  global_config:
    filename: "/Users/cr2p/.kitchen/config.yml"
    raw_data:
      driver:
        name: vagrant
        use_sudo: false
      driver_config:
        http_proxy: ''
        https_proxy: ''
        no_proxy: localhost,127.0.0.1,secret.net
  project_config:
    filename: "/Users/cr2p/tmp/test-kitchen/kitchen.yml"
    raw_data:
      driver:
        name: dokken
      provisioner:
        name: dokken
      platforms:
      - name: centos-7
        driver:
          image: dokken/centos-7
      suites:
      - name: default
        run_list:
        attributes:
  local_config:
  combined_config:
    filename:
    raw_data:
      driver:
        name: dokken
        use_sudo: false
      driver_config:
        http_proxy: ''
        https_proxy: ''
        no_proxy: localhost,127.0.0.1,secret.net
      provisioner:
        name: dokken
      platforms:
      - name: centos-7
        driver:
          image: dokken/centos-7
      suites:
      - name: default
        run_list:
        attributes:
instances:
  default-centos-7:
    platform:
      os_type: unix
      shell_type: bourne
    state_file:
      last_error: Excon::Error::Socket
    driver:
      api_retries: 20
      binds: []
      cap_add:
      cap_drop:
      chef_image: chef/chef
      chef_version: latest
      data_image: dokken/kitchen-cache:latest
      dns:
      dns_search:
      docker_host_url: unix:///var/run/docker.sock
      docker_info:
        ID: 32JP:CVZV:P5LJ:6DW7:3PIH:47PH:XQHU:3MRG:5FJK:KERE:GIRR:GT5Y
        Containers: 1
        ContainersRunning: 0
        ContainersPaused: 0
        ContainersStopped: 1
        Images: 6
        Driver: overlay2
        DriverStatus:
        - - Backing Filesystem
          - extfs
        - - Supports d_type
          - 'true'
        - - Native Overlay Diff
          - 'true'
        SystemStatus:
        Plugins:
          Volume:
          - local
          Network:
          - bridge
          - host
          - ipvlan
          - macvlan
          - 'null'
          - overlay
          Authorization:
          Log:
          - awslogs
          - fluentd
          - gcplogs
          - gelf
          - journald
          - json-file
          - local
          - logentries
          - splunk
          - syslog
        MemoryLimit: true
        SwapLimit: true
        KernelMemory: true
        KernelMemoryTCP: true
        CpuCfsPeriod: true
        CpuCfsQuota: true
        CPUShares: true
        CPUSet: true
        PidsLimit: true
        IPv4Forwarding: true
        BridgeNfIptables: true
        BridgeNfIp6tables: true
        Debug: false
        NFd: 39
        OomKillDisable: true
        NGoroutines: 45
        SystemTime: '2020-11-19T16:39:50.9039758Z'
        LoggingDriver: json-file
        CgroupDriver: cgroupfs
        NEventsListener: 3
        KernelVersion: 5.4.39-linuxkit
        OperatingSystem: Docker Desktop
        OSType: linux
        Architecture: x86_64
        IndexServerAddress: https://index.docker.io/v1/
        RegistryConfig:
          AllowNondistributableArtifactsCIDRs: []
          AllowNondistributableArtifactsHostnames: []
          InsecureRegistryCIDRs:
          - 127.0.0.0/8
          IndexConfigs:
            docker.io:
              Name: docker.io
              Mirrors: []
              Secure: true
              Official: true
          Mirrors: []
        NCPU: 4
        MemTotal: 2084032512
        GenericResources:
        DockerRootDir: "/var/lib/docker"
        HttpProxy: gateway.docker.internal:3128
        HttpsProxy: gateway.docker.internal:3129
        NoProxy: ''
        Name: docker-desktop
        Labels: []
        ExperimentalBuild: false
        ServerVersion: 19.03.13
        ClusterStore: ''
        ClusterAdvertise: ''
        Runtimes:
          runc:
            path: runc
        DefaultRuntime: runc
        Swarm:
          NodeID: ''
          NodeAddr: ''
          LocalNodeState: inactive
          ControlAvailable: false
          Error: ''
          RemoteManagers:
        LiveRestoreEnabled: false
        Isolation: ''
        InitBinary: docker-init
        ContainerdCommit:
          ID: 8fba4e9a7d01810a393d5d25a3621dc101981175
          Expected: 8fba4e9a7d01810a393d5d25a3621dc101981175
        RuncCommit:
          ID: dc9208a3303feef5b3839f4323d9beb36df0a9dd
          Expected: dc9208a3303feef5b3839f4323d9beb36df0a9dd
        InitCommit:
          ID: fec3683
          Expected: fec3683
        SecurityOptions:
        - name=seccomp,profile=default
        ProductLicense: Community Engine
        Warnings:
      entrypoint:
      env:
      hostname: dokken
      http_proxy: ''
      https_proxy: ''
      image: dokken/centos-7
      image_prefix:
      kitchen_root: "/Users/cr2p/tmp/test-kitchen"
      links:
      log_level: :info
      memory_limit: 0
      name: dokken
      network_mode: dokken
      no_proxy: localhost,127.0.0.1,secret.net
      pid_one_command: sh -c "trap exit 0 SIGTERM; while :; do sleep 1; done"
      ports:
      pre_create_command:
      privileged: false
      pull_chef_image: true
      pull_platform_image: true
      read_timeout: 3600
      security_opt:
      test_base_path: "/Users/cr2p/tmp/test-kitchen/test/integration"
      tmpfs: {}
      use_sudo: false
      userns_host: false
      volumes:
      write_timeout: 3600
    provisioner:
      always_update_cookbooks: false
      architecture:
      attributes: {}
      berksfile_path:
      channel: :stable
      checksum:
      chef_binary: "/opt/chef/bin/chef-client"
      chef_client_path: "/bin/chef-client"
      chef_license:
      chef_log_level: warn
      chef_omnibus_install_options:
      chef_omnibus_url: https://omnitruck.chef.io/install.sh
      chef_options: " -z"
      chef_output_format: doc
      chef_zero_host:
      chef_zero_port: 8889
      clean_dokken_sandbox: true
      client_rb: {}
      clients_path:
      command_prefix:
      config_path:
      cookbook_files_glob: README.*,VERSION,metadata.{json,rb},attributes.rb,recipe.rb,attributes/**/*,definitions/**/*,files/**/*,libraries/**/*,providers/**/*,recipes/**/*,resources/**/*,templates/**/*,ohai/**/*
      data_bags_path:
      data_path:
      debug:
      deprecations_as_errors: false
      docker_host_url: unix:///var/run/docker.sock
      docker_info:
        ID: 32JP:CVZV:P5LJ:6DW7:3PIH:47PH:XQHU:3MRG:5FJK:KERE:GIRR:GT5Y
        Containers: 1
        ContainersRunning: 0
        ContainersPaused: 0
        ContainersStopped: 1
        Images: 6
        Driver: overlay2
        DriverStatus:
        - - Backing Filesystem
          - extfs
        - - Supports d_type
          - 'true'
        - - Native Overlay Diff
          - 'true'
        SystemStatus:
        Plugins:
          Volume:
          - local
          Network:
          - bridge
          - host
          - ipvlan
          - macvlan
          - 'null'
          - overlay
          Authorization:
          Log:
          - awslogs
          - fluentd
          - gcplogs
          - gelf
          - journald
          - json-file
          - local
          - logentries
          - splunk
          - syslog
        MemoryLimit: true
        SwapLimit: true
        KernelMemory: true
        KernelMemoryTCP: true
        CpuCfsPeriod: true
        CpuCfsQuota: true
        CPUShares: true
        CPUSet: true
        PidsLimit: true
        IPv4Forwarding: true
        BridgeNfIptables: true
        BridgeNfIp6tables: true
        Debug: false
        NFd: 39
        OomKillDisable: true
        NGoroutines: 45
        SystemTime: '2020-11-19T16:39:51.0868448Z'
        LoggingDriver: json-file
        CgroupDriver: cgroupfs
        NEventsListener: 3
        KernelVersion: 5.4.39-linuxkit
        OperatingSystem: Docker Desktop
        OSType: linux
        Architecture: x86_64
        IndexServerAddress: https://index.docker.io/v1/
        RegistryConfig:
          AllowNondistributableArtifactsCIDRs: []
          AllowNondistributableArtifactsHostnames: []
          InsecureRegistryCIDRs:
          - 127.0.0.0/8
          IndexConfigs:
            docker.io:
              Name: docker.io
              Mirrors: []
              Secure: true
              Official: true
          Mirrors: []
        NCPU: 4
        MemTotal: 2084032512
        GenericResources:
        DockerRootDir: "/var/lib/docker"
        HttpProxy: gateway.docker.internal:3128
        HttpsProxy: gateway.docker.internal:3129
        NoProxy: ''
        Name: docker-desktop
        Labels: []
        ExperimentalBuild: false
        ServerVersion: 19.03.13
        ClusterStore: ''
        ClusterAdvertise: ''
        Runtimes:
          runc:
            path: runc
        DefaultRuntime: runc
        Swarm:
          NodeID: ''
          NodeAddr: ''
          LocalNodeState: inactive
          ControlAvailable: false
          Error: ''
          RemoteManagers:
        LiveRestoreEnabled: false
        Isolation: ''
        InitBinary: docker-init
        ContainerdCommit:
          ID: 8fba4e9a7d01810a393d5d25a3621dc101981175
          Expected: 8fba4e9a7d01810a393d5d25a3621dc101981175
        RuncCommit:
          ID: dc9208a3303feef5b3839f4323d9beb36df0a9dd
          Expected: dc9208a3303feef5b3839f4323d9beb36df0a9dd
        InitCommit:
          ID: fec3683
          Expected: fec3683
        SecurityOptions:
        - name=seccomp,profile=default
        ProductLicense: Community Engine
        Warnings:
      download_url:
      downloads: {}
      encrypted_data_bag_secret_key_path:
      enforce_idempotency: false
      environments_path:
      ftp_proxy:
      http_proxy: ''
      https_proxy: ''
      install_strategy: once
      json_attributes: true
      kitchen_root: "/Users/cr2p/tmp/test-kitchen"
      log_file:
      log_level: auto
      max_retries: 1
      multiple_converge: 1
      name: dokken
      named_run_list: {}
      nodes_path:
      platform:
      platform_version:
      policyfile:
      policyfile_path:
      product_name: chef
      product_version: latest
      profile_ruby: false
      require_chef_omnibus: true
      retry_on_exit_code:
      - 35
      - 213
      roles_path:
      root_path: "/opt/kitchen"
      ruby_bindir: "/embedded/bin"
      run_list: []
      sudo: true
      sudo_command: sudo -E
      test_base_path: "/Users/cr2p/tmp/test-kitchen/test/integration"
      wait_for_retry: 30
    transport:
      compression: false
      compression_level: 0
      connection_retries: 5
      connection_retry_sleep: 1
      connection_timeout: 15
      keepalive: true
      keepalive_interval: 60
      keepalive_maxcount: 3
      kitchen_root: "/Users/cr2p/tmp/test-kitchen"
      log_level: :info
      max_ssh_sessions: 9
      max_wait_until_ready: 600
      name: ssh
      port: 22
      ssh_gateway:
      ssh_gateway_port: 22
      ssh_gateway_username:
      ssh_http_proxy:
      ssh_http_proxy_password:
      ssh_http_proxy_port:
      ssh_http_proxy_user:
      ssh_key:
      test_base_path: "/Users/cr2p/tmp/test-kitchen/test/integration"
      username: root
    verifier:
      busser_bin: "/tmp/verifier/bin/busser"
      chef_omnibus_root: "/opt/chef"
      command_prefix:
      debug:
      ftp_proxy:
      http_proxy: ''
      https_proxy: ''
      kitchen_root: "/Users/cr2p/tmp/test-kitchen"
      log_level: :info
      name: busser
      root_path: "/tmp/verifier"
      ruby_bindir: "/opt/chef/embedded/bin"
      sudo: true
      sudo_command: sudo -E
      suite_name: default
      test_base_path: "/Users/cr2p/tmp/test-kitchen/test/integration"
      version: busser
    lifecycle_hooks:
      debug:
      kitchen_root: "/Users/cr2p/tmp/test-kitchen"
      log_level: :info
      test_base_path: "/Users/cr2p/tmp/test-kitchen/test/integration"
@PhilBug
Copy link

PhilBug commented Nov 21, 2020

Same thing happens to me on:

  • WSL2 Ubuntu 20.04
  • Docker for windows version 19.03.13, build 4484c46d9d

@anapsix
Copy link

anapsix commented Nov 22, 2020

When using kitchen-dokken (2.11.x) with test-kitchen (2.7.2), I'm getting that when running kitchen test, and container does not exist.
If container does exist (i.e. kitchen create && kitchen test) then it's able to destroy successfully, and proceed with the rest of the steps.

However, when using kitchen-dokken (2.7.x - 2.10.x) with test-kitchen (2.7.2) - it's all good

@johnypony3
Copy link

@anapsix only action i'm able to do is list.

@shoekstra
Copy link

However, when using kitchen-dokken (2.7.x - 2.10.x) with test-kitchen (2.7.2) - it's all good

Unfortunately seeing the same behaviour with 2.10.0.

@emeshuris
Copy link
Author

can confirm downgrading to the following versions has fixed the issue:

kitchen-dokken (2.7.0)
test-kitchen (2.5.3)

@shoekstra thank you! this unblocks me.

@ramereth
Copy link
Contributor

ramereth commented Dec 2, 2020

I suspect this is related to the fact that the docker-api gem has been upgraded to 2.x and the API has likely changed and we need to account for that in this plugin. Anyone have time or willing to looking into this further to see what the fix might be?

@devopsdina
Copy link

Downgrading to Chef Workstation 20.8.11 worked for me. Then you don't need to mess around with gems.

Workstation 20.8.11 bundles:

  • test-kitchen 2.5.3
  • kitchen-dokken 2.10.0

@clintoncwolfe clintoncwolfe changed the title kitchen converge fails kitchen create fails when container does not exist Dec 3, 2020
@emeshuris
Copy link
Author

@devopsdina this is indeed a perfect fix for this issue

@calidude25
Copy link

calidude25 commented Dec 5, 2020

ran into the same - Excon::Error::Socket issue while trying to on version "20.12.187" for Mac

kitchen verify
-----> Starting Test Kitchen (v2.8.0)
-----> Creating ...

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [no implicit conversion of nil into String (TypeError)] on default-ubuntu-1804

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

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

Successfully merging a pull request may close this issue.

8 participants