devantler-tech / devantler-tech/ksail

Remove VCluster D-Bus workaround after upstream fix

Open
#2,261 12 comments 0 reactions 0 assignees View on GitHub
blocked
Dominant language
Go
Stars
165
Forks
12
Avg merge
5h 41m
Merged PRs (30d)
337

Description

## Context

PR #2241 adds VCluster × Docker (Vind) support. During CI testing on GitHub Actions Ubuntu runners, the VCluster SDK's `install-standalone.sh` fails with:

```
failed to start vCluster standalone: exit status 1: Failed to connect to bus: No such file or directory
```

**Root cause:** The SDK runs `systemctl restart systemd-journald` inside the privileged Docker container before systemd has initialized D-Bus (`/run/dbus/system_bus_socket`). The container starts with `--tmpfs /run`, so the socket doesn't exist immediately. Combined with `set -e`, this aborts the install script.

This works on macOS (Docker Desktop provides a fully-initialized systemd VM) but fails on Linux CI runners due to a timing race.

## Current workaround

KSail detects the `"Failed to connect to bus"` error from `CreateDocker`, waits for D-Bus readiness inside the container, then re-runs the install script. See `recoverFromDBusError` in `pkg/svc/provisioner/cluster/vcluster/provisioner.go`.

## Action items

- [x] Verify whether the D-Bus recovery workaround is needed after CI runs confirm the fix works
- [x] If confirmed necessary, file an upstream issue on [loft-sh/vcluster](https://github.com/loft-sh/vcluster) suggesting one of:
- Adding a D-Bus readiness wait before `systemctl restart systemd-journald` in `install-standalone.sh`
- Making the journald restart non-fatal (remove `set -e` or use `|| true`)
- Adding an SDK option to skip persistent logging setup
- [ ] Remove the workaround once an upstream fix is released

## References

- `install-standalone.sh` line 333: `systemctl restart systemd-journald`
- VCluster SDK: `github.com/loft-sh/vcluster v0.32.0-rc.1`
- Chart version: `0.32.0-alpha.2`

**Blocker:** loft-sh/vcluster#3805 | upstream | last-verified 2026-09-08: **not shipped** — the
upstream issue was filed 2026-04-07 and recorded the journald/D-Bus race as still present in
v0.33.1 and v0.34.0-alpha.1. The Go module proxy still reports latest stable **v0.36.1**
(2026-07-29), unchanged across the 2026-08-17, 2026-08-19, 2026-08-25 and this 2026-09-08 check.
v0.37.0 has advanced from `rc.1` to `rc.5` since the last check but remains a prerelease, and a
prerelease is not a shipped fix. Whether the race is fixed in v0.36.1 is still not determinable
from non-repository sources.
Cheapest next step remains dropping `recoverFromDBusError` behind a test against current vcluster
and seeing whether CI still reproduces the failure — that answers it directly and costs less than
continuing to track upstream. Four checks across six weeks with no stable release strengthens the
case for doing that rather than waiting further.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.