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.52k stars 1.17k forks source link

Bug: Dotnet 8 Container Image Arm64 Issue #7691

Open SilasCrosby opened 3 hours ago

SilasCrosby commented 3 hours ago

Description:

Getting non-zero code 139 when updating dotnet 6 docker file to dotnet 8, for container lambda functions, also occurs on sam init with hello world container lambda function creation.

Steps to reproduce:

sam init hello world, select container image type.

add "function-architecture": "arm64",

change build image to FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-arm64v8 AS build-image

delete Samconfig.toml

Change Template to include Architectures:

Observed result:

Error: The command '/bin/sh -c dotnet tool install -g Amazon.Lambda.Tools' returned a non-zero code: 139

Expected result:

sam build successfully.

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

WSL2 Ubuntu 20.04 on Windows 11 24H2

  1. WSL2 Ubuntu 20.04 on Windows 11 24H2
  2. sam --version
  3. AWS region 'us-east-1'

# Paste the output of `sam --info` here
{
  "version": "1.127.0",
  "system": {
    "python": "3.11.10",
    "os": "Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.31"
  },
  "additional_dependencies": {
    "docker_engine": "27.2.1",
    "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"
  ]
}

Still the same: 
2024-11-15 16:05:15,958 | Telemetry response: 200                                                                                                                                                                                                                                                                      
Error: The command '/bin/sh -c dotnet tool install -g Amazon.Lambda.Tools' returned a non-zero code: 139
2024-11-15 16:05:15,967 | Telemetry response: 200     
mndeveci commented 2 hours ago

change build image to FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-arm64v8 AS build-image

Thanks for reporting this issue, may I ask why did you change the image before starting the build? Does building succeed if you use the original image?