cdk-ecr-deployment icon indicating copy to clipboard operation
cdk-ecr-deployment copied to clipboard

Error Type: Runtime.InvalidEntrypoint

Open airmonitor opened this issue 1 year ago • 5 comments

Hey. I was using cdk_ecr_deployment==3.0.55 cdk --version 2.141.0 (build 3d1c06e) python --version Python 3.11.9

and got today the error below

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                 message                                                                                  |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1715603870772 | INIT_START Runtime Version: provided:al2023.v16 Runtime Version ARN: arn:aws:lambda:eu-west-1::runtime:23a5d01a7738492248748a69e3fa947977e72b360e14497d69131a8ebc052f88  |
| 1715603870772 | INIT_REPORT Init Duration: 0.44 ms Phase: init Status: error Error Type: Runtime.InvalidEntrypoint                                                                       |
| 1715603870789 | INIT_REPORT Init Duration: 0.49 ms Phase: invoke Status: error Error Type: Runtime.InvalidEntrypoint                                                                     |
| 1715603870789 | START RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Version: $LATEST                                                                                                   |
| 1715603870790 | RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Error: fork/exec /var/task/bootstrap: permission denied Runtime.InvalidEntrypoint                                        |
| 1715603870790 | END RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d                                                                                                                      |
| 1715603870790 | REPORT RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Duration: 1.44 ms Billed Duration: 2 ms Memory Size: 512 MB Max Memory Used: 3 MB                                 |
| 1715603927062 | INIT_REPORT Init Duration: 0.96 ms Phase: invoke Status: error Error Type: Runtime.InvalidEntrypoint                                                                     |
| 1715603927062 | START RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Version: $LATEST                                                                                                   |
| 1715603927063 | RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Error: fork/exec /var/task/bootstrap: permission denied Runtime.InvalidEntrypoint                                        |
| 1715603927063 | END RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d                                                                                                                      |
| 1715603927063 | REPORT RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Duration: 2.10 ms Billed Duration: 3 ms Memory Size: 512 MB Max Memory Used: 2 MB                                 |
| 1715603927083 | INIT_START Runtime Version: provided:al2023.v16 Runtime Version ARN: arn:aws:lambda:eu-west-1::runtime:23a5d01a7738492248748a69e3fa947977e72b360e14497d69131a8ebc052f88  |
| 1715603927084 | INIT_REPORT Init Duration: 0.62 ms Phase: init Status: error Error Type: Runtime.InvalidEntrypoint                                                                       |
| 1715604051211 | INIT_REPORT Init Duration: 0.63 ms Phase: invoke Status: error Error Type: Runtime.InvalidEntrypoint                                                                     |
| 1715604051211 | START RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Version: $LATEST                                                                                                   |
| 1715604051212 | RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Error: fork/exec /var/task/bootstrap: permission denied Runtime.InvalidEntrypoint                                        |
| 1715604051212 | END RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d                                                                                                                      |
| 1715604051212 | REPORT RequestId: cb7154cc-7b7e-4d4a-a65b-482f89542a5d Duration: 1.68 ms Billed Duration: 2 ms Memory Size: 512 MB Max Memory Used: 2 MB                                 |
| 1715604051227 | INIT_START Runtime Version: provided:al2023.v16 Runtime Version ARN: arn:aws:lambda:eu-west-1::runtime:23a5d01a7738492248748a69e3fa947977e72b360e14497d69131a8ebc052f88  |
| 1715604051228 | INIT_REPORT Init Duration: 0.41 ms Phase: init Status: error Error Type: Runtime.InvalidEntrypoint                                                                       |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

airmonitor avatar May 13 '24 13:05 airmonitor

I'm seeing same on 3.0.66 (cdk v2.145.0, Python v3.11.9)...

Closest hint I've found so far is this SO question? It also looks like there are relevant post-merge comments on #424

athewsey avatar Jun 10 '24 07:06 athewsey

In my case, running with environment variable NO_PREBUILT_LAMBDA=1 seems to avoid this issue - but it's not ideal as:

  1. While this works in AWS CodeBuild, the build fails on my local (Mac) machine
  2. It adds to the CI build time

It seems like maybe the library itself is working fine and it's just the pre-built Lambda bundle that needs to be fixed?

Specifically since the error is /var/task/bootstrap: permission denied, maybe it's something as simple a missing chmod somewhere in the Lambda build routine? 🤷‍♂️

athewsey avatar Jun 10 '24 08:06 athewsey

I am using v3.0.17 and running into this issue. Looks like this issue is flaky and not consistent. Did you ever get to know the solution for this?

satishpasumarthi avatar Jun 24 '24 17:06 satishpasumarthi

I am using one of the latest version (3.0.81) and I still see this issue. Does somebody have found a solution or temporary fix about it? Thanks

salvatoredipietro avatar Aug 21 '24 22:08 salvatoredipietro

Are you all using Python?

mrgrain avatar Oct 16 '24 10:10 mrgrain