question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sam deploy fails if Docker is not running

See original GitHub issue

Description:

Running sam deploy fails if Docker is not running

Steps to reproduce:

  • Stop Docker daemon
  • Run sam deploy

Observed result:

4 nested exceptions:

ConnectionRefusedError: [Errno 61] Connection refused
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: macOS 10.15.7
  2. sam --version: SAM CLI, version 1.13.1

Add --debug flag to command you are running

I tracked it down to here but there could be others.

https://github.com/aws/aws-sam-cli/blob/d2917102ef56ac05b9973f96c716612f9638bb62/samcli/commands/package/package_context.py#L103

This is a rare problem on local environment but I noticed it in a Jenkins environment where Docker is not available and this blocks new deployments. I am guessing this is related to support for Lambda Container Images.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
wnkzcommented, Dec 7, 2020

@prenx4x FYI, I’m pretty sure this has been caused by https://github.com/aws/aws-sam-cli/commit/387f7319bd333b832bf3d88916d79314c633138b and that Pipenv never updated that dependency ; I don’t know if it’s a Pipenv bug but it might happen to others using Pipenv. Checking docker version might help if other users are reporting this.

0reactions
prenx4xcommented, Dec 7, 2020

Thanks @wnkz for letting us know the root cause. I will go ahead and close this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS SAM CLI troubleshooting - AWS Documentation
Troubleshoot error messages when using, installing, and managing the AWS Serverless Application Model Command Line Interface (AWS SAM CLI).
Read more >
Can't run AWS SAM CLI under Docker - Stack Overflow
Disabling SELinux in the Docker daemon (or enabling it). Running Docker under privileged mode (or not). I get the same error using an...
Read more >
SAM & Docker Builds-- How do they update (not working for ...
TLDR' Sam deploy for docker images not recognizing changes to Dockerfile or app.py. Using this terrific blog post--> ...
Read more >
circleci/aws-sam-serverless@4.0.0
Deploy a Lambda Docker container via SAM ... If this option is set, the SAM package command will be run ... no-fail-on-empty-changeset.
Read more >
Invoking AWS Lambda functions locally using AWS SAM CLI
This is the error message that you will see when you run sam local invoke without Docker. sam local invoke -e event.json. Error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found