aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Add debug messages for docker mounts

Open maxheyer opened this issue 6 years ago • 4 comments

Description

To debug mount problems within docker it would be great to have some debug messages about what is being mounted into the lambci container.

Additional Details

I try to debug the error below (What means there is no file named index.js): Unable to import module 'index': Error at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18)

maxheyer avatar May 20 '19 09:05 maxheyer

We already log what is being mounted and where in the output: https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/local/docker/container.py#L87

Is that not enough?

jfuss avatar May 20 '19 14:05 jfuss

To debug the issue discussed in slack it would be great to see what files are being mounted into the lambci container. With the current output it's not possible to ensure if the contents of the directory are being mounted correctly.

maxheyer avatar May 21 '19 08:05 maxheyer

If they are not getting mounted correctly, it could very well be a docker permissions issue. Have you tried sharing the appropriate directory?

sriram-mv avatar May 23 '19 15:05 sriram-mv

The issue with my mounts are the same as reported in https://github.com/awslabs/aws-sam-cli/issues/181. I just opened this issue to give more debug messages to people who will have the same issue in the future. @TheSriram

maxheyer avatar May 23 '19 15:05 maxheyer

Closing this due to age. As stated above, we do say what directory we are mounting. I recall docker not giving us anyway to know if the mount was successful, so we mount and assume docker handles things correctly. If this is still something you would like us to do, feel free to create a new issue (closed issues are hard to track).

jfuss avatar Aug 30 '22 20:08 jfuss