localstack / serverless-localstack

⚡ Serverless plugin for running against LocalStack
511 stars 82 forks source link

Localstack deployment fails #233

Closed MarioSimou closed 8 months ago

MarioSimou commented 10 months ago

When I deploy my code in a locastack container, the cloudformation deployment fails and I am not sure why. Initially I thought is a bundler issue, so I tested it with webpack and esbuild, but unfortunately the issue persists in both of them. I have also tested the issue with different versions of localstack(v1.4, v2.2). In all cases the deployment failed.

Below, you will find the error message I get: serverless-localstack-deployment-error

I have aslo created this repository.

Steps to reproduce:

whummer commented 9 months ago

Hi @MarioSimou , thanks for reporting. Can you please enable DEBUG=1 in the LocalStack container environment, and then share the detailed debug logs here? This would be very helpful for us to reproduce and resolve this issue. Thanks for your help!

MarioSimou commented 9 months ago

Okay, I found the issue. I am not sure if its written anywhere in the documentation, but the localstack container needs to have the docker volume (/var/run/docker.sock:/var/run/docker.sock) attached to it. If not, cloudformation fails with an error similar to the one I shared above.

Do you think I should add this issue in the readme?

steffyP commented 8 months ago

Hi @MarioSimou,

great to hear that identified the problem! So we could close the ticket, or do you still have any issues?

We do have a documentation, respectively an example of the docker-compose.yml in our docs here. It also states that the mount is required for lambda to work:

Mounting the Docker socket /var/run/docker.sock as a volume is required for the Lambda service. Check out the Lambda providers documentation for more information.

Would you still expect additional information in our docs?

MarioSimou commented 8 months ago

Feel free to close it then. Thanks