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

If Docker is not installed locally, CDK deploy can fail without a constructive error message (possibly related to Fargate use) #8133

Closed
davidwhewell opened this issue May 21, 2020 · 8 comments
Assignees
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container guidance Question that needs advice or information.

Comments

@davidwhewell
Copy link

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 Report

@davidwhewell davidwhewell added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 21, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label May 26, 2020
@piradeepk piradeepk added guidance Question that needs advice or information. and removed bug This issue is a bug. labels Jun 1, 2020
@piradeepk piradeepk assigned hencrice and kohidave and unassigned uttarasridhar Jun 1, 2020
@piradeepk piradeepk removed the needs-triage This issue or PR still needs to be triaged. label Jun 1, 2020
@hencrice
Copy link
Contributor

hencrice commented Jun 3, 2020

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.

@davidwhewell
Copy link
Author

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!

@hencrice
Copy link
Contributor

hencrice commented Jun 4, 2020

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!

@hencrice hencrice closed this as completed Jun 4, 2020
@davidwhewell
Copy link
Author

davidwhewell commented Jun 4, 2020 via email

@Dzhuneyt
Copy link
Contributor

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?

@davidwhewell
Copy link
Author

davidwhewell commented Jun 12, 2020 via email

@Dzhuneyt
Copy link
Contributor

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

@arthurroco
Copy link

When you say that the first error message is because docker wasn't installed, Do you want to say client side or server side? Because I'm cloning a project, installed all dependencies and when I execute cdk deploy I'm receiving the same error message.

[100%] fail: Unable to execute 'docker' in order to build a container asset. Please install 'docker' and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

8 participants