"Sorry, home directories outside of /home are not currently supported." during maas init

Bug #1889646 reported by Jason Hobbs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Undecided
Unassigned
snapd
High
Unassigned

Bug Description

When installing maas 2.7 via snap on bionic, we get this error, at least some of the time:

2020-07-30-11:53:18 root DEBUG [root@10.244.40.30]: sudo maas init --mode region+rack --database-host 10.244.40.34 --database-name maasdb --database-user maas --database-pass SU8AWFsuCoCoB1h --maas-url http://10.244.40.33:80/MAAS --force
2020-07-30-11:53:19 root ERROR [root@10.244.40.30] Command failed: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR ubuntu@10.244.40.30 -- sudo 'bash -c '"'"'sudo maas init --mode region+rack --database-host 10.244.40.34 --database-name maasdb --database-user maas --database-pass SU8AWFsuCoCoB1h --maas-url http://10.244.40.33:80/MAAS --force'"'"''
2020-07-30-11:53:19 root ERROR [root@10.244.40.30] STDOUT follows:
Sorry, home directories outside of /home are not currently supported.
See https://forum.snapcraft.io/t/11209 for details.

example test run: https://solutions.qa.canonical.com/qa/testRun/b7f6b92f-f6f3-4bfd-b4fd-0dc160612a62

Revision history for this message
Adam Collard (adam-collard) wrote :

Nothing that MAAS is doing to have a home directory outside of /home

Changed in maas:
status: New → Invalid
Revision history for this message
Paweł Stołowski (stolowski) wrote :

The error is coming from snap-confine (low-lever helper used for sandboxing when snap is run); it is only printed if there is an issue creating user snap data directory under $SNAP_USER_DATA.

In this case user is root and I think we may have a bug in snap-confine as it assumes "/home" and doesn't consider "/root", however this doesn't explain the root cause (which is an issue with creating snap data dir). As for the root cause, looking at the snap.yaml of maas, the layout bit looks a bit suspicious and I wonder if it could be the troublemaker:

layout:
   ...
  /root:
    bind: $SNAP_DATA/root

Changed in snapd:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This needs to be debugged. I can look but first let me fix master (systemd-logind).

Revision history for this message
Ian Johnson (anonymouse67) wrote :

We already deny usage of /home, perhaps we should also deny usage of layouts on /root too for the same reasons as /home.

Why is MAAS using this layout on top of /root?

Changed in maas:
status: Invalid → New
Revision history for this message
Alberto Donato (ack) wrote :

Hi Ian, we're using it because maas uses virsh, which connects over ssh, and we need to be able to configure ssh with keys (https://discourse.maas.io/t/ssh-setup-fix/1496) to use when connecting to a remote virsh.

ssh has the $HOME/.ssh path hardcoded, so we mount the /root dir as overlay to be able to satisfy that.

Changed in maas:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers