canonical / craft-providers

Python interfaces for instantiating and executing builds for a variety of target environments.
https://canonical-craft-providers.readthedocs-hosted.com/en/latest/
GNU Lesser General Public License v3.0
6 stars 22 forks source link

Cannot launch lxd instance with high uids #259

Open mr-cal opened 1 year ago

mr-cal commented 1 year ago

Overview

If the current user's uid (user id) is greater than 65,535, then craft-providers will fail to launch a LXD instance.

Details

Craft-providers sets the id map so the host's working directory can be mounted in the instance. On the other side, LXD does UID/GID mapping for security reasons (see more here).

When craft-providers launches a container with the config raw.idmap=both <uid> 0, LXD fails with Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Host id is in the range of subids.

High uids occur in enterprise deployments where technologies like NIS, SSSD, and/or Active Directory are being used.

Possible solutions

If uid>65,535, then:

  1. warn and provide a link to the documentation
  2. update the charmcraft project in LXD to accommodate high uids (security.idmap.base, security.idmap.size)

Source

lengau commented 7 months ago

[bump] since I couldn't find this in jira

syncronize-issues-to-jira[bot] commented 7 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2775.

This message was autogenerated

CharleeSF commented 3 months ago

That JIRA link is not public.

How is it going with this issue?

I have this problem when trying to build on a VM in an cluster.

Is there any workarounds?

mr-cal commented 3 months ago

There has not been any progress made on this issue.

There is a workaround described in https://discourse.charmhub.io/t/using-charmcraft-with-very-high-uids/7208

Even though that is for charmcraft, the workaround should apply to snapcraft and rockcraft.