wave icon indicating copy to clipboard operation
wave copied to clipboard

Invalid error when pulling a failing build

Open pditommaso opened this issue 1 year ago • 7 comments

When pulling a container for which the build reports an error, the docker pull message should report the build error message.

Instead the generic error message shown below is displayed. For example, consider the following Dockerfile

FROM alpine  
RUX echo Hello

then

» wave -f Dockerfile 
wave.seqera.io/wt/f818a5c57427/wave/build:41ca856abe43de2e

» docker pull wave.seqera.io/wt/f818a5c57427/wave/build:41ca856abe43de2e

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview wave.seqera.io/wt/f818a5c57427/wave/build:41ca856abe43de2e
Error response from daemon: failed to resolve reference "wave.seqera.io/wt/f818a5c57427/wave/build:41ca856abe43de2e": unexpected status from HEAD request to https://wave.seqera.io/v2/wt/f818a5c57427/wave/build/manifests/41ca856abe43de2e: 400 Bad Request

Instead this message should be reported

#1 [internal] load build definition from Containerfile
#1 transferring dockerfile: 69B 0.0s done
#1 DONE 0.1s
Containerfile:2
--------------------
   1 |     FROM alpine  
   2 | >>> RUX echo Hello
   3 |     
--------------------
error: failed to solve: dockerfile parse error on line 2: unknown instruction: RUX (did you mean RUN?)

pditommaso avatar Jul 11 '24 16:07 pditommaso

in local I am getting the correct error:

(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % wave -f Dockerfile_Invalid --wave-endpoint http://localhost:9090                            
cace-85-136-67-71.ngrok-free.app/wt/XXXXXXXX/wave/build/dev:aaebbebb23dfb16b
(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % docker pull cace-85-136-67-71.ngrok-free.app/wt/XXXXXXX/wave/build/dev:aaebbebb23dfb16b

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview cace-85-136-67-71.ngrok-free.app/wt/XXXXXXXX/wave/build/dev:aaebbebb23dfb16b
Error response from daemon: unknown: #1 [internal] load build definition from Containerfile
#1 transferring dockerfile: 66B done
#1 DONE 0.0s
Containerfile:2
--------------------
   1 |     FROM alpine
   2 | >>> RUX echo Hello
--------------------
error: failed to solve: dockerfile parse error on line 2: unknown instruction: RUX (did you mean RUN?)

munishchouhan avatar Jul 12 '24 10:07 munishchouhan

@pditommaso did you already fixed it? because in prod also I am getting correct error

(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % wave -f Dockerfile_Invalid                                                                  
wave.seqera.io/wt/xxxxxxxx/wave/build:fe0d311df2ef561f
(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % docker pull wave.seqera.io/wt/xxxxxxxxx/wave/build:fe0d311df2ef561f

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview wave.seqera.io/wt/xxxxxxxx/wave/build:fe0d311df2ef561f
Error response from daemon: unknown: #1 [internal] load build definition from Containerfile
#1 transferring dockerfile: 66B 0.0s done
#1 DONE 0.1s
Containerfile:2
--------------------
   1 |     FROM alpine
   2 | >>> RUX echo Hello
--------------------
error: failed to solve: dockerfile parse error on line 2: unknown instruction: RUX (did you mean RUN?)

munishchouhan avatar Jul 12 '24 10:07 munishchouhan

No I didn't. Please try stage or prod

pditommaso avatar Jul 12 '24 10:07 pditommaso

in stage:

(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % wave -f Dockerfile_Invalid --wave-endpoint https://wave.stage-seqera.io           
wave.stage-seqera.io/wt/xxxxxxx/wave/build/stage:a0a7f21f0c6f6ad1
(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % docker pull wave.stage-seqera.io/wt/xxxxxxx/wave/build/stage:a0a7f21f0c6f6ad1

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview wave.stage-seqera.io/wt/xxxxxxxx/wave/build/stage:a0a7f21f0c6f6ad1
Error response from daemon: unknown: #1 [internal] load build definition from Containerfile
#1 transferring dockerfile: 66B 0.0s done
#1 DONE 0.0s
Containerfile:2
--------------------
   1 |     FROM alpine
   2 | >>> RUX echo Hello
--------------------
error: failed to solve: dockerfile parse error on line 2: unknown instruction: RUX (did you mean RUN?)

and this is in prod: https://github.com/seqeralabs/wave/issues/563#issuecomment-2225296353

munishchouhan avatar Jul 12 '24 11:07 munishchouhan

This is still happening, try enabling freeze option

pditommaso avatar Jul 25 '24 14:07 pditommaso

yes, it happens with freeze

/bin/zsh /Users/munish.chouhan/testing_ground/wave_testing/buiild_images_prod.sh
docker.io/hrma017/dev:04186797ac16c388
(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % docker pull docker.io/hrma017/dev:04186797ac16c388

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview docker.io/hrma017/dev:04186797ac16c388
Error response from daemon: manifest for hrma017/dev:04186797ac16c388 not found: manifest unknown: manifest unknown

munishchouhan avatar Jul 25 '24 15:07 munishchouhan

In case of freeze, pull request directly goes to build repository and because the build fails there is no manifest there, so the error is correct in this case too.

munishchouhan avatar Jul 31 '24 13:07 munishchouhan