Skip to content

Improve the offline installation prerequisites check and agent next steps - #1254

Merged
jotamolas merged 4 commits into
5.0.0from
enhancement/1253-offline-install-ux
Nov 30, 2026
Merged

jotamolas merged 4 commits into
5.0.0from
enhancement/1253-offline-install-ux

Conversation

@jotamolas

@jotamolas jotamolas commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Description

Closes #1253

The Experience Quality team followed the 5.0.0 offline installation pages with the installation assistant (report R238 in wazuh/external-devel-requests#6948). This PR fixes R238-UX-02 and R238-UX-05, documents the part of R238-UX-04 that belongs to the installation assistant, and leaves R238-UX-03 out. The reasons are below.

  • R238-UX-05, missing packages one at a time: --offline-installation checked the operating system packages in two rounds (the assistant's, then the component's) and stopped at the first missing one. offline_checkPrerequisites now collects every missing package from both rounds, and offline_reportMissingPrerequisites stops once with the full list and the commands to download them with their dependencies and to install them:

    ERROR: These packages are necessary for the offline installation and are not installed: curl gnupg adduser iproute2 libcap2-bin.
    ERROR: Download them with their dependencies on a host with Internet access and the same operating system version and architecture as this one:
    ERROR:     sudo apt-get update && apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances curl gnupg adduser iproute2 libcap2-bin | grep '^\w' | sort -u)
    ERROR: Copy the files to a directory of this host, install them from it and run the assistant again:
    ERROR:     sudo dpkg -i ./*.deb
    

    On RPM-based systems the commands are dnf download --resolve --alldeps --arch <arch> --arch noarch ... and dnf install --disablerepo='*' --skip-broken ./*.rpm. The packages alone (apt-get download, yumdownloader --resolve) were not enough in testing: they leave out the dependencies the target lacks or has in an older version.

  • RPM, gnupg reported missing: the check compared package names, so gnupg was always missing on RHEL (gnupg2) and Amazon Linux 2023 (gnupg2-minimal). It now uses rpm -q --whatprovides, which also skips the yum repositories, which time out without Internet access.

  • R238-UX-02, next steps after an offline installation: the summary sent users to Deploy new agent, whose commands download the agent. With --offline-installation it now tells to copy the agent package (and GPG-KEY-WAZUH for an RPM package) to the endpoint, install it with the token and start the agent, and links the offline guide. Online and offline, the token command ends with 2>/dev/null: the token goes to standard output and its details to standard error, and through a pipe or a file the token comes after its details, so taking "the first line" picks a detail and the agent does not enroll.

  • R238-UX-04, content updates: offline-assisted-install.md now explains that the content shipped with the Wazuh indexer keeps loading after the installation, that an offline update is answered with 409 until then, and links the Indexer's offline content update procedure. --download-content/--update-content are not added: they would follow internals of the content manager and of the Wazuh manager that are not a versioned interface.

  • R238-UX-03, agent packages in -dw: not implemented. The installation assistant installs the central components, not endpoints. Downloading and checking agent packages for every platform would make it own packages it never installs. The offline summary says to copy the agent package and links the offline guide.

  • Docs: sample output of the summary in the offline, all-in-one and clusterized guides; offline-download-packages.md names the libcap2-bin/libcap package instead of the setcap command and explains how to download and install missing packages.

Tests

Unit tests

735 passed, 2 skipped

The new and changed tests fail on 5.0.0 without this change, and pass with it:

FAILED tests/unit/test_offline.py::TestOfflinePrerequisites::test_all_installed
FAILED tests/unit/test_offline.py::TestOfflinePrerequisites::test_apt_lists_missing_from_both_rounds_once
FAILED tests/unit/test_offline.py::TestOfflinePrerequisites::test_yum_suggests_dnf_download_with_dependencies
FAILED tests/unit/test_dashboard.py::TestDashboardInitialize::test_aio_prints_the_next_steps_to_enroll_agents
FAILED tests/unit/test_dashboard.py::TestDashboardInitialize::test_next_steps_print_only_the_token
FAILED tests/unit/test_dashboard.py::TestDashboardInitialize::test_offline_next_steps_install_the_agent_package_locally
FAILED tests/unit/test_dashboard.py::TestDashboardInitialize::test_distributed_next_steps_point_to_the_manager
7 failed, 37 passed

Offline installation on hosts without Internet access

wazuh-install.sh built from this branch, 5.0.0-rc2 packages (-d local with the rc2 artifact_urls file), AWS instances with outgoing traffic blocked with iptables (curl to packages.wazuh.com fails).

Check Ubuntu 24.04 (DEB) Rocky 9 (RPM)
-dw on a host with Internet access wazuh-offline.tar.gz in 57 s 1 min 43 s
Missing packages from both rounds, one error, exit 1 curl iproute2 libcap2-bin tar iproute
gnupg not reported missing with gnupg2 installed — Yes
Offline all-in-one installation Exit 0, 7 min Exit 0, 3.5 min
Next steps without Deploy new agent Yes Yes
Agent on a third host without Internet access, installed with the summary's commands Enrolled, "status": "active" on the manager Not run; rpm -K of the agent package with the bundled key: digests signatures OK
Offline content update right after the installation 409 A content update is already in progress. for about 7 minutes (4 vCPU, 8 GB) Not run

The first round of this test found the three problems fixed in 124cef4: the token is not the first line through a pipe, the agent does not start by itself, and the packages alone are not enough. The download and install commands of 124cef4 were then checked in containers without network: Ubuntu 24.04 with curl, iproute2 and libcap2-bin missing (50 packages downloaded, dpkg -i exit 0), and Rocky 9 with tar and iproute removed (29 packages, dnf install --skip-broken installed tar, iproute, libbpf and psmisc). The built installer prints the new error on both.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🧪 Unit Tests Results

✅ All tests passed!

Summary

📊 Coverage Details

Name                                     Stmts   Miss  Cover   Missing
----------------------------------------------------------------------
tests/unit/conftest.py                      37      5    86%   107-110, 116
tests/unit/test_cert_functions.py          693      2    99%   171, 240
tests/unit/test_checks.py                  255      0   100%
tests/unit/test_common.py                   69      0   100%
tests/unit/test_credentials.py             167      0   100%
tests/unit/test_dashboard.py               231      0   100%
tests/unit/test_help.py                     21      0   100%
tests/unit/test_indexer.py                 144      0   100%
tests/unit/test_install_common.py          549      2    99%   618, 1091
tests/unit/test_manager.py                 208      0   100%
tests/unit/test_offline.py                  51      0   100%
tests/unit/test_passwords_functions.py     594      0   100%
tests/unit/test_passwords_main.py          163      0   100%
----------------------------------------------------------------------
TOTAL                                     3182      9    99%

@vcerenu

vcerenu commented Nov 27, 2026

Copy link
Copy Markdown
Member

Review of #1254

Verdict: changes requested. On a distributed node (-wi, -wm, -wd) without tar, --offline-installation now stops with a misleading There is no config.yml in ./wazuh-install-files.tar instead of the list of missing packages.

Verified against 5.0.0 @ 2aa7262 and the PR head @ d4a2859.

Blocking: the tar file is read before the missing packages are reported

offline_reportMissingPrerequisites runs just before offline_checkPreinstallation (install_functions/installMain.sh:335). Before that, on distributed nodes, checks_previousCertificate reads wazuh-install-files.tar with tar (checks_tarFiles). Without tar the member list is empty, and the assistant says the tar file is damaged. Before this PR, the assistant round exited on tar first. tar is missing on the minimal Rocky 9 and Amazon Linux 2023 images (rpm -q --whatprovides tar → no package provides tar), and this PR's own test found it missing on Rocky 9.

wazuh-install.sh built with builder.sh -i, real main(), host mocked without tar:

Build -wi node-1 -of -a -of
5.0.0 ERROR: tar is necessary for the offline installation. same
PR ERROR: There is no config.yml in ./wazuh-install-files.tar. Create the file again with -g|--generate-config-files. full list
PR + fix ERROR: These packages are necessary for the offline installation and are not installed: tar procps diffutils. full list

The component package lists do not depend on the port checks, so both rounds and the report can run together:

     elif [ -n "${offline_install}" ]; then
         offline_checkPrerequisites "wia_offline_dependencies" "${wia_offline_dependencies[@]}"
+        [ -n "${AIO}" ] && offline_checkPrerequisites "AIO"
+        [ -n "${indexer}" ] && offline_checkPrerequisites "indexer"
+        [ -n "${wazuh}" ] && offline_checkPrerequisites "wazuh"
+        [ -n "${dashboard}" ] && offline_checkPrerequisites "dashboard"
+        offline_reportMissingPrerequisites
     fi

Also remove the four offline_checkPrerequisites "<component>" blocks after checks_ports, and the offline_reportMissingPrerequisites call before offline_checkPreinstallation. With the fix, the unit tests still pass (737 passed). With every package installed, -a -of reaches offline_checkPreinstallation, and -wi node-1 -of goes on to the certificate checks.

Non-blocking

  • Content load time. offline-assisted-install.md says "about half an hour". The measurements were about 20 min in the R238 report and about 7 min in this PR's test (4 vCPU, 8 GB). "From a few minutes to about 20, depending on the hardware" matches both.
  • 2>/dev/null also hides the token command's errors. In token_cli.c (wazuh 5.0.0), only the token goes to stdout (:384). The details and every ERROR go to stderr, including Enrollment tokens are minted and revoked on the master node. (:295), which a user on a worker node would hit. The command then prints nothing. Add one line to the summary: "If it prints nothing, run it without 2>/dev/null to see the error."

Verified, no change needed

  • rpm -q --whatprovides: gnupg2 (Rocky 9), and gnupg2-minimal and curl-minimal (Amazon Linux 2023), count as installed.
  • dnf download: every RPM system that check_dist supports (RHEL 9, 10, Amazon Linux 2023) has dnf.
  • Agent commands in the offline summary: same form as docs/ref/getting-started/installation.md in wazuh 5.0.0. The agent packages run register_configure_agent.sh on install.
  • The offline guide URL exists in wazuh-documentation 5.0.0. The wazuh-indexer-plugins v5.0.0 tag does not exist yet; the link uses the same pattern as the existing links.
  • Unit tests: 737 passed. The 7 new and changed tests fail with the 5.0.0 code.

@jotamolas
jotamolas force-pushed the enhancement/1253-offline-install-ux branch from cbfed2d to 67b514a Compare November 27, 2026 21:43
@jotamolas

jotamolas commented Nov 27, 2026 •

Copy link
Copy Markdown
Member Author

Thanks, all three applied in cea3b8f.

  • Blocking: the component checks and the report now run right after the assistant's own packages, before anything reads the tar files. With the installer built from the branch on Rocky 9 without tar, -wi node-1, -wm manager and -a list every missing package (tar diffutils iproute procps-ng). With all of them installed, -wi goes on to the certificate checks.
  • Content load time: now "from a few minutes to about 20, depending on the hardware".
  • 2>/dev/null: the summary and the three guides now add "If it prints nothing, run it without 2>/dev/null to see the error."

Unit tests: 735 passed, 2 skipped.

@vcerenu vcerenu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- With --offline-installation, collect every missing package across the
  assistant and component checks and stop once, naming all of them with
  the command to download them (R238-UX-05).
- On RPM-based systems, check what the installed packages provide with
  rpm -q --whatprovides, so gnupg2 and gnupg2-minimal count as gnupg and
  the check does not go through the yum repositories.
- In the installation summary, say which line of the enrollment token
  command is the token; offline, tell to install the agent package copied
  to the endpoint with the token instead of Deploy new agent, and link the
  offline guide (R238-UX-02).

Refs #1253
Explain in the offline installation assistant guide that the content
shipped with the Wazuh indexer keeps loading after the installation, that
an offline update request is answered with 409 until it ends, and link
the offline content update procedure (R238-UX-04).

Refs #1253
…ting

Testing on real hosts without Internet access showed that:
- Through a pipe or a file, the token printed by --create-enrollment-token
  comes after its details, so it is not "the first line". The summary now
  gives the command with 2>/dev/null, which prints only the token.
- The agent installed with a token does not start by itself: add
  systemctl enable --now wazuh-agent to the offline next steps, and say to
  copy GPG-KEY-WAZUH with an RPM package.
- apt-get download and yumdownloader --resolve of the missing packages
  alone are not enough: they leave out dependencies the target lacks or has
  in an older version. Suggest downloading the dependencies too
  (apt-cache depends --recurse, dnf download --resolve --alldeps) on a host
  with the same operating system and architecture, and installing them with
  dpkg -i or dnf install --disablerepo='*' --skip-broken.

Refs #1253
On a distributed node, checks_previousCertificate reads
wazuh-install-files.tar with tar before the component packages were
checked, so a node without tar stopped with "There is no config.yml"
instead of the list of missing packages. Check the packages of every
component and report them right after the assistant's own packages.

Also say in the summary what to do when the token command prints nothing
(its errors go to standard error), and give the content load time measured
in the tests.

Refs #1253
@jotamolas
jotamolas force-pushed the enhancement/1253-offline-install-ux branch from 67b514a to cea3b8f Compare November 30, 2026 11:28
@jotamolas
jotamolas merged commit 5354603 into 5.0.0 Nov 30, 2026
2 checks passed
@jotamolas
jotamolas deleted the enhancement/1253-offline-install-ux branch November 30, 2026 11:31
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.

Offline installation with the assistant: UX findings on the 5.0.0 docs

2 participants