Skip to content

fix(installer): make redeploy, repair and repo-built bundles install cleanly - #46

Merged
Developer-Simon merged 12 commits into
mainfrom
fix/installer-repo-path-and-install-errors
Sep 21, 2026
Merged

Developer-Simon merged 12 commits into
mainfrom
fix/installer-repo-path-and-install-errors

Conversation

@Developer-Simon

@Developer-Simon Developer-Simon commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Squash-merge commit message

fix(installer): make redeploy, repair and repo-built bundles install cleanly

Running the installer against a real node exposed a chain of failures, from
the UI's repo path field to the last bootstrap steps. Fix each of them.

- Expand a leading ~ in the repo package path; the UI text field gets no
  shell expansion.
- Show the error detail of a failed run on the result screen.
- Report bundle upload progress and write over SFTP concurrently.
- Replace remote files the SSH user cannot open for writing (e.g. a
  root-owned selection.json) by uploading to a temporary name and renaming.
- Step 20: read the MQTT user and password file from the node's config (or
  the bundle template on a first install) on redeploy and repair, instead
  of failing with MOSQUITTO_ARGS_MISSING.
- Step 40: ignore a commented-out userspace-networking flag, which made the
  guard fail with TAILSCALE_FLAG_INVALID on a healthy node.
- Build: resolve wheel markers for the target Python, not the build
  machine's, so typing_extensions is no longer missing from the bundle.
- Step 70: require the Caddy pack and Caddyfile template only when the step
  has to install a binary or create a Caddyfile.
- Add catalog texts (en/de) for every fault code the bootstrap steps emit,
  so the result screen no longer says "Unknown error code".

Summary

Checklist

  • Subject line follows Conventional Commits
    (type(scope): summary) and matches the style in git log.
  • Relevant checks from
    CONTRIBUTING.md → Running the checks
    pass locally (Python bridges, HA integration, Go dashboard, dashboard JS,
    dashboard smoke test — whichever the change touches).
  • ./scripts/deploy/check_tracked_secrets.sh is clean — no real
    credentials, private-range IPs, or device serials.
  • AI assistance, if any, is disclosed per
    AI-DISCLAIMER.md.
  • For anything beyond a small fix: a linked issue describing the change.

🤖 Generated with Claude Code

Developer-Simon and others added 9 commits September 21, 2026 23:49
The UI text field gets no shell expansion, so ~/dev/energy-node was
reported as not a checkout. Expand a leading ~ before checking and
building.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Send the detail with every run-finished failure and show it on the
result screen. A failure before the first step no longer reads
"At step".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ntly

Emit a note per 5 % of the archive upload and write over SFTP with
concurrent writes, which is much faster on high-latency links.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ting

A manual install can leave a root-owned selection.json in the state
directory, which the SSH user owns. Opening it with O_TRUNC failed with
"permission denied" and stopped the run before its first step. Upload to
a temporary name next to the target and rename over it, which only needs
the directory (and never exposes a half-written file).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ploy and repair

A redeploy or repair collects no credentials, so 20-mosquitto.sh got no
--user/--password-file and failed with MOSQUITTO_ARGS_MISSING before it
could notice there was nothing to do. Read the user and password file from
the node's config (or the bundle's template on a first install), like the
dashboard's updater does; report MQTT_CONFIG_UNREADABLE when neither is
readable. Add texts for both codes, which showed up as "unknown error code".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tep 40

Debian's /etc/default/tailscaled, and the defaults template in the
Tailscale tarball, carry #FLAGS="--tun=userspace-networking" as a comment.
The guard grepped the whole file, so it aborted with TAILSCALE_FLAG_INVALID
on a healthy node (tailscale0 up, no flags) and would have failed a first
install on its own template. Only look at the part of a line before a #.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
pip download --python-version evaluates markers such as
python_version < "3.13" with the build machine's own interpreter. Built on
Python 3.14, the bundle lacked typing_extensions, which aiohttp needs on the
node's Python 3.11, and step 50 failed offline with "No matching
distribution found". After each download, check every wheel's requirements
against the target's markers and fetch what is missing, until the set is
closed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…as no Caddy pack

The Caddy pack is only in a bundle built with --caddy-binary, but step 70
demanded caddy/caddy before it looked at the node, so a repo-built bundle
failed with CADDY_BINARY_MISSING on a node whose apt-owned Caddy it would
not have replaced anyway. Require the pack only when the step has to
install a binary, and the Caddyfile template only when there is no
Caddyfile yet. The configuration is still validated and the service
enabled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
29 codes that the steps report (CADDY_BINARY_MISSING, PIP_INSTALL_FAILED,
MOSQUITTO_PASSWD_FAILED, ...) had no catalog entry, so the result screen
said "Unknown error code" instead of what went wrong and what to do.
Add message and remediation in English and German for each.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Developer-Simon
Developer-Simon force-pushed the fix/installer-repo-path-and-install-errors branch from 98dabc9 to 23a64c3 Compare September 21, 2026 21:50
energy-node-bot and others added 3 commits September 21, 2026 21:50
shellcheck flagged round as unused (SC2034).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Developer-Simon
Developer-Simon merged commit bf1fe10 into main Sep 21, 2026
18 checks passed
@Developer-Simon
Developer-Simon deleted the fix/installer-repo-path-and-install-errors branch September 21, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant