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

image(:pull) - "no implicit conversion of nil into String" #153

Closed
jschneiderhan opened this issue May 19, 2014 · 4 comments
Closed

image(:pull) - "no implicit conversion of nil into String" #153

jschneiderhan opened this issue May 19, 2014 · 4 comments

Comments

@jschneiderhan
Copy link
Contributor

On repeated chef runs I'm running into the following error while trying to pull an image. Everything works fine the first time through, it's just subsequent runs that fail.

TypeError
---------
no implicit conversion of nil into String 

[...] 

Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/image.rb:154:in `start_with?'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/image.rb:154:in `image_id_matches?'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/image.rb:10:in `block in load_current_resource'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/image.rb:8:in `each_line'
/var/lib/aws/opsworks/cache/cookbooks/docker/providers/image.rb:8:in `load_current_resource'

[...] 

Compiled Resource:
------------------
[...] 
docker_image("quay.io/xxxx/myapp") do
action :pull
retries 0
retry_delay 2
cookbook_name "myapp"
recipe_name "application"
cmd_timeout 300
image_name "quay.io/xxxx/myapp"
end

Some information that may or may not be relevant:

environment: Ubuntu 12.04 LTS on AWS Opsworks
cookbook version: 0.34.1
chef-solo 11.10.4

I'm going to start trying to reproduce local and see if I can gather more information.

@jschneiderhan
Copy link
Contributor Author

Looks like this may be related to #139, although that report is for a different LWRP

@jschneiderhan
Copy link
Contributor Author

Somehow managed to get pry invoked inside the image provider. I don't think "IMAGE ID" is the intended contents of the id attribute.

From: /opt/aws/opsworks/current/merged-cookbooks/docker/providers/image.rb @ line 155 Chef::Provider::DockerImage#image_id_matches?:

    153: def image_id_matches?(id)
    154:   require 'pry'
 => 155:   binding.pry
    156:   id.start_with?(new_resource.id)
    157: end

[1] pry(#<Chef::Provider::DockerImage>)> p id
"IMAGE ID"
=> "IMAGE ID"

@jschneiderhan
Copy link
Contributor Author

I think the problem is that new_resource.id https://github.com/bflad/chef-docker/blob/master/providers/image.rb#L160 is always nil when called from load_current_resource https://github.com/bflad/chef-docker/blob/master/providers/image.rb#L10. If I remove the unless statement at L10 everything works fine.

@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.

@bflad bflad closed this as completed Jun 24, 2014
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