Skip to content

Lambda ASP.NET Core Minimal API complains about missing 'libhostpolicy.so' library when deployed #1512

@baynezy

Description

@baynezy

Describe the bug

I have created a vanilla project from the Lambda ASP.NET Core Minimal API template. I have called it ProfileAPI. I have deployed it via Terraform to AWS. The function will not execute successfully.

Expected Behavior

The function should allow me to execute the / route and the Calculator routes in the template.

Current Behavior

Via API GW I get a 500 Internal Server Error. If I trigger it via the AWS console using the apigateway-api-proxy template I get the following error:-

{
  "errorType": "Runtime.ExitError",
  "errorMessage": "RequestId: 899a669f-cbd3-43cb-b06a-24398aea22df Error: Runtime exited with error: exit status 131"
}
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/var/task/'.
Failed to run as a self-contained app.
- The application was run as a self-contained app because '/var/task/ProfileAPI.runtimeconfig.json' did not specify a framework.
- If this should be a framework-dependent app, specify the appropriate framework in '/var/task/ProfileAPI.runtimeconfig.json'.
START RequestId: 899a669f-cbd3-43cb-b06a-24398aea22df Version: $LATEST
RequestId: 899a669f-cbd3-43cb-b06a-24398aea22df Error: Runtime exited with error: exit status 131
Runtime.ExitError
END RequestId: 899a669f-cbd3-43cb-b06a-24398aea22df
REPORT RequestId: 899a669f-cbd3-43cb-b06a-24398aea22df	Duration: 162.41 ms	Billed Duration: 163 ms	Memory Size: 128 MB	Max Memory Used: 3 MB	

Reproduction Steps

  1. Create a new project from Lambda ASP.NET Core Minimal API template.
  2. Publish to AWS with relevant roles and API GW integration
  3. Test function

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Amazon.Lambda.AspNetCoreServer.Hosting 1.5.1

Targeted .NET Platform

net6.0

Operating System and version

Amazon Lambda

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions