Skip to content

some snaps fail when $HOME is managed by systemd-homed #368

Description

@stuart12

I have two accounts on my laptop . One account has $HOME as a normal directory. My main account (login stu) has $HOME managed by systemd-homed. When I use this account some snaps do not work. The cause is probably that /etc/nsswitch.conf does not have systemd in the passwd, group, shadow and gshadow databases. The snaps work when I use my account with a normal $HOME. I can also make them work by adding an entry for stu in /etc/passwd. You are not meant to do this however because the uid can change and account is meant to be fully managed by homed. Could support for systemd-homed be added to snaps? I presume that it would have to be done in core as was done for mdns. I am running Ubuntu 25.04 (see below). firefox works but I have had some problems saving files without the workaround.

drawio prints an error message and does not open a window. I reported the bug to drawio but that was perhaps the wrong place.

laptop% snap info drawio
name:      drawio
summary:   draw.io
publisher: draw.io (jgraph✓)
store-url: https://snapcraft.io/drawio
license:   unset
description: |
  draw.io desktop
commands:
  - drawio
snap-id:      84JReQ8pcNGJyAbT0gSDiW7OpDkrdaXp
tracking:     latest/stable
refresh-date: today at 10:43 CEST
channels:
  latest/stable:    28.1.2 2025-08-30 (253) 131MB -
  latest/candidate: ↑                             
  latest/beta:      ↑                             
  latest/edge:      28.1.2 2025-08-29 (253) 131MB -
installed:          28.1.2            (253) 131MB -
laptop% snap run --shell  drawio
% getent passwd $USER || echo $USER not found; exit
stu not found
exit
laptop% /snap/bin/drawio 
A JavaScript error occurred in the main process
Uncaught Exception:
SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)
    at Object.userInfo (node:os:305:11)
    at file:///snap/drawio/253/resources/app.asar/node_modules/atomically/dist/constants.js:10:29
    at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:647:26)
    at async node:electron/js2c/browser_init:2:135238
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:132:5)

Same thing with element-desktop. It works with my account with $HOME as a normal directory but fails unable to open a window with $HOME mounted by homed.

laptop% snap info element-desktop 
name:      element-desktop
summary:   A feature-rich client for Matrix.org
publisher: Ken VanDine✪
store-url: https://snapcraft.io/element-desktop
contact:   ken@vandine.org
license:   unset
description: |
  Element is both a secure messenger and a productivity team collaboration app that is ideal for
  group chats while remote working. This chat app uses end-to-end encryption to provide powerful
  video conferencing, file sharing and voice calls.
  
  Element’s features include:
     - Advanced online communication tools
     - Fully encrypted messages to allow safer corporate communication, even for remote workers
commands:
  - element-desktop
snap-id:      nZQQXb6Hap0I2ZF3ZsTeFeh80gXHN8DQ
tracking:     latest/stable
refresh-date: 10 days ago, at 00:43 CEST
channels:
  latest/stable:    1.11.109 2025-08-19 (166) 189MB -
  latest/candidate: ↑                               
  latest/beta:      ↑                               
  latest/edge:      1.11.110 2025-08-28 (168) 189MB -
installed:          1.11.109            (166) 189MB -
laptop%  snap run --shell element-desktop
% getent passwd $USER || echo $USER not found; exit
stu not found
exit
laptop% /snap/bin/element-desktop 
A JavaScript error occurred in the main process
Uncaught Exception:
SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)
    at Object.userInfo (node:os:305:11)
    at file:///snap/element-desktop/166/opt/Element/resources/app.asar/node_modules/atomically/dist/constants.js:10:29
    at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async node:electron/js2c/browser_init:2:135156
laptop% uname -srvmpio && cat /etc/issue
Linux 6.14.0-28-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 23 12:05:14 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 25.04 \n \l

laptop% cat /etc/nsswitch.conf 
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files systemd sss
group:          files systemd sss
shadow:         files systemd sss
gshadow:        files systemd

hosts:          files mdns4_minimal [NOTFOUND=return] dns
networks:       files

protocols:      db files
services:       db files sss
ethers:         db files
rpc:            db files

netgroup:       nis sss
automount:  sss

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions