Document fix for 'Failed to connect to bus' when setting up Umami systemd user service

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-07-25 23:22:06 +02:00
co-authored by Junie
parent 00a80cccbb
commit 61fc6ba4c4
2 changed files with 34 additions and 0 deletions
@@ -624,3 +624,15 @@
**Context**: Post-workflow follow-up (feature already marked Complete); continues the `feature/analytics_uptime_dashboard` branch, resolving a connectivity blocker discovered while the user was testing the Umami container on Pi Main. Documentation-only change (no code/build impact); the actual `ufw allow` command still needs to be run by the user on Pi Main. **Context**: Post-workflow follow-up (feature already marked Complete); continues the `feature/analytics_uptime_dashboard` branch, resolving a connectivity blocker discovered while the user was testing the Umami container on Pi Main. Documentation-only change (no code/build impact); the actual `ufw allow` command still needs to be run by the user on Pi Main.
--- ---
## Post-Completion Follow-up: "Failed to connect to bus: No medium found" When Setting Up the systemd User Service
**Timestamp**: 2026-07-25T23:18:00Z
**User Input**: "ik krijg het volgende al sik de service probeer aan te maken en deamon reload probeer te doen: systemctl --user daemon-reload Failed to connect to bus: No medium found"
**AI Response**: "Explained that this error means no D-Bus/systemd user session exists yet for the `umami` user, most likely because `sudo -iu umami` does not register a full PAM login session the way an interactive login does — so `/run/user/<uid>` (and the bus socket inside it) is missing, even with linger already enabled. Added a troubleshooting callout to `umami-setup.md` right before the systemd-service step: verify `Linger=yes` via `loginctl show-user umami`, re-run `loginctl enable-linger umami` if not, explicitly start `user@<uid>.service`, re-login and export `XDG_RUNTIME_DIR` manually, with `machinectl shell umami@ /bin/bash` offered as a more robust alternative to `sudo -iu`/`su -` if the issue persists."
**Context**: Post-workflow follow-up (feature already marked Complete); continues the `feature/analytics_uptime_dashboard` branch, resolving a blocker discovered while the user was setting up the systemd auto-start service on Pi Main. Documentation-only change (no code/build impact); the user still needs to apply the fix on Pi Main.
---
@@ -124,6 +124,28 @@ uit stap 0.3 is hiervoor al gezet, dus deze service blijft ook draaien zonder da
`umami`-user zelf is ingelogd. `umami`-user zelf is ingelogd.
1. Log in (of blijf ingelogd) als de `umami`-user: `sudo -iu umami`. 1. Log in (of blijf ingelogd) als de `umami`-user: `sudo -iu umami`.
> **Let op — "Failed to connect to bus: No medium found" bij `systemctl --user`:**
> Dit betekent dat er (nog) geen D-Bus/systemd user-sessie draait voor `umami`, meestal
> omdat `sudo -iu umami` geen volledige PAM-login-sessie registreert zoals een echte
> interactieve login dat wel doet — daardoor bestaat `/run/user/<uid>` (en de bus daarin)
> nog niet, zelfs met linger enabled. Los dit als volgt op:
> ```bash
> # Controleer eerst of linger daadwerkelijk actief staat:
> loginctl show-user umami | grep Linger
> # Verwacht: Linger=yes. Staat er Linger=no, herhaal dan:
> sudo loginctl enable-linger umami
> # Start de user-manager expliciet (uid van umami opzoeken met: id -u umami):
> sudo systemctl start user@$(id -u umami).service
> # Log opnieuw in als umami en zet XDG_RUNTIME_DIR expliciet, voor deze sessie:
> sudo -iu umami
> export XDG_RUNTIME_DIR=/run/user/$(id -u)
> ```
> Probeer daarna `systemctl --user daemon-reload` opnieuw. Blijft het misgaan, gebruik dan
> in plaats van `sudo -iu umami` het commando `sudo machinectl shell umami@ /bin/bash` om
> in te loggen — dat registreert wél altijd een volledige sessie inclusief D-Bus, in
> tegenstelling tot `sudo -iu`/`su -`.
2. Maak `~/.config/systemd/user/umami.service` aan: 2. Maak `~/.config/systemd/user/umami.service` aan:
```ini ```ini
[Unit] [Unit]