docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 288 forks source link

Docker AWS Lambda Function Test Flooded with NUL values in terminal #5112

Closed dimvoly closed 4 years ago

dimvoly commented 4 years ago

Expected behavior

I'm using AWS with the SAM CLI to deploy and test the AWS Lambda functions written in dotnetcore2.1.

Running the basic helloworld:

sam build
sam local invoke HelloWorldFunction -e .\events\event.json > output.txt

The terminal itself gives you:

Invoking HelloWorld::HelloWorld.Function::FunctionHandler (dotnetcore2.1)
2019-11-10 10:38:57 Found credentials in shared credentials file: ~/.aws/loginusercredentials

Fetching lambci/lambda:dotnetcore2.1 Docker container image......
Mounting C:\Users\Dim\Dropbox\Projects\Active\2019-11-02 VSCode\ServerLessAPI\.aws-sam\build\HelloWorldFunction as /var/task:ro,delegated inside runtime container
START RequestId: 3e241658-9574-4580-896a-70e0ab18816e Version: $LATEST
END  RequestId: 3e241658-9574-4580-896a-70e0ab18816e
REPORT RequestId 3e241658-9574-4580-896a-70e0ab18816e   Duration: 2033 ms       Billed Duration: 2100 ms        Memory Size 128 MB      Max Memory Used: 45 MB

The output.txt should give you:

{"statusCode":200,"headers":{"Content-Type":"application/json"},"multiValueHeaders":null,"body":"{\"message\":\"hello world, Laura!\",\"location\":\"119.214.83.148\"}","isBase64Encoded":false}

Actual behavior

However, since today, I've been getting the following in output.txt:

{"statusCode":200,"headers":{"Content-Type":"application/json"},"multiValueHeaders":null,"body":"{\"message\":\"hello world, Laura!\",\"location\":\"119.214.83.148\"}","isBase64Encoded":false}NULNULNULNULNULNULNUL...

The text file generated is ~12MB big and has ~6-7mil columns in it with the correct output followed by many NULs. When I test the function without piping to output.txt, the AWS SAM CLI reports this as a time out, despite the fact that initially the correct response is received, it is just the many NULs that ruin it.

Uploading the exact same function to AWS Lambda runs it fine no problem, but is obviously a much slower way of developing things (not to mention no provision to debug). I've tried this on 3 different AWS Lambda functions and am getting the same results so is either an issue with AWS SAM or Docker.

Information

Steps to reproduce the behavior

I'm not sure I can provide a step by step reproduction in this case as the code hadn't changed it is something with my environment that I can't seem to pinpoint. I have not messed around with any settings since yesterday, when the local invocations worked fine.

Any help appreciated!

dimvoly commented 4 years ago

Apparently a problem (that has since been resolved) with SAM CLI, not Docker: https://github.com/awslabs/aws-sam-cli/issues/1517

docker-robott commented 4 years ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked