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

Pull specific images using --docker-auto-pull option #4598

Closed
falsandtru opened this issue Feb 20, 2019 · 10 comments
Closed

Pull specific images using --docker-auto-pull option #4598

falsandtru opened this issue Feb 20, 2019 · 10 comments

Comments

@falsandtru
Copy link

@falsandtru falsandtru commented Feb 20, 2019

General summary/comments (optional)

Steps to reproduce

Expected

Pull a suitable image automatically.

Actual

$ stack --docker-auto-pull install
Error: No such object: fpco/stack-build:lts-13.8
Received ExitFailure 1 when running
Raw command: /snap/bin/docker inspect fpco/stack-build:lts-13.8
Standard output:

[]

Stack version

$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository
@falsandtru falsandtru changed the title --docker-auto-pull option doesn't pull specific images Pull specific images using --docker-auto-pull option Feb 20, 2019
@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Mar 4, 2019

Hi @falsandtru, thanks for raising this issue. What happens if you try it again, now? Please run with --verbose and paste the verbose log output here.

Loading

@falsandtru
Copy link
Author

@falsandtru falsandtru commented Mar 4, 2019

$ stack --docker-auto-pull --verbose install
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
2019-03-05 04:08:10.688835: [debug] Checking for project config at: .../haskell-examples/stack.yaml
2019-03-05 04:08:10.690173: [debug] Loading project config file stack.yaml
2019-03-05 04:08:10.694951: [debug] Run process: /snap/bin/docker --version
2019-03-05 04:08:10.966740: [debug] Process finished in 272ms: /snap/bin/docker --version
2019-03-05 04:08:10.967757: [debug] Run process: /snap/bin/docker inspect fpco/stack-build:lts-13.9
Error: No such object: fpco/stack-build:lts-13.9
Received ExitFailure 1 when running
Raw command: /snap/bin/docker inspect fpco/stack-build:lts-13.9
Standard output:

[]

Loading

@falsandtru
Copy link
Author

@falsandtru falsandtru commented Mar 4, 2019

repro:

  1. clone https://github.com/falsandtru/haskell-examples
  2. run stack --docker --docker-auto-pull --verbose install

Loading

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Mar 4, 2019

That docker inspect command is failing for me, on arch

Loading

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Mar 4, 2019

Yet after a docker pull fpco/stack-build:lts-13.10 I can run docker inspect fpco/stack-build:lts-13.10 (though not any other version).

Loading

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Mar 4, 2019

@borsboom Would you take a look, please. My docker is:

Docker version 18.09.0-ce, build 4d60db472b

Note also that docker inspect fpco/stack-build works.

I wonder if the behaviour of inspect has changed?

Loading

@borsboom
Copy link
Contributor

@borsboom borsboom commented Mar 5, 2019

@falsandtru I'm able to reproduce this locally.

@dbaynard The behaviour you're describing is what I would expect. docker inspect is supposed to fail if you don't have the image locally. Stack tries running it to determine whether you have the image, and is then supposed to docker pull the image if that fails with a message that indicates the image isn't there. Something seems to be going wrong in that process, though.

Loading

@borsboom
Copy link
Contributor

@borsboom borsboom commented Mar 6, 2019

It looks like, at some point, reading the standard output of docker inspect in the case where it exits with an error stopped working, so stack isn't detecting that the error is due to missing image rather than being some other general error.

Loading

@borsboom
Copy link
Contributor

@borsboom borsboom commented Mar 6, 2019

PR with fix: #4604

Loading

snoyberg added a commit that referenced this issue Mar 13, 2019
…pull

Docker: fix pull missing images with `--docker-auto-pull` (fixes #4598)
@snoyberg
Copy link
Contributor

@snoyberg snoyberg commented Mar 19, 2019

This was fixed in #4604, closing.

Loading

@snoyberg snoyberg closed this Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants