kostasapostolopoulos
### Bug description When updating an existing static install via `kickstart.sh` (or `netdata-updater.sh`), the scripts report success even when the update failed. In the observed case, the makeself archive aborted with `Not enough space left in /opt ... to decompress`, nothing was installed, and the agent continued running the old version, but the script still printed `Successfully updated existing netdata install at /opt/netdata`. The updater exited 0, causing users and cron/automation monitoring to believe the update succeeded. Confirmed on v2.11.0; the code path is unchanged on current `master` as of 2026-10-01. The issue affects Linux static binary installs when the filesystem containing the updater temporary directory has less free space than the `.gz.run` archive. Root cause: 1. `makeself` correctly detects insufficient disk space and exits 1. 2. `update_static()` uses the installer exit code only to decide whether to remove the temporary directory, then falls through to an unconditional `return 0`. 3. The updater dispatcher consequently exits 0. 4. `kickstart.sh` interprets the zero exit status as success. 5. On headless runs, installer output is redirected to an fd-3 logfile that is deleted even after the update fails, so the diagnostic error may be lost. Relevant code references: - `packaging/makeself/makeself-header.sh`, disk-space check around lines 645–655. - `packaging/installer/netdata-updater.sh`, `update_static()` around lines 1209–1225 and dispatcher around line 1631. - `packaging/installer/kickstart.sh`, success handling around lines 1292–1300 and updater failure handling around lines 1086–1095. Related issues/PRs: #19483 (similar observable symptom with a different package-manager cause), #21328 (package-manager no-op detection), #14058 (installer output redirection), and #13802 (error propagation). ### Expected behavior A failed static update should cause the updater to exit non-zero with a clear error, such as an insufficient-disk-space message. `kickstart.sh` should report the update failure rather than printing `Successfully updated existing netdata install`. The failure diagnostics should remain available or be emitted to stderr, including for headless and cron-driven updates. ### Steps to reproduce 1. Have an existing static Netdata install with less free space in the updater temporary directory than the update archive size (for example, approximately 880 MB free for an approximately 940 MB `netdata-x86_64-latest.gz.run` archive). 2. Run: ```sh wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh sh /tmp/netdata-kickstart.sh --update ``` 3. Observe the makeself disk-space error followed by `Successfully updated existing netdata install at ...`. 4. Run `netdata -V` and observe that the old version is still installed. ### Installation method kickstart.sh ### System info ```shell Debian GNU/Linux 9 (stretch), kernel 4.9.0-19-amd64, x86_64, bare metal ``` ### Netdata build info ```shell - ``` ### Additional info Actual output includes: ```text Not enough space left in /opt (882932 KB) to decompress /tmp/netdata-updater-mb9NgcoPwM/netdata-x86_64-latest.gz.run (941112 KB) ... Successfully updated existing netdata install at /opt/netdata ``` The updater exits 0, the installed version remains unchanged, and the failed installer's output may be deleted on headless runs. Suggested fix: - Treat a non-zero installer exit in `update_static()` as a failure, either by calling `fatal` with a descriptive error or returning non-zero and handling it in the dispatcher. - Preserve the fd-3 logfile on failure or dump it to stderr. - Optionally pre-check free disk space before downloading the archive and report the required space clearly. Additional related quirks: - `kickstart.sh --dry-run` also prints a success message even though no update is performed. - The makeself abort message suggests `--nodiskspace`, which is unsafe on an almost-full filesystem and is not part of the documented kickstart/updater flow. Evidence: after the failed run, `netdata -V` reported the previous release while the running agent remained operational.