Repository navigation
Bump Node.js to 22.23.4 in 4.10.6 - #1776
Conversation
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>
|
Package builds launched with
Both builds download and bundle Inputs: |
|
Checks run4.10.5 all-in-one upgraded with the DEB package (
Findings
|
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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 🟢

































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/*anddev-tools/build-packages/base-packages-to-base/*do not exist in 4.10.6, so they are dropped. The usage comment ofdev-tools/build-packages/wazuh-dashboard.Dockerfile, which still said18.19.0, is updated instead.package.json: keeps the 4.10.6 dependencies (dompurify ^3.4.16, nodns-sync) and only takeselastic-apm-node ^4.10.0andengines.node>=14.20.1 <23.src/dev/jest/config.js: keeps the 4.10.6@hapi/hoekmapping and adds the@opensearch-project/opensearch/lib/*one.yarn.lock: regenerated withyarn osd bootstrapon 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/coreand@opentelemetry/resourcesresolve 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 onppl.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: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):The only failing suite is
src/plugins/data_source/server/util/endpoint_validator.test.js(5 IPv6deniedIPscases). This change does not touch it, and it fails the same way on4.10.6with Node.js 18.19.0:Type check (
node scripts/type_check):src/core: no errors.packages/osd-optimizer: 6 errors, all inbundle.test.tsandwatch_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.wazuh-dashboard-4.10.6-0.x86_64wazuh-dashboard 4.10.6-0 amd64dnf localinstall/apt-get install)/usr/share/wazuh-dashboard/node/bin/node --versionv18.19.0→v22.23.4v18.19.0→v22.23.4--max-semi-space-size=64opensearch_dashboards.yml,opensearch_dashboards.keystore,wazuh.ymlunchanged (md5)opensearch.username,opensearch.password)/api/request→GET /agents)dateFormat:dow,timepicker:timeDefaults)/api/statusoverallEvery 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.
TypeError: Cannot read properties of undefined (reading 'id') at WzMenu.loadIndexPatternsListonce 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].idwhen 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
Check List
yarn test:jest(touched areas; theendpoint_validatorfailure happens without this change too)yarn test:jest_integration🤖 Generated with Claude Code