lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment
MIT License
5.83k stars 431 forks source link

Bad file descriptor error #261

Closed izhangzhihao closed 4 years ago

izhangzhihao commented 4 years ago

Hi, I'm just seen this error

Failed to write to log, write a: bad file descriptor

By doing almost the same things in python 3.7:

docker run -v "$PWD":/var/task lambci/lambda:build-python3.7 /bin/sh -c "pip install -r requirements.txt -t libs;cp /var/rapid/init /var/runtime/init;/var/runtime/init --bootstrap /var/runtime/bootstrap"

The command basically doing the missing part of the build image.

Did anyone know how to fix this?

izhangzhihao commented 4 years ago

If i choose to use the run image, it works:

docker run --rm -v "$PWD":/var/task -v build:/var/lang/lib/python3.7/site-packages lambci/lambda:python3.7 handler.handle '{}'