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

aws-lambda-python-alpha: "jsii-kernel-sZg8MV/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/Containerfile: no such file or directory" #24458

Closed
robert-hanuschke opened this issue Mar 5, 2023 · 5 comments · Fixed by #24646
Labels

Comments

@robert-hanuschke
Copy link

Describe the bug

Hello,

I have a cdk project defined in Python and some Python Lambda functions defined in one of the stacks based on aws-lambda-python-alpha (2.67.0a0).
My machine is a Mac. When I want to deploy, I get the following error:

time="2023-03-05T13:30:52Z" level=fatal msg="lstat /private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/jsii-kernel-sZg8MV/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/Containerfile: no such file or directory"
time="2023-03-05T14:30:52+01:00" level=fatal msg="exit status 1"
jsii.errors.JavaScriptError: 
  Error: docker exited with status 1
      at Object.dockerExec (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/jsii-kernel-sZg8MV/node_modules/aws-cdk-lib/core/lib/private/asset-staging.js:4:45)
      at Function.fromBuild (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/jsii-kernel-sZg8MV/node_modules/aws-cdk-lib/core/lib/bundling.js:1:4198)
      at new Bundling (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/jsii-kernel-sZg8MV/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/bundling.js:31:57)
      at Function.bundle (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/jsii-kernel-sZg8MV/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/bundling.js:54:50)
      at new PythonFunction (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/jsii-kernel-sZg8MV/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/function.js:43:39)
      at Kernel._create (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/tmp9aqp7_nw/lib/program.js:9937:29)
      at Kernel.create (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/tmp9aqp7_nw/lib/program.js:9666:29)
      at KernelHost.processRequest (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/tmp9aqp7_nw/lib/program.js:11514:36)
      at KernelHost.run (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/tmp9aqp7_nw/lib/program.js:11474:22)
      at Immediate._onImmediate (/private/var/folders/2t/f5v_syfd3bd1z5vk1h6mb15m0000gr/T/tmp9aqp7_nw/lib/program.js:11475:46)

I tried

  • removing and re-adding aws-cdk-aws-lambda-python-alpha to the project
  • reinstalling cdk
  • recreating my project virtual environment completely and installing all dependencies again
  • a lower version of aws-lambda-python-alpha (2.64.0a0)
  • simplifying my code to the documentation example of the python lambda

All to no avail unfortunately.

How can I fix this?

Expected Behavior

deployment working normally

Current Behavior

deployment failing with above message

Reproduction Steps

I assume this very much to be related to my local environment as it happens for multiple versions of the module with only the doc example:

python.PythonFunction(self, "MyFunction", entry="/tmp", # required runtime=lambda_.Runtime.PYTHON_3_8, # required index="my_index.py", # optional, defaults to 'index.py' handler="my_exported_func" )

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.67.0 (build b6f7f39)

Framework Version

No response

Node.js Version

v16.19.0

OS

macOS 12.6.3

Language

Python

Language Version

No response

Other information

No response

@robert-hanuschke robert-hanuschke added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 5, 2023
@pahud
Copy link
Contributor

pahud commented Mar 6, 2023

Unfortunately we can't help you troubleshooting without any provided code. Is it possible for you to share an simplified repo that we can simply clone and check in our environment?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 6, 2023
@pahud pahud self-assigned this Mar 6, 2023
@robert-hanuschke
Copy link
Author

It already fails with the provided code practically straight from the docs.

python.PythonFunction(self, "MyFunction", entry="/tmp", runtime=lambda_.Runtime.PYTHON_3_8, index="my_index.py", handler="my_exported_func" )

It does not matter what is inside my_index.py.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Mar 6, 2023
@pahud pahud added needs-reproduction This issue needs reproduction. p2 investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Mar 15, 2023
@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 16, 2023

The issue appears to be the use of finch vs the use of actual docker

@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 16, 2023

The reason is that your temporary directory is not automatically mapped into the finch VM:

Add the following additional_directories to ~/.finch/finch.yaml:

cpus: 3
memory: 4GiB
additional_directories:
  - path: /var/folders
  - path: /private/var/folders

rix0rrr added a commit that referenced this issue Mar 16, 2023
Add troubleshooting instructions to resolve a weird error produced by
Finch.

Fixes #24458.
@mergify mergify bot closed this as completed in #24646 Mar 16, 2023
mergify bot pushed a commit that referenced this issue Mar 16, 2023
Add troubleshooting instructions to resolve a weird error produced by Finch.

Fixes #24458.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

homakk pushed a commit to homakk/aws-cdk that referenced this issue Mar 28, 2023
Add troubleshooting instructions to resolve a weird error produced by Finch.

Fixes aws#24458.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@pahud pahud removed their assignment Aug 12, 2024
@pahud pahud removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-reproduction This issue needs reproduction. labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants