You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CDK synth fails when aws_cdk.aws_lambda_python_alpha is used. It worked with 2.2. version but fails in 2.5 and 2.8. Maybe other versions are affected as well.
The problem seems to be in Windows environment only because it works in AWS Codebuild (aws/codebuild/standard:4.0 which is Ubuntu 18.04)
Reproduction Steps
Init CDK app: cdk init app --language=python
Simple CDK app is created with a single stack.
'lambda_layer' - directory for lambda layer code
'lambda_code' - directory for lambda function code
'python_project1/python_project1_stack.py' file:
An error is raised and synth fails. It fails for Layer1 and Function1 with similar errors.
But it works for Layer2 and Function2.
What did you expect to happen?
Synth process finishes successfully and assets are bundled for the app into cdk.out directory
What actually happened?
Bundling asset PythonProject1Stack/Layer1/Code/Stage...
cp: cannot copy a directory, ‘/asset-input/’, into itself, ‘asset-outputpython’
jsii.errors.JavaScriptError:
Error: Failed to bundle asset PythonProject1Stack/Layer1/Code/Stage, bundle output is located at D:\Repositories\pythonProject1\cdk.out\asset.5470a3f49d3959d7cf18d599c13ca7a43389e2f9bfde4e13b42afb69b223e444-error: Error: docker exited with status 1
at AssetStaging.bundle (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\core\lib\asset-staging.js:2:672)
at AssetStaging.stageByBundling (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\core\lib\asset-staging.js:1:4168)
at stageThisAsset (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\core\lib\asset-staging.js:1:1675)
at Cache.obtain (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\core\lib\private\cache.js:1:242)
at new AssetStaging (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\core\lib\asset-staging.js:1:2070)
at new Asset (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\aws-s3-assets\lib\asset.js:1:620)
at AssetCode.bind (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\aws-lambda\lib\code.js:1:3503)
at new LayerVersion (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\aws-cdk-lib\aws-lambda\lib\layers.js:1:1239)
at new PythonLayerVersion (C:\Users\User\AppData\Local\Temp\jsii-kernel-bUHYEs\node_modules\@aws-cdk\aws-lambda-python-alpha\lib\layer.js:35:9)
at C:\Users\User\AppData\Local\Temp\tmp4t1cb_79\lib\program.js:8432:58
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Repositories\pythonProject1\app.py", line 10, in <module>
PythonProject1Stack(app, "PythonProject1Stack",
File "D:\Repositories\pythonProject1\.venv\lib\site-packages\jsii\_runtime.py", line 86, in __call__
inst = super().__call__(*args, **kwargs)
File "D:\Repositories\pythonProject1\python_project1\python_project1_stack.py", line 15, in __init__
PythonLayerVersion(
File "D:\Repositories\pythonProject1\.venv\lib\site-packages\jsii\_runtime.py", line 86, in __call__
inst = super().__call__(*args, **kwargs)
File "D:\Repositories\pythonProject1\.venv\lib\site-packages\aws_cdk\aws_lambda_python_alpha\__init__.py", line 1263, in __init__
jsii.create(self.__class__, self, [scope, id, props])
File "D:\Repositories\pythonProject1\.venv\lib\site-packages\jsii\_kernel\__init__.py", line 290, in create
response = self.provider.create(
File "D:\Repositories\pythonProject1\.venv\lib\site-packages\jsii\_kernel\providers\process.py", line 344, in create
return self._process.send(request, CreateResponse)
File "D:\Repositories\pythonProject1\.venv\lib\site-packages\jsii\_kernel\providers\process.py", line 326, in send
raise JSIIError(resp.error) from JavaScriptError(resp.stack)
jsii.errors.JSIIError: Failed to bundle asset PythonProject1Stack/Layer1/Code/Stage, bundle output is located at D:\Repositories\pythonProject1\cdk.out\asset.5470a3f49d3959d7cf18d599c13ca7a43389e2f9bfde4e13b42afb69b223e444-error: Error: docker exited
with status 1
Subprocess exited with error 1
CDK CLI Version
2.8
Framework Version
No response
Node.js Version
v16.5.0
OS
Windows 10
Language
Python
Language Version
3.9.6
Other information
No response
The text was updated successfully, but these errors were encountered:
Directory mentioned in error message - D:\Repositories\pythonProject1\cdk.out\asset.5470a3f49d3959d7cf18d599c13ca7a43389e2f9bfde4e13b42afb69b223e444-error
is empty
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.
What is the problem?
CDK synth fails when aws_cdk.aws_lambda_python_alpha is used. It worked with 2.2. version but fails in 2.5 and 2.8. Maybe other versions are affected as well.
The problem seems to be in Windows environment only because it works in AWS Codebuild (aws/codebuild/standard:4.0 which is Ubuntu 18.04)
Reproduction Steps
Init CDK app:
cdk init app --language=python
Simple CDK app is created with a single stack.
'lambda_layer' - directory for lambda layer code
'lambda_code' - directory for lambda function code
'python_project1/python_project1_stack.py' file:
cdk synth --all
is invoked to synthesize app.An error is raised and synth fails. It fails for Layer1 and Function1 with similar errors.
But it works for Layer2 and Function2.
What did you expect to happen?
Synth process finishes successfully and assets are bundled for the app into cdk.out directory
What actually happened?
The above exception was the direct cause of the following exception:
CDK CLI Version
2.8
Framework Version
No response
Node.js Version
v16.5.0
OS
Windows 10
Language
Python
Language Version
3.9.6
Other information
No response
The text was updated successfully, but these errors were encountered: