Aws-cdk: If Docker is not installed locally, CDK deploy can fail without a constructive error message (possibly related to Fargate use)

Created on 21 May 2020  ·  7Comments  ·  Source: aws/aws-cdk

I have been building an app in CDK (lambda, fargate, sqs) with some success. I moved laptops for development, and while I installed CDK, AWS CLI etc etc, I did not install Docker as it did not seem required.

When trying to edit and deploy the app, I received an indistinct error while uploading assets:

> cdk "deploy"
FargateTaskRunnerDemoStack: deploying...
[0%] start: Publishing 0292d7d7c3f136659900411d2bec852eaf37d05f9e4b76cf33eb64270417463a:current
[50%] success: Published 0292d7d7c3f136659900411d2bec852eaf37d05f9e4b76cf33eb64270417463a:current
[50%] start: Publishing f78183504c75718fb00baea6f901199db893eddc04d21e426e8cad10f1f021a0:current
[100%] fail: write EPIPE
 ❌  FargateTaskRunnerDemoStack failed: Error: Failed to publish one or more assets. See the error messages above for more information.

It took a while to understand that this was because Docker was not installed or available.

Conversely, if Docker is installed _but not enabled_, then the error case is more descriptive:

[50%] start: Publishing 7a1e3989751f91a191cd33edf97f22ef63c06ad34f01895a7af11a3e32e3a97a:current
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[100%] fail: docker build --tag cdkasset-7a1e3989751f91a191cd33edf97f22ef63c06ad34f01895a7af11a3e32e3a97a . exited with error code 1

I'm not expert enough to know whether this is due to the use of Fargate within the application itself, but a more useful error message in the first example would have really helped!

Reproduction Steps

  • Be on MacOS
  • Install CDK, AWS CLI
  • Do not install Docker
  • Try to build application (possibly dependent on use of FargateTaskDefinition() )
  • Receive indistinct error message

Error Log

[50%] start: Publishing f78183504c75718fb00baea6f901199db893eddc04d21e426e8cad10f1f021a0:current
[100%] fail: write EPIPE
 ❌  FargateTaskRunnerDemoStack failed: Error: Failed to publish one or more assets. See the error messages above for more information.

In a way it's the lack of errors that is the problem! :)

Environment

  • CLI Version : 2.0.14
  • Framework Version: 1.36.0
  • OS : MacOS 10.15.4
  • Language : English

This is :bug: Bug Report

@aws-cdaws-ecs guidance

Most helpful comment

That all makes sense and is fair enough - false positives definitely do not help while debugging.

If a specific error message can't be added for this situation, hopefully having it on this page is enough for someone to find when they come across it later on!

All 7 comments

Hey @davidwhewell As of today the publisher construct does not try to further distinguish the generic EPIPE error to figure out the root cause and I'm afraid it's going to be hard to actually achieve what you want.

It's not great that the error message is unclear but since EPIPE can be caused by various other reasons, it will be even worse if we mislead users into believing there's something wrong with their Docker installation when that may or may not be the actual problem.

Also, the more explicit error message in the second case actually came from Docker client not CDK if I remember correctly.

That all makes sense and is fair enough - false positives definitely do not help while debugging.

If a specific error message can't be added for this situation, hopefully having it on this page is enough for someone to find when they come across it later on!

Thanks for understanding. I will close this issue for now. Feel free to re-open it or create a new issue if anything comes up. Stay healthy & safe!

Thanks, same to you!

On Thu, 4 Jun 2020 at 17:56, Yenlin Chen notifications@github.com wrote:

Thanks for understanding. I will close this issue for now. Feel free to
re-open it or create a new issue if anything comes up. Stay healthy & safe!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aws/aws-cdk/issues/8133#issuecomment-638980100, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AEXL2CSJLF63CWWVVERVW6LRU7G3LANCNFSM4NG7MCYA
.

We just encountered this and after reading the comments here, it's still not very clear how to solve this issue (or at least start debugging). Do you have any suggestions on where to start looking?

If this is regarding the message due to the lack of a Docker installation,
installing Docker on the local machine would resolve the issue.

If it is about a general EPIPE error without context (such as is given
without Docker being installed), then I agree right now it is hard to know
where to start looking!

On Fri, 12 Jun 2020 at 09:04, Dzhuneyt notifications@github.com wrote:

We just encountered this and after reading the comments here, it's still
not very clear how to solve this issue (or at least start debugging). Do
you have any suggestions on where to start looking?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aws/aws-cdk/issues/8133#issuecomment-643134633, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AEXL2CQ2DKOCX5L2CELF6UDRWHOQ5ANCNFSM4NG7MCYA
.

I think we could all agree that "Docker not installed" would be a much better message than EPIPE related errors.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nzspambot picture nzspambot  ·  3Comments

kawamoto picture kawamoto  ·  3Comments

cybergoof picture cybergoof  ·  3Comments

eladb picture eladb  ·  3Comments

v-do picture v-do  ·  3Comments