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

Docker::Container.get throws no implicit conversion of nil into String (TypeError) Error #566

Open
clintoncwolfe opened this issue Dec 6, 2020 · 0 comments

Comments

@clintoncwolfe
Copy link

clintoncwolfe commented Dec 6, 2020

Thanks for docker-api 2.0.0!

Whenever the requested container does not exist, the Docker::Container.get class method throws a no implicit conversion of nil into String (TypeError) error from deep inside excon with docker-api 2.0.0 .

See test-kitchen/kitchen-dokken#208

In kitchen-dokken, we are using Docker::Container.all and then calling select as a temporary workaround, but that is not scalable.

E, [2020-12-06T13:38:46.318725 #35481] ERROR -- Kitchen: Message: Failed to complete #create action: [no implicit conversion of nil into String (TypeError)] on default-centos-7
E, [2020-12-06T13:38:46.318769 #35481] ERROR -- Kitchen: ----------------------
E, [2020-12-06T13:38:46.318872 #35481] ERROR -- Kitchen: ------Backtrace-------
E, [2020-12-06T13:38:46.318909 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/socket.rb:63:in `readline'
E, [2020-12-06T13:38:46.318938 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/response.rb:128:in `parse'
E, [2020-12-06T13:38:46.319005 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/response_parser.rb:7:in `response_call'
E, [2020-12-06T13:38:46.319051 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/excon/middlewares/hijack.rb:45:in `response_call'
E, [2020-12-06T13:38:46.319116 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:456:in `response'
E, [2020-12-06T13:38:46.319159 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:287:in `request'
E, [2020-12-06T13:38:46.319190 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
E, [2020-12-06T13:38:46.319218 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319333 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319399 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319476 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
E, [2020-12-06T13:38:46.319515 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
E, [2020-12-06T13:38:46.319545 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
E, [2020-12-06T13:38:46.319596 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319627 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319674 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319718 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
E, [2020-12-06T13:38:46.319766 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
E, [2020-12-06T13:38:46.319804 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
E, [2020-12-06T13:38:46.319837 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319863 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.319935 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/middlewares/base.rb:17:in `error_call'
E, [2020-12-06T13:38:46.320017 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:312:in `rescue in request'
E, [2020-12-06T13:38:46.320045 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/excon-0.78.0/lib/excon/connection.rb:232:in `request'
E, [2020-12-06T13:38:46.320087 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/connection.rb:40:in `request'
E, [2020-12-06T13:38:46.320135 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/connection.rb:65:in `block (2 levels) in <class:Connection>'
E, [2020-12-06T13:38:46.320174 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/docker-api-2.0.0/lib/docker/container.rb:336:in `get'
E, [2020-12-06T13:38:46.320237 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/kitchen-dokken/lib/kitchen/driver/dokken.rb:373:in `block in create_chef_container'
E, [2020-12-06T13:38:46.320267 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/kitchen-dokken/lib/kitchen/driver/dokken.rb:575:in `with_retries'
E, [2020-12-06T13:38:46.320314 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/kitchen-dokken/lib/kitchen/driver/dokken.rb:371:in `create_chef_container'
E, [2020-12-06T13:38:46.320355 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/kitchen-dokken/lib/kitchen/driver/dokken.rb:76:in `create'
E, [2020-12-06T13:38:46.320387 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:495:in `public_send'
E, [2020-12-06T13:38:46.320450 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:495:in `block in perform_action'
E, [2020-12-06T13:38:46.320479 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:563:in `synchronize_or_call'
E, [2020-12-06T13:38:46.320537 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:524:in `block in action'
E, [2020-12-06T13:38:46.320560 #35481] ERROR -- Kitchen: /Users/cwolfe/.rbenv/versions/2.7.2/lib/ruby/2.7.0/benchmark.rb:293:in `measure'
E, [2020-12-06T13:38:46.320629 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:523:in `action'
E, [2020-12-06T13:38:46.320717 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:495:in `perform_action'
E, [2020-12-06T13:38:46.320770 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:404:in `create_action'
E, [2020-12-06T13:38:46.320825 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:392:in `block (2 levels) in transition_to'
E, [2020-12-06T13:38:46.320864 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/lifecycle_hooks.rb:44:in `run_with_hooks'
E, [2020-12-06T13:38:46.320899 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:391:in `block in transition_to'
E, [2020-12-06T13:38:46.320925 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:390:in `each'
E, [2020-12-06T13:38:46.320949 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:390:in `transition_to'
E, [2020-12-06T13:38:46.321064 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/instance.rb:128:in `create'
E, [2020-12-06T13:38:46.321114 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/command.rb:195:in `public_send'
E, [2020-12-06T13:38:46.321157 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/command.rb:195:in `run_action_in_thread'
E, [2020-12-06T13:38:46.321187 #35481] ERROR -- Kitchen: /Users/cwolfe/sandbox/test-kitchen/tk-incident/lib/kitchen/command.rb:166:in `block (2 levels) in run_action'
E, [2020-12-06T13:38:46.321214 #35481] ERROR -- Kitchen: ----End Backtrace-----
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

No branches or pull requests

1 participant