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

TypeError: no implicit conversion of nil into String #139

Closed
somethingnew2-0 opened this issue Apr 29, 2014 · 3 comments
Closed

TypeError: no implicit conversion of nil into String #139

somethingnew2-0 opened this issue Apr 29, 2014 · 3 comments

Comments

@somethingnew2-0
Copy link

When trying to run a very simple container I run into an issue within the docker cookbook. Am I missing anything with my docker_container 'busybox' declaration or is this a bug in the library?

Cookbook Trace:

/var/lib/aws/opsworks/cache/cookbooks/docker/providers/container.rb:138:in `start_with?'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/container.rb:138:in `container_id_matches?'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/container.rb:7:in `block in load_current_resource'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/container.rb:6:in `each'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/container.rb:6:in `load_current_resource'

Resource Declaration:

In /var/lib/aws/opsworks/cache/cookbooks/chef/recipes/run_containers.rb

2: docker_container 'busybox' do
3:   command 'sleep 10'
4:   detach true
5: end
6: 

Compiled Resource:

Declared in /var/lib/aws/opsworks/cache/cookbooks/chef/recipes/run_containers.rb:2:in `from_file'

docker_container("busybox") do
action :run
retries 0
retry_delay 2
cookbook_name "chef"
recipe_name "run_containers"
command "sleep 10"
detach true
cmd_timeout 60
end
[2014-04-29T04:54:34+00:00] INFO: Running queued delayed notifications before re-raising exception
[2014-04-29T04:54:34+00:00] ERROR: Running exception handlers
[2014-04-29T04:54:34+00:00] ERROR: Exception handlers complete
[2014-04-29T04:54:34+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache/chef-stacktrace.out
[2014-04-29T04:54:34+00:00] ERROR: docker_container[busybox] (chef::run_containers line 2) had an error: TypeError: no implicit conversion of nil into String
[2014-04-29T04:54:34+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@bflad
Copy link
Contributor

bflad commented May 5, 2014

Interesting. We can help it from completely bombing out with adding a return false if id.nil? check to the beginning of the container_id_matches? method, but I'm curious why you're getting a nil container ID. Could you get me the output of docker ps -a -notrunc? It may be printed out a few lines above this error.

@somethingnew2-0
Copy link
Author

I think docker ps -a -notrunc returned an empty output even though I had pulled the image
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

@bflad
Copy link
Contributor

bflad commented Jun 24, 2014

I've merged in #157 which may resolve this issue and am going to preemptively close #139, #153, and #154 even though they may not be fully resolved yet. I'd prefer if someone created separate new single issues to track if you are:

  • no longer able matching images/containers in your use cases
  • still having issues with nil for existing containers

Thanks so much for your cooperation and patience.

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

2 participants