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

Troubleshooting: 404 no such container - No such image #20

Open
koresar opened this issue Apr 26, 2016 · 14 comments
Open

Troubleshooting: 404 no such container - No such image #20

koresar opened this issue Apr 26, 2016 · 14 comments

Comments

@koresar
Copy link

koresar commented Apr 26, 2016

I ran $ autochecker 0.10.41 4.4.2 but the error message is somewhat misleading.

What does that mean? How to fix?

[1;1H[0Jautochecker Running tests in 2 different sessions
[2;1H[0J[2;1H0.10.41    - copying files
[2;1H[0J[2;1H0.10.41    - writing dockerfile
[2;1H[0J[2;1H0.10.41    - pulling image
[2;1H[0J[2;1H0.10.41    - building image
[2;1H[0J[2;1H0.10.41    - running container
Something went wrong when running the tests...
Error: HTTP code is 404 which indicates error: no such container - No such image: myprojectname_0.10.41:442f40bcf41634bc2479da52c42debc70ae3b12a

UPD: also, looks like the exit code was 0 (success).

@bahmutov
Copy link
Collaborator

I get this error a lot when I do multiple versions builds and I think this is due to Docker build process getting overwhelmed, more information about the error / logs would go the long way. I think for me this happens using docker 1.11.0 right now

@koresar
Copy link
Author

koresar commented Apr 26, 2016

Our docker daemon is not overwhelmed, in fact it's idle. We are using Docker 1.9 on AWS ECS though.

@victorb
Copy link
Owner

victorb commented Apr 26, 2016

Hm, this seems bad. Might be something funny with how the tag+image name is being generated and/or passed around. I'll take a look later.

However, whats even worse is that the exit code was 0... I'll try and fix this sooner but if anyone wants to take a look at where this could be, feel free.

Thanks for reporting this!

@victorb
Copy link
Owner

victorb commented Apr 26, 2016

@koresar the exit code should always be set to something that is not zero, can you check which version you have? Since there is no version command until right now (aef512d)

Regarding the "no such container - No such image", I'm still trying to reproduce it locally, by running all the examples and also running just autochecker with the 32 nodejs versions, but no luck so far...

@koresar
Copy link
Author

koresar commented Apr 27, 2016

Previously our Continuous Integration had these lines

npm install
npm test

It was running just fine.
I changed it to be

npm i -g autochecker
autochecker 0.10.41 4.4.2

The new output is
image
Yes, this returned the exit code 0.

As you can see the latest autochecker is installed each time a build happens.

But the good news is that we hit this roadblock now - #10 :)

@rawgni
Copy link

rawgni commented Apr 27, 2016

might be because DockerTemplate is not in the current directory ?

@koresar
Copy link
Author

koresar commented Apr 28, 2016

There is no DockerTempalte at all. Thus we are using the default one.
But, could it be related to the Dockerfile in the current directory?

@rawgni
Copy link

rawgni commented Apr 28, 2016

Might be due to an error in building the image.
Can you try doing just one version? ie. autochecker 0.10.44

@koresar
Copy link
Author

koresar commented Apr 28, 2016

Wow! An amazing guess @rawgni!
autochecker 0.10.41 actually worked! The error exit code is returned correctly. E.g. when tests fail the exit code is non zero.
Then I tried autochecker 0.10.41 4.4.2. It resulted with the same error as above.
Then I tried autochecker 4.4.2. It also worked just fine.

@rawgni
Copy link

rawgni commented Apr 28, 2016

autochecker --verbose 0.10.41 4.4.2 will show you the right exit code.

The problematic code is found in buildImage inside index.js

      stream.on('data', (chunk) => {
        if (verbose) {
          const parsed = JSON.parse(chunk.toString())
          var to_print = null
          if (parsed.status) {
            to_print = parsed.status
          }
          if (parsed.stream) {
            to_print = parsed.stream
          }
          if (parsed.error) {
            reject(parsed.error)
            return
          }
          ...

Error checking is turned of if there are multiple versions specified and no verbose flag given. Thus, any error in the stream will not be checked.

Should probably change it to:

      stream.on('data', (chunk) => {
          const parsed = JSON.parse(chunk.toString())
          if (parsed.error) {
            reject(parsed.error)
            return
          }
          if (verbose) {
             var to_print = null
             if (parsed.status) {
                to_print = parsed.status
             }
             if (parsed.stream) {
                to_print = parsed.stream
             }
          ...

@koresar
Copy link
Author

koresar commented Apr 28, 2016

Another bug. @victorbjelkholm
autochecker --verbose 0.10.41 4.4.2
Prints:
## Running tests in version 4.4.2 only
I expected it to run both.

Although, when I do this:
autochecker --verbose 0.10.41 0.10.42 4.4.2
it prints:
autochecker Running tests in 2 different sessions
(and it fails as in the screenshot above)

@victorb
Copy link
Owner

victorb commented Apr 29, 2016

Thanks a lot @koresar and @rawgni for digging into this, I can't express how thankful I am for you helping out tracking this down!

So I've just pushed a new change, that should show errors better and give the proper error code. Please try it out and let me know how it goes. (version 0.9.1).

@koresar regarding that, you'll need to put the --verbose flag in the end of the command. In this case:

autochecker --verbose 0.10.41 0.10.42 4.4.2

0.10.41 becomes an argument to --verbose instead of being a thing of it's own. So do

autochecker 0.10.41 0.10.42 4.4.2 --verbose 

instead and it should work fine.

@koresar
Copy link
Author

koresar commented May 1, 2016

Ran autochecker 0.10.42 4.4.2 --verbose using v0.9.1. So far so good. Will continue testing.
Amazing module @victorbjelkholm
Thank you very much for the quick fix :)

@koresar
Copy link
Author

koresar commented May 2, 2016

Nope. No go.

Command line

npm i -g autochecker@latest
echo running autochecker
autochecker 4 --verbose

Output

## Running tests in version 4 only
4 - copying files
4 - writing dockerfile
4 - pulling image mhart/alpine-node:4
Pulling from mhart/alpine-node
Digest: sha256:82b15570cf58aebd5acc4208e5c3d4dd3fca6b5bcde094377c74516c291ad8b7
Status: Image is up to date for mhart/alpine-node:4
4 - building image
...SNIP...
4 - running container
Error: HTTP code is 404 which indicates error: no such container - No such image: @safetyculture/base-npm-module_4:cf1a36c1d09e8db3e131ac1603f324659fa947b2

Although, the executable always returns correct exit code. Which is good!

I'm trying to test the private npm module. Could the problem be the container name?
@safetyculture/base-npm-module_4:cf1a36c1d09e8db3e131ac1603f324659fa947b2
Docker or autochecker cannot handle the @ or / symbol or something? @victorbjelkholm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants