Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Rommmmm opened this issue Sep 12, 2024 · 3 comments
Open
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@Rommmmm
Copy link

Rommmmm commented Sep 12, 2024

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 Rommmmm added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Sep 12, 2024
@hnnasit
Copy link
Contributor

hnnasit commented Sep 12, 2024

Hi @Rommmmm, thanks for reporting the issue. Could you provide the SAM CLI version with issue and the previous version it was working for? Which runtime is the issue happening for? Can you also provide the Operating System you encountered the issues in?

@hnnasit hnnasit added blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Sep 12, 2024
@Rommmmm
Copy link
Author

Rommmmm commented Sep 12, 2024

hey @hnnasit currently im running latest version 1.123.0 of sam cli. unfortunately i dont remember the previous version this was working OS details are:
Amazon Linux release 2023.5.20240819 (Amazon Linux)
cpe:2.3:o:amazon:amazon_linux:2023
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023.5.20240819"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/amazon-linux-2023/"
DOCUMENTATION_URL="https://docs.aws.amazon.com/linux/"
SUPPORT_URL="https://aws.amazon.com/premiumsupport/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
VENDOR_NAME="AWS"
VENDOR_URL="https://aws.amazon.com/"
SUPPORT_END="2028-03-15"
VARIANT_ID="202408281733-2023.214.0"
Amazon Linux release 2023.5.20240819 (Amazon Linux)
cpe:2.3:o:amazon:amazon_linux:2023

runtime is python 3.12

@hnnasit
Copy link
Contributor

hnnasit commented Sep 16, 2024

Hi @Rommmmm, was the binary generated using SAM CLI? Could you provide the steps to generate the binary? Also some --debug logs would be useful to see what's happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.
Projects
None yet
Development

No branches or pull requests

2 participants