VMs set DISK_SIZE=32G (with G suffix), but post_update_to_api used
\ directly in JSON, producing 'disk_size: 32G' which is
invalid JSON. The server rejected these with 'invalid character G'.
Now strips the G suffix and validates numeric-only before embedding.
The initial 'installing' record MUST exist for all subsequent status
updates to succeed. Previously this was fire-and-forget with no retry,
so timeouts/503s silently dropped ~50% of installations.
Both post_to_api (LXC) and post_to_api_vm now retry up to 3 times
with 1s delay between attempts. Also captures HTTP response code to
detect failures instead of using curl -f (silent fail).
- post_update_to_api: Attempts 2/3 now send medium_error (16KB truncated
log) instead of short_error (generic description only). This is the
primary fix — when attempt 1 fails (120KB payload too large/timeout),
attempts 2/3 no longer discard all log data.
- _send_abort_telemetry: Increased container fallback from 20 to 200
log lines (capped at 16KB). Added SILENT_LOGFILE as fallback source.
Added exit code explanation header and error_category to payload.
- get_error_text/get_full_log: Added SILENT_LOGFILE as last-resort
fallback when INSTALL_LOG, combined log, and BUILD_LOG are all
empty/missing.
Part of #12467 — scripts only (no framework changes).
New exit codes 250-254 registered in api.func and error_handler.func:
- 250: App download failed or version not determined
- 251: App file extraction failed (corrupt/incomplete archive)
- 252: App required file or resource not found
- 253: App data migration required — update aborted
- 254: App user declined prompt or input timed out
Existing codes reused where applicable:
- 10: privileged/Docker required (unifi-os-server)
- 64: invalid user input (postgresql, tomcat)
- 71: system error (pulse useradd)
- 150: service failed to start (docker, npmplus)
- 153: build failed (booklore)
- 233: app not installed (evcc, endurain, grafana, loki, itsm-ng)
- 236: hardware not detected (unifi-os-server /dev/net/tun)
- 238: OS not supported (frigate)
* Standardize exit codes and add mappings
Replace generic exit 1 usages with specific numeric exit codes and add corresponding explanations to the error lookup. This commit updates multiple misc/* scripts to return distinct codes for validation, Proxmox/LXC, networking, download and curl errors (e.g. 103-123, 64, 107-120, 206, 0 for explicit user cancels). It also updates curl error handling to propagate the original curl exit code and adds new entries in explain_exit_code and the error handler to improve diagnostics.
* Set exit code 115 for update_os errors
Change exit status from 6 to 115 in misc/alpine-install.func's update_os() error handlers when failing to download tools.func or when the expected functions are missing. This gives a distinct exit code for these specific failure cases.
* Add tools/addon exit codes and use them
Introduce exit codes 232-238 for Tools & Addon scripts in misc/api.func and misc/error_handler.func. Update addon scripts (tools/addon/adguardhome-sync.sh, tools/addon/copyparty.sh, tools/addon/cronmaster.sh) to return specific codes instead of generic exit 1: 238 for unsupported OS and 233 when the application is not installed/upgrade prerequisites are missing. This makes failures more descriptive and aligns scripts with the central error explanations.
* Standardize exit codes in exporter addons
Unify exit codes across exporter addon scripts: return 238 for unsupported OS detections and 233 when an update is requested but the exporter is not installed. Applied to nextcloud-exporter.sh, pihole-exporter.sh, prometheus-paperless-ngx-exporter.sh, and qbittorrent-exporter.sh to make failure modes distinguishable for callers/automation.
* Use specific exit codes in addon scripts
Replace generic exit 1 with distinct exit codes across multiple addon scripts to enable finer-grained error handling in automation. Exit codes introduced: 10 for Docker/Compose missing or user-declined Docker install, 233 for "nothing to update" cases, and 238 for unsupported OS cases. Affected files: tools/addon/arcane.sh, coolify.sh, dockge.sh, dokploy.sh, filebrowser-quantum.sh, filebrowser.sh, immich-public-proxy.sh, jellystat.sh, runtipi.sh.
* Use specific exit codes in addon scripts
Replace generic exit 1 with specific exit codes across multiple addon scripts to improve error signaling and handling. Files updated: tools/addon/add-netbird-lxc.sh (exit 238 on unsupported distro), tools/addon/add-tailscale-lxc.sh (treat user cancel as exit 0), tools/addon/glances.sh (exit 233 when not installed), tools/addon/komodo.sh (distinct exits for missing compose, legacy DB, backup/download failures, docker checks), tools/addon/netdata.sh (distinct exits for unsupported PVE versions, OS/codename detection, repo lookups), and tools/addon/phpmyadmin.sh (distinct exits for unsupported OS, network/download issues, package install/start failures, and invalid input). These changes make failures easier to identify and automate recovery or reporting.
* Use specific exit codes in PVE scripts
Replace generic exit 1 with distinct exit codes across tools/pve scripts to provide clearer failure signals for callers. post-pve-install.sh now returns 105 for unsupported Proxmox versions; pve-privilege-converter.sh uses 104 for non-root, 234 when no containers, and 235 for backup/conversion failures; update-apps.sh maps backup failures to 235, missing containers/selections to 234 (and UI cancellations to 0), missing backup storage to 119, and returns the actual container update exit code on failure. These changes improve diagnostics and allow external tooling to react to specific error conditions.
* Standardize exit codes and behaviors
Adjust exit codes and abort handling across multiple PVE helper scripts to provide clearer outcomes for automation and interactive flows. Changes include:
- container-restore-from-backup.sh, core-restore-from-backup.sh: return 235 when no backups found (was 1).
- fstrim.sh: treat user cancellation of non-ext4 warning as non-error (exit 0 instead of 1).
- kernel-clean.sh: treat no selection or user abort as non-error (exit 0 instead of 1).
- lxc-delete.sh: return 234 when no containers are present; treat no selection as non-error (exit 0).
- nic-offloading-fix.sh: use specific non-zero codes for root check and tool install failures (exit 104, 237) and 236 when no matching interfaces (was 1).
- pbs_microcode.sh, post-pmg-install.sh, post-pbs-install.sh: use distinct exit codes (232 and 105) for detected VM/PVE/unsupported distro conditions instead of generic 1.
These modifications make scripts return distinct codes for different failure modes and ensure user-initiated aborts or benign conditions exit with 0 where appropriate.
* Use exit 105 for unsupported PVE versions
Standardize error handling by replacing generic exit 1 with exit 105 in pve_check() across multiple VM template scripts to indicate unsupported Proxmox VE versions. Also add API exit code 226 message for "Proxmox: VM disk import or post-creation setup failed" in misc/api.func. Affected files include misc/api.func and various vm/*-vm.sh scripts.
* Use specific exit codes in VM scripts
Replace generic exit 1 with distinct exit codes across vm/*.sh to make failures more actionable for callers. Changes include: use 226 for missing imported-disk references, 237 for pv installation failures, 115 for download/extract/ISO-related failures, 214 for insufficient disk space during FreeBSD decompression, and 119 for missing storage detection. Updated scripts: archlinux-vm.sh, docker-vm.sh, haos-vm.sh, openwrt-vm.sh, opnsense-vm.sh, truenas-vm.sh, umbrel-os-vm.sh.
Remove host-side tee capture of lxc-attach output and PIPESTATUS handling; lxc-attach is now invoked directly and the exit code is taken from $?. Simplify install log retrieval by pulling /root/.install-<SESSION_ID>.log directly and removing the fallback that used the host-captured terminal log, related temp-file size checks, and timeout logic. Remove terminal-state restores and input-draining (stty/dd) and stop redirecting reads from /dev/tty so interactive reads use standard input; similar simplifications applied to the retry flow. Also remove cleanup of the discarded capture log. These changes reduce complexity and terminal manipulation, at the cost of losing the previous terminal-capture fallback for installs that failed to produce a container-side log.
Restore and sanitize terminal state before prompting by draining stale input from /dev/tty (dd iflag=nonblock) and adding a short sleep, then perform timed reads from /dev/tty in misc/build.func and misc/error_handler.func. Also make _REPO_CACHE a global associative array (declare -gA) with fallbacks in misc/tools.func so the cache survives when tools.func is sourced inside a function scope.
Pass PG_VERSION from the Mealie installer (replace POSTGRES_VERSION with PG_VERSION) and update misc/tools.func to prefer vendor package repos by default. Adjusted comments/examples for setup_mysql and setup_postgresql to reflect the new default behavior, and changed the local default for USE_MYSQL_REPO to true. These changes align variable naming in the installer and clarify that official MySQL/PGDG repositories are used unless explicitly disabled.
Replace pre-opened _RECOVERY_TTY handling with direct reads from /dev/tty in misc/build.func and misc/error_handler.func. The change opens /dev/tty at prompt time (with stty sane) so the prompt reads aren't affected by tty state corruption from lxc-attach|tee, simplifies the read logic by using a local response variable with a timeout, and removes the pre-open/close bookkeeping for _RECOVERY_TTY.
Two critical bugs fixed:
1. Install scripts (80+) using 'read' for interactive prompts all fail because
lxc-attach stdin was redirected from /dev/null. Change to /dev/tty so install
scripts like immich, elementsynapse, etc. can prompt the user interactively.
2. Recovery menu read gets 'Input/output error' from /dev/tty after the
lxc-attach|tee pipeline corrupts the terminal state. Pre-open a separate
file descriptor to /dev/tty BEFORE the pipeline starts. This fd survives
any tty corruption and is used as fallback for the recovery menu read.
Fixes the 'command not found' issue where user input falls through to the
parent shell.
Both build.func (main install + APT retry) and error_handler.func (fallback
cleanup prompt) are updated with the same pattern.
Prevent the lxc-attach pipeline from consuming the host's stdin by redirecting its stdin from /dev/null, keeping /dev/tty available for the recovery menu after SIGINT or failures (avoids "read: read error: Input/output error"). Also restore terminal state after the pipeline by running `stty sane` (errors ignored). Applied these changes to both installation invocation sites in misc/build.func.
Delete the stderr TTY check and the static spinner printf/early return in msg_info. The function now always calls color_spinner and starts the animated spinner in the background, removing the special-case for piped/non-TTY environments and simplifying terminal handling.
Improve GitHub release tag handling: only remove a leading 'v' when it's followed by a digit (avoids mangling tags like "version/..."), and sanitize the derived version string for filenames by replacing '/' with '-'. Use the sanitized version when constructing the downloaded tarball filename to prevent invalid or unexpected paths.
Detect non-TTY stderr in msg_info() and print a static progress indicator instead of launching the background spinner (which is unreliable when output is piped). Remove the non-TTY check from is_verbose_mode() and add comments clarifying that non-TTY behavior is handled in msg_info(). Apply the same verbosity simplification to vm-core.func. This keeps spinner visuals working when passed through pipes while avoiding backgrounding issues.
* feat: add Docker-based tool addons for dockge, komodo, dokploy, npmplus
Create addon scripts following the arcane.sh pattern for Docker-based
tools that can be installed on any existing Docker LXC:
- dockge: Docker Compose stack manager (port 5001)
- komodo: Build/deployment system with MongoDB/FerretDB (port 9120)
- dokploy: PaaS via external installer with Redis (port 3000)
- npmplus: Nginx Proxy Manager Plus via Compose (port 81)
Each addon includes:
- Docker availability check
- Install with full configuration
- Update via docker compose pull
- Uninstall with container cleanup
- ASCII header files
Original ct/ and install/ scripts are preserved for now.
* refactor: convert Docker tools to addons, remove old scripts
Convert dockge, komodo, dokploy, coolify from standalone ct/install
scripts to addon pattern (like arcane.sh).
Added:
- tools/addon/dockge.sh (port 5001)
- tools/addon/komodo.sh (port 9120, MongoDB/FerretDB choice)
- tools/addon/dokploy.sh (port 3000, external installer)
- tools/addon/coolify.sh (port 8000, external installer)
- tools/headers/ for all 4
Removed:
- ct/dockge.sh, ct/komodo.sh, ct/alpine-komodo.sh, ct/dokploy.sh, ct/coolify.sh
- install/dockge-install.sh, install/komodo-install.sh, install/alpine-komodo-install.sh
- install/dokploy-install.sh, install/coolify-install.sh
- frontend/public/json/ for dockge, komodo, dokploy, coolify
- tools/addon/npmplus.sh (not an addon candidate)
These tools are Docker-only and fit the addon pattern: they require
an existing Docker LXC and manage containers via docker compose.
* feat: add addon JSON configs for dockge, komodo, dokploy, coolify
Recreate JSON configs with type=addon, script paths pointing to
tools/addon/*.sh, null resources (addon runs on existing Docker LXC),
and update instructions in notes.
* feat: add Runtipi addon + upgrade all addons with Proxmox host check, optional Docker install, Alpine support
- New: tools/addon/runtipi.sh with full Alpine support (gcompat for musl)
- New: tools/headers/runtipi ASCII header
- Updated: runtipi.json to addon type with null resources
- Removed: ct/runtipi.sh, install/runtipi-install.sh (migrated to addon)
- All addons (dockge, komodo, dokploy, coolify, runtipi) now have:
- check_proxmox_host(): warns when running on PVE host, default N
- check_or_install_docker(): optional Docker install (Debian+Alpine)
- Alpine-aware curl bootstrap and dependency installation
* readd ct, update information
* Create runtipi.sh
* refactor: remove inline header_info from addons, use core.func get_header()
- get_header() in core.func now maps APP_TYPE=addon to tools/headers/ path
- Removed 5 duplicate ASCII art header_info functions from addon scripts
- Addons now use the shared header_info() from core.func + tools/headers/ files
* chore(tools): add Github source links to dockge, komodo, dokploy, coolify, runtipi addons
* fix(runtipi): drop Alpine support; add OS compat notes to docker addon JSONs