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

Binary execution issues in SAM CLI container due to read-only file system

Open Rommmmm opened this issue 5 months ago • 3 comments

We've encountered a recent change in behavior when executing binaries within the SAM CLI container environment. Previously, we were able to execute a binary from within our project's directory hierarchy without issue. However, we're now experiencing a "read-only file system" error which prevents the binary from running unless it is placed in the /tmp directory.

This change is significantly impacting our development workflow. Moving the binary to /tmp requires us to rebuild the container on every code change, rather than just updating the code and re-invoking the lambda, which was possible before.

Steps to reproduce

  1. Place a binary file in the project directory.
  2. Using the a default template.yaml
  3. Attempt to execute that binary from within a Lambda function running in the SAM CLI container (sam local start-api).
  4. Observe the "read-only file system" error that prevents execution ([Errno 2] No such file or directory:).

Observed result

The binary cannot execute unless it's placed in /tmp, due to the read-only file system error.

Expected result

The binary should be executable within the project directory hierarchy, as it was previously.

Currently our workaround is to create a dockerfile with the binary copied to /tmp and it works but as i wrote each code change requires building and its slowing the work

Thank you for your support.

Rommmmm avatar Sep 12 '24 06:09 Rommmmm