Brain Structural Validation / Validate Markdown Structure & Links (push) Successful in 6s
3.5 KiB
3.5 KiB
type, project, date, tags
| type | project | date | tags | ||||||
|---|---|---|---|---|---|---|---|---|---|
| journal | homelab | 2026-09-18 |
|
Remediation: Gitea Actions CI Build Hang on Nix Installation
Problem Statement
The CI pipeline for homelab-core (validate job in .gitea/workflows/ci.yaml) hung indefinitely (>5 minutes) at the Install Nix step (DeterminateSystems/nix-installer-action@main), stalling builds on push and pull requests.
Research & Hypotheses
- Runner connectivity/authorization: Evaluated whether the
act_runnerhad lost communication with Gitea or lacked repository access. - Container network/DNS misconfiguration: Checked if the runner container was unable to resolve external domains like
install.determinate.systems. - Init system & environment incompatibility: Investigated whether the action expected a multi-user
systemddaemon environment or GitHub-specific metadata that is absent in Gitea's containerizedact_runner.
Diagnostics & Findings
- Runner Daemon & Registration: Checked
ssh server-local "docker logs --tail 50 gitea-runner". Verified that the runner was operational, healthy, and successfully claiming jobs (task 74/75). - Step-Level Execution: Steps
Set up jobandCheck out repositorycompleted within seconds. The workflow consistently halted insideDeterminateSystems/nix-installer-actionduring binary download and initialization. - Root Cause Confirmed:
- Gitea's
act_runnerruns tasks inside non-systemd Docker containers (ghcr.io/catthehacker/ubuntu:act-latest). DeterminateSystems/nix-installer-actionattempts a multi-user installation requiring systemd to manage the Nix daemon socket (/nix/var/nix/daemon-socket/socket) and sends telemetry/requests against${{ github.server_url }}which in Gitea resolves tohttps://gitea.roadtotech.me.- Without systemd and with mismatched API URLs, the installer hung waiting on sockets and timeouts.
- Gitea's
Remediation / Fix
- Direct Container Execution: Replaced the dynamic Ubuntu install step with the native container image
nixos/nix:latestinhomelab-core/.gitea/workflows/ci.yaml. - Git & Flake Configuration: Configured
git config --global --add safe.directory "$GITHUB_WORKSPACE"and enablednix-command flakesin~/.config/nix/nix.conf. - Local Invariant Verification: Validated the entire pipeline locally via
./scripts/testand inside a Docker simulation ofnixos/nix:latest. - GitOps Rollout: Committed to
fix/ci-nix-runner, merged tomain, and pushed toorigin/main(ssh://git@gitea.roadtotech.me:2223/kiskaadee/homelab-core).
Results & Verification
- Gitea Actions triggered Task
#76for commitd43848c. - The
validatejob completed successfully in ~16 seconds (down from timing out at 5+ minutes). - Flake checks and security invariants executed without socket or permission errors.
Takeaways & Prevention
- Avoid Dynamic Toolchain Installation in Containerized CI: For tools with rich container ecosystems (like Nix), using a pre-baked base image (
container: nixos/nix:latest) is significantly faster, more deterministic, and avoids init system/PID 1 discrepancies. - Always Configure Git Safe Directory in CI Containers: Containerized runners mounting repository volumes across UID boundaries require
git config --global --add safe.directory "$GITHUB_WORKSPACE"for Nix flake git operations.