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

Bug: macos temp folder access #7903

Open
victorherraiz opened this issue Feb 26, 2025 · 0 comments
Open

Bug: macos temp folder access #7903

victorherraiz opened this issue Feb 26, 2025 · 0 comments
Labels
stage/bug-repro The issue/bug needs to be reproduced stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Comments

@victorherraiz
Copy link

victorherraiz commented Feb 26, 2025

Description:

Pointing codeUri to a Jar makes sam local invoke fail with a ClassNotFound exception.

Steps to reproduce:

  • Create a jar, for example, with spring cloud funtion and shade plugin.
  • Point CodeUri to that jar
  • Use sam local invoke

Observed result:

Fails with class not found

Reading invoke payload from stdin (you can also pass it from file with --event)                                                                                                                              
No current session found, using default AWS::AccountId                                                                                                                                                       
Invoking org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest (java17)                                                                                                              
Decompressing /Users/xxxxx/Development/lambda-poc/target/lambda-poc-0.0.1-SNAPSHOT-aws.jar                                                                                                                 
Local image is up-to-date                                                                                                                                                                                    
Using local image: public.ecr.aws/lambda/java:17-rapid-x86_64.                                                                                                                                               
                                                                                                                                                                                                             
Mounting /private/var/folders/r1/95s71fv17f303pknw2pl9dr9054q4w/T/tmpghccrvaj as /var/task:ro,delegated, inside runtime container                                                                            
START RequestId: c78b3418-3963-4859-9355-6bb4f9bdce41 Version: $LATEST
Picked up JAVA_TOOL_OPTIONS: -XX:+TieredCompilation -XX:TieredStopAtLevel=1
Class not found: org.springframework.cloud.function.adapter.aws.FunctionInvoker: java.lang.ClassNotFoundException
java.lang.ClassNotFoundException: org.springframework.cloud.function.adapter.aws.FunctionInvoker
        at java.base/java.net.URLClassLoader.findClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)

END RequestId: 5aecbeea-f15d-4c30-b8af-ab9cf062c571
REPORT RequestId: 5aecbeea-f15d-4c30-b8af-ab9cf062c571  Init Duration: 0.90 ms  Duration: 480.85 ms     Billed Duration: 481 ms Memory Size: 1024 MB    Max Memory Used: 1024 MB        
{"errorMessage": "Class not found: org.springframework.cloud.function.adapter.aws.FunctionInvoker", "errorType": "java.lang.ClassNotFoundException"}

Expected result:

The functions gets executed.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS MacOS
  2. SAM CLI, version 1.134.0
{
  "version": "1.134.0",
  "system": {
    "python": "3.13.2",
    "os": "macOS-14.7.4-arm64-arm-64bit-Mach-O"
  },
  "additional_dependencies": {
    "docker_engine": "27.4.0",
    "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"
  ]
}

Workaround

export TMPDIR=/Users/xxxxx/Development/lambda-poc/temp
@victorherraiz victorherraiz added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Feb 26, 2025
@seshubaws seshubaws added the stage/bug-repro The issue/bug needs to be reproduced label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/bug-repro The issue/bug needs to be reproduced stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

No branches or pull requests

2 participants