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.

(core): Docker stdout is not printed on error during bundling

See original GitHub issue

Describe the bug

In quite a few different scenarios, Docker errors simply happen and “Docker returned 1” gets spat out.

I suspect Docker is writing to stderr but it is getting squashed somewhere.

Expected Behavior

Docker outputs (both stdout and stderr are preserved)

Current Behavior

Docker’s error status isn’t printed

Reproduction Steps

  • Run cdk synth on a stack that requires docker, but without permissions to talk to Docker’s control plane
  • watch as it crashes and burns:
39907defbe84: Pull complete
8f7631647f07: Pull complete
d83e11d24ec9: Pull complete
b09b92bf5cf8: Pull complete
[WARNING] 
software.amazon.jsii.JsiiException: docker exited with status 1
Error: docker exited with status 1
    at dockerExec (/tmp/jsii-kernel-ENBrAx/node_modules/@aws-cdk/core/lib/bundling.js:355:15)
    at Function.fromBuild (/tmp/jsii-kernel-ENBrAx/node_modules/@aws-cdk/core/lib/bundling.js:243:9)
    at new Bundling (/tmp/jsii-kernel-ENBrAx/node_modules/@aws-cdk/aws-lambda-python/lib/bundling.js:28:86)
    at Function.bundle (/tmp/jsii-kernel-ENBrAx/node_modules/@aws-cdk/aws-lambda-python/lib/bundling.js:43:50)
    at new PythonFunction (/tmp/jsii-kernel-ENBrAx/node_modules/@aws-cdk/aws-lambda-python/lib/function.js:43:39)

The error that is being quashed here was Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=public.ecr.aws%2Fsam%2Fbuild-python3.7&tag=latest": dial unix /var/run/docker.sock: connect: permission denied

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
samyakbcommented, Aug 26, 2022

Dont know if its relative, but I had the same issue of docker-permission denied. After adding esbuild as devDependency resolved the error issue.

0reactions
arewacommented, Oct 13, 2022

Hi @RahulSurwade08, you could start with an empty Python stack, and the steps I mentioned in my previous comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker buildx build
docker buildx build: The `buildx build` command starts a build using BuildKit. This command is similar to the UI of `docker build` command ......
Read more >
Error 500.19 with 0x8007000d when running ASP.NET Core ...
In my case I had to reinstall the bundle even when it was previously installed and the executables were there. It might happen...
Read more >
Log creation and redirection with the ASP.NET Core Module
NET Core Module redirects stdout and stderr console output to disk if ... not while debugging locally and running the app with IIS...
Read more >
Deploying an ASP.NET core application with Elastic Beanstalk
Run the installer and follow the instructions. This tutorial uses a command line ZIP utility to create a source bundle that you can...
Read more >
Troubleshooting | Cypress Documentation
Print DEBUG logs. Cypress is built using the debug module. That means you can receive helpful debugging output by running Cypress with this...
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