aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.49k stars 1.17k forks source link

Permission denied: '/tmp/samcli/source/gradlew' when building aws-sam-cli-build-image-java11 #6934

Closed JozefKsl closed 4 months ago

JozefKsl commented 4 months ago

Description:

My build is failing when running the below build command, the error says: Permission denied: '/tmp/samcli/source/gradlew'

sam build --use-container \
     --build-image MyFunction=amazon/aws-sam-cli-build-image-java11

Steps to reproduce:

  1. Create a simple lambda function in java.
  2. Try to build the function using this image https://hub.docker.com/r/amazon/aws-sam-cli-build-image-java11 using the command above.

Observed result:

Build fails with this error Error: [Errno 13] Permission denied: '/tmp/samcli/source/gradlew'

Expected result:

Successful build.

Additional environment details (Ex: Windows, Mac)

  1. OS: macOS Sonoma 14.4.1
  2. sam --version: SAM CLI, version 1.114.0
  3. AWS region: us-east-1
{
  "version": "1.114.0",
  "system": {
    "python": "3.12.2",
    "os": "macOS-14.4.1-arm64-arm-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "25.0.3",
    "aws_cdk": "Not available",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}

Add --debug flag to command you are running

jysheng123 commented 4 months ago

Hi, thanks for bringing up the issue. I was not able to reproduce the error using a simple Java project creating using sam init, would it be possible for you to provide a sample project you are failing on so I can accurately reproduce and debug the issue?

JozefKsl commented 4 months ago

@jysheng123 You're right, it works fine with other projects, I wasn't able to find out why it fails with mine, I just rewrote my code to python.

github-actions[bot] commented 4 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.