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

Question about the images in pouch #123

Closed
gaocegege opened this issue Nov 19, 2017 · 8 comments · Fixed by #160
Closed

Question about the images in pouch #123

gaocegege opened this issue Nov 19, 2017 · 8 comments · Fixed by #160
Assignees
Labels
areas/images kind/question all questions or confusion about this project

Comments

@gaocegege
Copy link
Contributor

Issue Description

Tried to run pouch pull to pull images just like docker does but failed.

Describe what happened:

Run pouch pull hello-world:latest but failed to get the image. I dived into the code and found that pouch will parse the URL dummy://hello-world:latest and get the object from the URL. I am not sure what dummy:// is, and it seems that we can not use pouch like docker. Could you give me some guides to understand the concept of image in pouch?

I'd appreciate it.

Pouchd Log

INFO[2017-11-19 17:03:04.337774781] Calling POST /images/create?fromImage=hello-world&tag=latest, client @ 
ERRO[2017-11-19 17:03:04.337858143] failed to pull image hello-world:latest: failed to pull image: object required 
2017/11/19 17:03:04 http: multiple response.WriteHeader calls
ERRO[2017-11-19 17:03:04.337875015] invoke /images/create?fromImage=hello-world&tag=latest error failed to pull image: object required. client @ 
INFO[2017-11-19 17:03:04.438008556] fetch progress exited, ref: hello-world:latest. 
ERRO[2017-11-19 17:03:04.438060020] failed to write object: http: wrote more than the declared Content-Length 

Pouch Log

failed to decode: invalid character 'i' in literal false (expecting 'l') 

Describe what you expected to happen:

Pull the images successfully from docker hub or other registries.

How to reproduce it (as minimally and precisely as possible):

  1. pouch pull hello-world:latest

Anything else we need to know?:

Nothing.

Environment:

  • pouch version (use pouch version):
BuildTime:       2017-11-19T16:57:07.198242422+08:00
GitCommit:       
GoVersion:       go1.9.1
KernelVersion:   
Os:              linux
Version:         0.1.0-dev
APIVersion:      vx.y.z
Arch:            amd64
  • OS (e.g. from /etc/os-release):
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
  • Kernel (e.g. uname -a):
Linux ist 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools:
make build
@pouchrobot pouchrobot added the kind/question all questions or confusion about this project label Nov 19, 2017
@HusterWan
Copy link
Contributor

also countered this problem, @gaocegege you should pull docker images like:
pouch pull docker.io/library/hello-world:latest
pouch set default registry address: docker.io, but likely not worked

@allencloud
Copy link
Collaborator

We will improve this part asap. This is a known insufficient.

@HusterWan
Copy link
Contributor

there also has a bug: client decode failed, because server return 200 ( should 500)
resp.WriteHeader(http.StatusInternalServerError) // this code does not worked
may i can fix this problem for you @allencloud

@allencloud
Copy link
Collaborator

It couldn't be better. Just submit PR and enjoy hacking. @HusterWan 👍

@gaocegege
Copy link
Contributor Author

gaocegege commented Nov 20, 2017

@HusterWan Thanks for your information

@skoowoo
Copy link
Contributor

skoowoo commented Nov 24, 2017

failed to decode: invalid character 'i' in literal false (expecting 'l') <===== The reason may be that the server side(pouchd) closed the connection, not http status code. The CLI read data from the tcp connection and decode them with json format, but not handle the error when connection closed. @HusterWan Welcome to post a PR to fix it, thanks.

@HusterWan
Copy link
Contributor

@skoo87 i am working on it, the problem maybe more complicated, golang ResponseWriter allow call WriteHeader only once, so if the server(pouchd)'s goroutine call ResponseWriter.Writer once when pull image, the http code will be set 200, and later call resp.WriteHeader(http.StatusInternalServerError) will not work .
https://golang.org/pkg/net/http/#ResponseWriter

so i am thinking maybe we can not only use http code to judge if pull image is ok

@HusterWan
Copy link
Contributor

@allencloud @skoo87 i create a pr to fix this problem, please review #160 , if there is any problem, you can ping me any time. 3x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/images kind/question all questions or confusion about this project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants