Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug: Lambda Execution environment startup failedΒ #8565

Closed
@CynanX

Description

@CynanX

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I've a Quarkus based Java lambda which I can create but cannot execute as I get an initialisation error which then loops. I tried starting Localstack in debug but I do not see any other errors shown.

In one terminal I start localstack with:

     __                     _______ __             __
    / /   ____  _________ _/ / ___// /_____ ______/ /__
   / /   / __ \/ ___/ __ `/ /\__ \/ __/ __ `/ ___/ //_/
  / /___/ /_/ / /__/ /_/ / /___/ / /_/ /_/ / /__/ ,<
 /_____/\____/\___/\__,_/_//____/\__/\__,_/\___/_/|_|

 πŸ’» LocalStack CLI 2.1.0

[13:53:26] starting LocalStack in Docker mode 🐳                                                                                                                                                                                                                       localstack.py:142
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────── LocalStack Runtime Log (press CTRL-C to quit) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

LocalStack version: 2.1.1.dev
LocalStack Docker container id: 7924259c3e16
LocalStack build date: 2023-06-23
LocalStack build git hash: 10eefec2

2023-06-23T12:53:27.726  INFO --- [-functhread3] hypercorn.error            : Running on https://0.0.0.0:4566 (CTRL + C to quit)
2023-06-23T12:53:27.726  INFO --- [-functhread3] hypercorn.error            : Running on https://0.0.0.0:4566 (CTRL + C to quit)
Ready.
2023-06-23T12:53:38.539  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS sts.AssumeRole => 200
2023-06-23T12:53:38.737  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS s3.CreateBucket => 200
2023-06-23T12:53:38.766  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS s3.CreateMultipartUpload => 200
2023-06-23T12:53:39.123  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS s3.UploadPart => 200
2023-06-23T12:53:39.238  INFO --- [   asgi_gw_3] localstack.request.aws     : AWS s3.UploadPart => 200
2023-06-23T12:53:39.274  INFO --- [   asgi_gw_4] localstack.request.aws     : AWS s3.UploadPart => 200
2023-06-23T12:53:39.280  INFO --- [   asgi_gw_2] localstack.request.aws     : AWS s3.UploadPart => 200
2023-06-23T12:53:39.286  INFO --- [   asgi_gw_5] localstack.request.aws     : AWS s3.UploadPart => 200
2023-06-23T12:53:39.642  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS s3.CompleteMultipartUpload => 200
2023-06-23T12:53:39.662  INFO --- [   asgi_gw_0] localstack.request.aws     : AWS lambda.CreateFunction => 201
2023-06-23T12:53:39.679  INFO --- [   asgi_gw_4] localstack.request.aws     : AWS sts.AssumeRole => 200
2023-06-23T12:53:41.585  INFO --- [   asgi_gw_5] localstack.request.http    : POST /_localstack_lambda/7c7c513aa846cb3b676a900098934698/status/7c7c513aa846cb3b676a900098934698/error => 200
2023-06-23T12:53:43.309  INFO --- [   asgi_gw_4] localstack.request.aws     : AWS sts.AssumeRole => 200
2023-06-23T12:53:43.319  INFO --- [TK:$LATEST_0] l.u.container_networking   : Determined main container network: bridge
2023-06-23T12:53:43.325  INFO --- [TK:$LATEST_0] l.u.container_networking   : Determined main container target IP: 172.17.0.2
2023-06-23T12:53:53.954  WARN --- [   asgi_gw_2] l.s.a.i.executor_endpoint  : Execution environment startup failed: {"errorMessage":"Quarkus manual initialization failed","errorType":"java.lang.RuntimeException"}
2023-06-23T12:53:54.209  INFO --- [   asgi_gw_2] localstack.request.http    : POST /_localstack_lambda/fa10e51270144fe9390f2e0d7e0dc1c0/status/fa10e51270144fe9390f2e0d7e0dc1c0/error => 202
2023-06-23T12:53:54.321  INFO --- [   asgi_gw_4] localstack.request.aws     : AWS sts.AssumeRole => 200
2023-06-23T12:54:04.651  WARN --- [   asgi_gw_2] l.s.a.i.executor_endpoint  : Execution environment startup failed: {"errorMessage":"Quarkus manual initialization failed","errorType":"java.lang.RuntimeException"}
2023-06-23T12:54:04.873  INFO --- [   asgi_gw_2] localstack.request.http    : POST /_localstack_lambda/a413ac6edeb2cfc8636e0af127e07f3a/status/a413ac6edeb2cfc8636e0af127e07f3a/error => 202
2023-06-23T12:54:05.357  INFO --- [   asgi_gw_4] localstack.request.aws     : AWS sts.AssumeRole => 200
2023-06-23T12:54:15.926  WARN --- [   asgi_gw_2] l.s.a.i.executor_endpoint  : Execution environment startup failed: {"errorMessage":"Quarkus manual initialization failed","errorType":"java.lang.RuntimeException"}
2023-06-23T12:54:16.266  INFO --- [   asgi_gw_2] localstack.request.http    : POST /_localstack_lambda/724d211ff8c01c7433385ce5932082f0/status/724d211ff8c01c7433385ce5932082f0/error => 202
2023-06-23T12:54:16.346  INFO --- [   asgi_gw_4] localstack.request.aws     : AWS sts.AssumeRole => 200
2023-06-23T12:54:27.179  WARN --- [   asgi_gw_2] l.s.a.i.executor_endpoint  : Execution environment startup failed: {"errorMessage":"Quarkus manual initialization failed","errorType":"java.lang.RuntimeException"}
2023-06-23T12:54:27.561  INFO --- [   asgi_gw_4] localstack.request.aws     : AWS sts.AssumeRole => 200

Expected Behavior

The lambda should start (as it does when in AWS) and return 200.

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

localstack start

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

awslocal lambda create-function --function-name test-lambda --runtime java17 --zip-file fileb://./target/function.zip --handler io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler::handleRequest --role arn:aws:iam::000000000000:role/lambda-role
awslocal lambda invoke --function-name test-lambda  --payload file://./src/main/resources/sampleRequest.json output.json

Environment

- OS: MacOS 13.4 M1 Pro
- LocalStack: 2.1.0
- awslocal: aws-cli/2.12.1 Python/3.11.4 Darwin/22.5.0 source/arm64 prompt/off
- Java: Amazon Corretto 17.0.7
- Framework: Quarkus 3.1.2.Final

Anything else?

The Java lambda is using Camel with a Saxon route.

E.g.

.to("xslt-saxon:classpath:transforms/transform1.xslt")

It seems to work fine when commenting this out, however the lambda works fine when running in AWS so it's not the lambda but something in Localstack that is not working quite right.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions