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 1.10) Docker::Image.create('fromImage' => image_name) raises an exception after successful downloading an image #369

Closed
seffenberg-naspers opened this Issue Feb 11, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@seffenberg-naspers
Copy link

seffenberg-naspers commented Feb 11, 2016

Since docker 1.10 pulling from docker hub a private image will succeed but still throw an exception with No such image: a3ed95caeb02:

INFO: [dff666b43ddc] Pull complete
INFO: [dff666b43ddc] Pull complete
INFO: [a3ed95caeb02] Extracting: 32/32 [==================================================>]     32 B/32 B
INFO: [a3ed95caeb02] Extracting: 32/32 [==================================================>]     32 B/32 B
INFO: [a3ed95caeb02] Pull complete
INFO: [a3ed95caeb02] Pull complete
INFO: Digest: sha256:3fa7ce9d9c7b4df549fa05f826823b0842ebe75c5e4191d91c4c4c1cba37c31d
INFO: Status: Downloaded newer image for organisation/private-image:1.0.0
ERROR: unexpected error while pulling image 'organisation/private-image:1.0.0'
ERROR: please ensure that you have network
ERROR: error message: No such image: a3ed95caeb02

ERROR: stacktrace:
/var/lib/gems/2.2.0/gems/docker-api-1.26.0/lib/docker/connection.rb:46:in `rescue in request'
/var/lib/gems/2.2.0/gems/docker-api-1.26.0/lib/docker/connection.rb:38:in `request'
/var/lib/gems/2.2.0/gems/docker-api-1.26.0/lib/docker/connection.rb:65:in `block (2 levels) in <class:Connection>'
/var/lib/gems/2.2.0/gems/docker-api-1.26.0/lib/docker/image.rb:126:in `get'
/var/lib/gems/2.2.0/gems/docker-api-1.26.0/lib/docker/image.rb:118:in `create'

but the image was downloaded successfully:

gracy:~ [master f1d58b7]$ sudo docker images | grep private-image                                                                                                                        
organisation/private-image               1.0.0               075762755719        9 weeks ago         410 MB

the normal sudo docker pull organisation/private-image works also well

@seffenberg-naspers

This comment has been minimized.

Copy link
Author

seffenberg-naspers commented Feb 11, 2016

yeah I see as well that the issue is after downloading..

it does {:method=>:get, :path=>"/v1.16/images/dff666b43ddc/json", :query=>{}, :headers=>{"Content-Type"=>"text/plain", "User-Agent"=>"Swipely/Docker-API 1.26.0"}, :expects=>[200, 201, 202, 203, 204, 304], :idempotent=>true} which fails so the referenced pull request would fix this issue probably (checking this now)

@seffenberg-naspers

This comment has been minimized.

Copy link
Author

seffenberg-naspers commented Feb 11, 2016

worked locally (the fix)

@someara

This comment has been minimized.

Copy link
Contributor

someara commented Feb 11, 2016

This seems to have broken the specs on Travis.... investigating

On Thu, Feb 11, 2016 at 9:44 AM, Simon Effenberg notifications@github.com
wrote:

worked locally (the fix)


Reply to this email directly or view it on GitHub
#369 (comment).

@seffenberg-naspers

This comment has been minimized.

Copy link
Author

seffenberg-naspers commented Feb 11, 2016

Temporary "fix" until this is solved and released:

    begin
      Docker::Image.create('fromImage' => image_name) do |info|
        yield info if block_given?
      end 
    rescue Docker::Error::NotFoundError => e
      # see: https://github.com/swipely/docker-api/issues/369
      # as long as this is not fixed we need to re-check on our own
      # on docker-engines >= 1.10
      if Gem::Version.new(Docker.version['Version']) >= Gem::Version.new('1.10.0')
        Docker::Image.get(image_name)
      else
        raise e
      end 
    end 

someara pushed a commit to chef-cookbooks/docker that referenced this issue Feb 11, 2016

AlbinOS added a commit to GoPex/docker-api that referenced this issue Feb 15, 2016

Fix image create on Docker 1.10.0
Fixes issue swipely#369 of docker-api on the main fork

AlbinOS added a commit to GoPex/docker-api that referenced this issue Feb 15, 2016

AlbinOS added a commit to GoPex/docker-api that referenced this issue Feb 15, 2016

@treeder

This comment has been minimized.

Copy link

treeder commented Feb 24, 2016

Can we get the fix merged?

@tlunter

This comment has been minimized.

Copy link
Member

tlunter commented Feb 24, 2016

Merged @someara's fix. Sorry about the delay.

bodymindarts pushed a commit to cloudfoundry-community/cf-containers-broker that referenced this issue Mar 15, 2016

Justin Carter

@tlunter tlunter closed this Mar 22, 2016

@ozbillwang

This comment has been minimized.

Copy link
Contributor

ozbillwang commented May 12, 2016

The fix which @seffenberg-naspers pasted works for native docker for mac as well. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.