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_s3_assets): (Assets with symlink's are failing when relative paths are used) #28035

Closed
mrlikl opened this issue Nov 16, 2023 · 2 comments
Closed
Labels
@aws-cdk/aws-s3-assets bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@mrlikl
Copy link
Contributor

mrlikl commented Nov 16, 2023

Describe the bug

When Asset's are created with relative paths, cdk synth/deploy is failing with the error

Error response from daemon: invalid symlink "/asset-input/folder/handler" -> "../../../../../actual-location/xxx/handlers"
jsii.errors.JavaScriptError: 
  Error: Failed to bundle asset xxx/createWorkerBundledAsset/Stage, bundle output is located at /xxx/cdk.out/asset.0517c4be29ed51b767f1e92ce92a5c16d1b49bb6f88882f73828581ed35f4fef-error: Error: docker exited with status 1

Expected Behavior

Current Behavior

The symlinks are working when absolute paths are used and synth/deployment is working fine

Reproduction Steps

The env is a windows machine with wsl2 where the asset is being bundled -

        path = f"{Path.cwd()}/cdk/stacks/functions/handler" <- said location has a symlink to root of the project where cdk.json resides

        container_command = "cp -au . /asset-output && pwd && ls -la"
        asset = Asset(self, "createWorkerBundledAsset",
            path=path,
            bundling=BundlingOptions(
                image=DockerImage.from_registry("alpine"),
                bundling_file_access=BundlingFileAccess.VOLUME_COPY,
                entrypoint=['/bin/sh', '-c'],
                network="host",
                user="root",
                command=[container_command],
                output_type=BundlingOutput.AUTO_DISCOVER
            ),
            follow_symlinks=SymlinkFollowMode.ALWAYS
        )

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.104.0

Framework Version

No response

Node.js Version

OS

windows

Language

Python

Language Version

No response

Other information

No response

@mrlikl mrlikl added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 16, 2023
@pahud
Copy link
Contributor

pahud commented Nov 16, 2023

When you bundle your assets with docker, the symbolic link can't be outside of the context. I guess this is a limitation of docker.

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 16, 2023
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-s3-assets bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants