-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(asset-staging): local bundling fails inside a docker container with non-existent user #15415
Comments
Currently, when not explicitly passing a user in BundlingOptions, `os.userInfo()` is called as a default fallback. Even though the user is only used and needed when using docker bundling, it is still called when using local bundling. This can be problematic e.g. when running cdk scripts inside a docker container where the user does not exist inside the container (see #15415). Fixes #15415. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Currently, when not explicitly passing a user in BundlingOptions, `os.userInfo()` is called as a default fallback. Even though the user is only used and needed when using docker bundling, it is still called when using local bundling. This can be problematic e.g. when running cdk scripts inside a docker container where the user does not exist inside the container (see aws#15415). Fixes aws#15415. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@peterwoodworth, @akuntsch I think I just ran into this same issue, could there be a regression/edge case? This happens inside of OpenShift where the user doesn't exist. Only a UID. It doesn't happen when it runs with a user that is actually visible via e.g. Runing a plain
Same for
Environment
|
Thanks for the ping, I've reopened the issue for investigation |
Currently, when not explicitly passing a user in BundlingOptions, `os.userInfo()` is called as a default fallback. Even though the user is only used and needed when using docker bundling, it is still called when using local bundling. This can be problematic e.g. when running cdk scripts inside a docker container where the user does not exist inside the container (see aws#15415). Fixes aws#15415. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm encountering this with CDK 1.138.2, deploying inside a custom container based on the node:16 Docker container. Github actions uses the root user which doesn't exist in the Node image (only the node user does), so this is the scenario where a user home directory doesn't exist. I worked around it by not using my custom Docker image, and used the built-in Github Actions Ubuntu image with the setup-node Github Action applied until this is sorted. |
I've proposed trivial fix in #20188 PR already. PR validation failed, because there's no test. For such simple function that is a helper called in private method from private method it's hard to write a proper test without crazy |
Looks like this was fixed in #20188. If that is not correct and there are still issues around this, please open a new issue. |
|
We run our CDK scripts inside a Node.js docker container inside a Jenkins pipeline. Jenkins runs docker containers with the host user (
docker run -u ...
) which does not necessarily exist inside the docker container. Bundling fails inside the Jenkins pipeline because CDK tries to read the user from/etc/passwd
, even though the user is not used when using local asset bundling.Reproduction Steps
Run CDK code with local asset bundling inside a docker container with non-existent user (e.g.
docker run -u 1234:1234
).What did you expect to happen?
Local asset bundling works inside a docker container with non-existent user.
What actually happened?
Asset bundling fails with the following error:
Environment
Other
Should be fixed by #15313.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: