Skip to content

Bump Node.js to 22.23.4 in 4.10.6 - #1776

Merged
Desvelao merged 4 commits into
4.10.6from
fix/1757-node-22.23.4
Nov 27, 2026
Merged

Desvelao merged 4 commits into
4.10.6from
fix/1757-node-22.23.4

Conversation

@yenienserrano

@yenienserrano yenienserrano commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Description

Backport of #1733 to 4.10.6. Bumps the bundled Node.js from 18.20.8 to 22.23.4 (Node.js 18 is end-of-life), together with the parts of the upstream Node.js 20 and 22 migrations that #1733 brought to 2.19.x:

The two commits of #1733 are cherry-picked (-x) with these adaptations to 4.10.6:

  • dev-tools/build-dev-image/* and dev-tools/build-packages/base-packages-to-base/* do not exist in 4.10.6, so they are dropped. The usage comment of dev-tools/build-packages/wazuh-dashboard.Dockerfile, which still said 18.19.0, is updated instead.
  • package.json: keeps the 4.10.6 dependencies (dompurify ^3.4.16, no dns-sync) and only takes elastic-apm-node ^4.10.0 and engines.node >=14.20.1 <23.
  • src/dev/jest/config.js: keeps the 4.10.6 @hapi/hoek mapping and adds the @opensearch-project/opensearch/lib/* one.
  • yarn.lock: regenerated with yarn osd bootstrap on Node.js 22.23.4. The changed entries are the same as in Bump Node.js to 22.23.4 in 4.14.11 #1733, except @opentelemetry/core and @opentelemetry/resources resolve to 2.12.1 instead of 2.12.0.
  • CHANGELOG.md: entry under 4.10.6.

The rest is unchanged from #1733: .nvmrc, .node-version, Dockerfile, TESTING.md, exit_on_warning.js, node.options / node.options.prod (--max-semi-space-size=64), keystore read as utf8, data source client pool size 10 and 5s timeout on ppl.getDataConnections, the Node.js 22 typing casts and the test expectation updates.

Companion PR: wazuh/wazuh-dashboard-plugins#9674.

Issues Resolved

Closes #1757

Evidence

Node.js 22.23.4 (nvm use 22.23.4).

yarn osd bootstrap:

 succ [opensearch-dashboards] bootstrap complete
Done in 125.28s.

Jest on every area touched by this change (osd-opensearch-archiver, core/server/plugins/discovery, core/server/utils/streams, core/server/metrics, cookie_session_storage, legacy/server/keystore, data_source, data_source_management/server, setup_node_env, core/server/config):

Test Suites: 1 failed, 67 passed, 68 total
Tests:       5 failed, 1058 passed, 1063 total

The only failing suite is src/plugins/data_source/server/util/endpoint_validator.test.js (5 IPv6 deniedIPs cases). This change does not touch it, and it fails the same way on 4.10.6 with Node.js 18.19.0:

v18.19.0
  ● endpoint_validator › deniedIPs validation › should block IPv6 loopback address
  ...
Tests:       5 failed, 27 passed, 32 total

Type check (node scripts/type_check):

  • src/core: no errors.
  • packages/osd-optimizer: 6 errors, all in bundle.test.ts and watch_bundles_for_changes.test.ts, which this change does not touch. cache.ts, the only file changed there, has no errors.

The pre-commit hook (eslint) passed on the compatibility commit.

Packages

Packages from https://github.com/wazuh/wazuh-dashboard/actions/runs/44369361923 (RPM) and https://github.com/wazuh/wazuh-dashboard/actions/runs/44369354715 (DEB), tested in x86_64 containers with systemd (AlmaLinux 9 for the RPM, Ubuntu 22.04 for the DEB) on top of a Wazuh 4.10.5 all-in-one installed with wazuh-install.sh -a.

Check RPM wazuh-dashboard-4.10.6-0.x86_64 DEB wazuh-dashboard 4.10.6-0 amd64
Upgrade from 4.10.5 (dnf localinstall / apt-get install) ✅ ✅
/usr/share/wazuh-dashboard/node/bin/node --version v18.19.0 → v22.23.4 v18.19.0 → v22.23.4
Node.js flags include --max-semi-space-size=64 ✅ ✅
opensearch_dashboards.yml, opensearch_dashboards.keystore, wazuh.yml unchanged (md5) ✅ ✅
Keystore created by 4.10.5 loads (opensearch.username, opensearch.password) ✅ ✅
Session cookie created on 4.10.5 still valid ✅ ✅
Wazuh API token created on 4.10.5 (/api/request → GET /agents) 200 200
Saved objects created on 4.10.5 (dashboard, saved query) ✅ ✅
Advanced settings changed on 4.10.5 (dateFormat:dow, timepicker:timeDefaults) ✅ ✅
/api/status overall green green
Downgrade to 4.10.5 and upgrade again ✅ ✅

Every app was loaded with headless Chrome (49 pages): all the Wazuh apps (Overview, Configuration Assessment, Malware Detection, FIM, Threat Hunting, Vulnerability Detection, MITRE ATT&CK, PCI DSS, GDPR, HIPAA, NIST 800-53, TSC, Docker, AWS, Google Cloud, GitHub, Office 365, Endpoints, Groups, Rules, Decoders, CDB lists, Status, Cluster, Statistics, Logs, Settings, Dev Tools, Ruleset Test, Security, Sample Data, Reporting, Server APIs, App Settings, About) and the platform ones (Discover, Dashboards and the dashboard created on 4.10.5, Visualize, Console, Index patterns, Saved objects, Advanced settings, Security users and roles, Alerting, Notifications, Reporting, Index Management). The check looks for danger toasts and callouts, error prompts, "app not found", uncaught JS exceptions and HTTP 5xx responses.

  • 4.10.5 (baseline, RPM): 49/49 clean.
  • 4.10.6: 49/49 clean on the second run (RPM).
  • The first load of the Overview right after the upgrade threw TypeError: Cannot read properties of undefined (reading 'id') at WzMenu.loadIndexPatternsList once on the RPM and once on the DEB. The page rendered normally. It did not happen again in 8 more loads, including first loads after a restart on both 4.10.5 and 4.10.6. This frontend code is the same as in 4.10.5 (list[0].id when the index pattern list comes back empty), so it looks like an existing race on the first load and not a Node.js regression.

Changelog

  • chore: Bump Node.js to 22.23.4

Check List

  • All tests pass
    • yarn test:jest (touched areas; the endpoint_validator failure happens without this change too)
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

🤖 Generated with Claude Code

yenienserrano and others added 3 commits November 18, 2026 15:11
Backport of #1733 (first commit). dev-tools/build-dev-image and
dev-tools/build-packages/base-packages-to-base do not exist in 4.10.6,
so the usage comment of dev-tools/build-packages/wazuh-dashboard.Dockerfile
is updated instead.

(cherry picked from commit 5ec6bc3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com>
Bring the changes OpenSearch Dashboards made to run on Node.js 20 and 22
(4ef7f0b, 14813de, 288a8eb) into 4.10.6:

- exit_on_warning: ignore MODULE_TYPELESS_PACKAGE_JSON and the fs.Stats
  deprecation, matching by name, code or message, so new Node.js 22
  warnings do not terminate the server.
- node.options: add --max-semi-space-size=64 (active in node.options.prod).
- keystore: read the keystore file as utf8.
- data connections: 5s timeout on ppl.getDataConnections and a default
  data source client pool size of 10, fixing a memory leak on Node.js 20+.
- Type casts for timers and hapi plugins, and the
  @opensearch-project/opensearch/lib/* path mappings.
- elastic-apm-node ^4.10.0, which supports Node.js 22.
- Tests: update assertions for the new JSON.parse, fs and stream error
  messages.

@types/node stays on ~18.7.0: newer typings need TypeScript >= 4.5.

yarn.lock regenerated with yarn osd bootstrap on Node.js 22.23.4. The
jest moduleNameMapper keeps the 4.10.6 @hapi/hoek mapping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com>
(cherry picked from commit 84231b4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com>
@yenienserrano

yenienserrano commented Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Package builds launched with (4.x) Build Wazuh dashboard package with plugins (on demand) from fix/1757-node-22.23.4:

Package Run Result Package
DEB amd64 https://github.com/wazuh/wazuh-dashboard/actions/runs/44369354715 ✅ success wazuh-dashboard_4.10.6-0_amd64_1a12154.deb
RPM x86_64 https://github.com/wazuh/wazuh-dashboard/actions/runs/44369361923 ✅ success wazuh-dashboard_4.10.6-0_x86_64_1a12154.rpm

Both builds download and bundle node-v22.23.4-linux-x64.tar.gz.

Inputs: reference_wazuh_plugins=fix/1757-node-22.23.4 (wazuh/wazuh-dashboard-plugins#9674), reference_security_plugins=4.10.6, revision=0, is_stage=false, checksum=false.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🔗 Workflow run · commit 123d49b93a578485bf35be838ba4868ba641729a

@yenienserrano

yenienserrano commented Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Screenshots from the package test described in the PR description (RPM, AlmaLinux 9 x86_64, on top of a Wazuh 4.10.5 all-in-one), taken by the headless Chrome check of every app. The 4.10.6 column is after upgrading the dashboard from 4.10.5; the dashboard row is the one created on 4.10.5 before the upgrade.

Screenshots: 4.10.5 (Node.js 18.19.0) vs 4.10.6 (Node.js 22.23.4)
Screen 4.10.5 · Node.js 18.19.0 4.10.6 · Node.js 22.23.4
Overview 4.10.5 Overview 4.10.6 Overview
Threat Hunting 4.10.5 Threat Hunting 4.10.6 Threat Hunting
Vulnerability Detection 4.10.5 Vulnerability Detection 4.10.6 Vulnerability Detection
Endpoints 4.10.5 Endpoints 4.10.6 Endpoints
Rules 4.10.5 Rules 4.10.6 Rules
Server status 4.10.5 Server status 4.10.6 Server status
Discover 4.10.5 Discover 4.10.6 Discover
Dashboard created on 4.10.5 4.10.5 Dashboard created on 4.10.5 4.10.6 Dashboard created on 4.10.5
Dev Tools console 4.10.5 Dev Tools console 4.10.6 Dev Tools console
Security, internal users 4.10.5 Security, internal users 4.10.6 Security, internal users
Alerting 4.10.5 Alerting 4.10.6 Alerting
App Settings 4.10.5 App Settings 4.10.6 App Settings

@yenienserrano yenienserrano self-assigned this Nov 19, 2026
@yenienserrano yenienserrano linked an issue Nov 20, 2026 that may be closed by this pull request
6 tasks done
@Ripdiegozz

Ripdiegozz commented Nov 24, 2026 •

Copy link
Copy Markdown

Checks run

4.10.5 all-in-one upgraded with the DEB package (1a12154). Before is 4.10.5-1, after is 4.10.6-0. CI is compared with the base head 10a44fd43 (Build and test).

Check Before After
🟢 Node.js v22.23.4, running with --max-semi-space-size=64 version before version after
🟢 Config files and keystore unchanged config before config after
🟢 Session, API token, saved query and advanced setting from 4.10.5 still work state before state after
🟢 No errors in the service log Not run logs
🟢 32 apps load without errors Not run overview discover
🔴 5 suites fail that pass on the base: node_versions_must_match, import_legacy_file and data_view (ciGroup4), opensearchdsl (ciGroup3), and build.test.ts in osd-plugin-helpers (ciGroup1) Base PR

Findings

  1. Five tests still expect Node.js 18 behavior (medium): the code in this PR doesn't break them. They check exact things that Node.js prints or does, and those changed between 18 and 22. Upstream fixed the same tests when it moved to Node.js 20 and 22 (4ef7f0b1f8 and 288a8eb50e), but those changes never reached 4.10.x, so they have to come with this backport:

    • opensearchdsl.test.ts and import_legacy_file.test.ts check the exact JSON.parse error. Since Node.js 20 the message is Unexpected token 'i', "invalid json" is not valid JSON instead of Unexpected token i in JSON at position 0.
    • data_view.test.tsx has a snapshot of an EventEmitter, which in Node.js 22 has a new internal property, Symbol(shapeMode).
    • build.test.ts in osd-plugin-helpers compares the whole build output, and with Node.js 22 a dependency now triggers a deprecation warning (DEP0180, the fs.Stats constructor) that shows up in it.
    • node_versions_must_match was written when .nvmrc held only the major version (18, from Bump Node.js from 18.19.0 to 18.20.8 to fix CVEs opensearch-project/OpenSearch-Dashboards#12401), so it reads it with Number(), and 22.23.4 gives NaN. .nvmrc is fine with the full version, and it's better that way because the workflows (node-version-file) and docker/dev.sh install exactly what it says. The test is what needs to change.

    Fix: take the hunks for these files from the two upstream commits. Two of them need a note:

    • In src/dev/node_versions_must_match.test.ts, compare the full versions, as main does:
      -    expect(semver.major(nodeVersion.trim())).to.be(Number(nvmrc.trim()));
      +    expect(nodeVersion.trim()).to.be(nvmrc.trim());
    • In build.test.ts the upstream regexp only removes the first warning. A second one comes prefixed with │ warn worker stderr, so the regexp has to be global:
      +const processProcOutput = (all: string | undefined) => {
      +  const regexp = /\n[^\n]*\(node:\d+\) \[DEP0180\] DeprecationWarning: fs\.Stats constructor is deprecated\.\n[^\n]*\(Use `node --trace-deprecation \.\.\.` to show where the warning was created\)/g;
      +  return all?.replace(regexp, '');
      +};
      ...
      -  expect(buildProc.all).toMatchInlineSnapshot(`
      +  expect(processProcOutput(buildProc.all)).toMatchInlineSnapshot(`

@Ripdiegozz Ripdiegozz left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The package upgrades fine from 4.10.5. The only problem is in the tests: five of them still expect the Node.js 18 output, so they fail in CI while they pass on the base. Details and fixes in #1776 (comment)

- node_versions_must_match: compare the full .node-version and .nvmrc
  strings, since .nvmrc now holds the full version.
- opensearchdsl, import_legacy_file: expect the Node.js 20+ JSON.parse
  error message.
- data_view snapshot: add the Symbol(shapeMode) property that
  EventEmitter has in Node.js 22.
- osd-plugin-helpers build.test: strip the DEP0180 fs.Stats deprecation
  warning from the build output before the inline snapshots.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>

@Ripdiegozz Ripdiegozz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The five tests pass now with 123d49b. The remaining unit test failures also fail on the base, and use_search.test.tsx is flaky (it fails in the push run and passes in the pull_request run of the same commit). LGTM 🟢

@Desvelao
Desvelao merged commit cc85a81 into 4.10.6 Nov 27, 2026
27 of 65 checks passed
@Desvelao
Desvelao deleted the fix/1757-node-22.23.4 branch November 27, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backport the Node.js 22.23.4 upgrade to 4.10.6

3 participants