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): Unable to build PythonLayer on Windows platform. #19059

Closed
tomeszmh opened this issue Feb 20, 2022 · 2 comments
Closed

(aws-lambda-python): Unable to build PythonLayer on Windows platform. #19059

tomeszmh opened this issue Feb 20, 2022 · 2 comments
Assignees
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. p1

Comments

@tomeszmh
Copy link

What is the problem?

I have created a PythonLayer with a requirements.txt file. It's working on MAC platforms but on Windows we have some issues. Docker is able to download all dependencies, and tries copy to output folder asset-output/python, but it seems the folder is not created: "asset-outputpython". So docker recursively copies the original folder and exit after some time.
See in the log files.

Reproduction Steps

Simple PythonLayerVersion added to lambda with a requirements.txt file in it.

What did you expect to happen?

Successful Layer build

What actually happened?

Docker doesn't copy downloaded dependencies under asset-output/python it recursively copies folders and exited after a while.

I checked cdk soruce, and I think this command is invoked:

'python -m pip install -r requirements.txt -t /asset-output/python && cp -rT /asset-input/ /asset-output/python',

CDK CLI Version

2.12

Framework Version

No response

Node.js Version

16.14.0

OS

Windows

Language

Python

Language Version

Python 3.9

Other information

/usr/bin/cp: cannot copy a directory, ‘/asset-input/’, into itself, ‘asset-outputpython’
jsii.errors.JavaScriptError:
  Error: Failed to bundle asset ChimpusChatBackendStack/slack-layer-for-lambda-runtime/Code/Stage, bundle output is located at D:\Projects\chimpus\cdk.out\asset.e88186929ea1a5519ca6c365d59602a5257499baaa9fff8c906715427d92c868-error: Error: docker exited with status 1
      at AssetStaging.bundle (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\core\lib\asset-staging.js:353:19)
      at AssetStaging.stageByBundling (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\core\lib\asset-staging.js:212:14)
      at stageThisAsset (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\core\lib\asset-staging.js:75:41)
      at Cache.obtain (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\core\lib\private\cache.js:28:17)
      at new AssetStaging (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\core\lib\asset-staging.js:99:48)
      at new Asset (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\aws-s3-assets\lib\asset.js:31:25)
      at AssetCode.bind (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\aws-lambda\lib\code.js:269:26)
      at new LayerVersion (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\aws-lambda\lib\layers.js:60:33)
      at new PythonLayerVersion (C:\Users\tothd\AppData\Local\Temp\jsii-kernel-sgm3Sf\node_modules\@aws-cdk\aws-lambda-python\lib\layer.js:35:9)
      at C:\Users\tothd\AppData\Local\Temp\tmp_zw_p310\lib\program.js:8412:58
@tomeszmh tomeszmh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 20, 2022
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Feb 20, 2022
@ryparker ryparker added the p1 label Feb 21, 2022
@kaizencc kaizencc changed the title (PythonlayerVersion): Unable to build Layer on Windows platform. (aws-lambda-python): Unable to build PythonLayer on Windows platform. Mar 4, 2022
@kaizencc kaizencc added @aws-cdk/aws-lambda-python and removed @aws-cdk/aws-lambda Related to AWS Lambda labels Mar 4, 2022
@kaizencc kaizencc assigned corymhall and unassigned kaizencc Mar 4, 2022
@corymhall
Copy link
Contributor

@tomeszmh we are currently tracking this issue in #18861

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. p1
Projects
None yet
Development

No branches or pull requests

4 participants