Skip to content

Fix server crashes reported by 25.03 servers - #8246

Merged
ar2rsawseen merged 7 commits into
masterfrom
fix/crash-reports-25.03-server
Nov 9, 2026
Merged

ar2rsawseen merged 7 commits into
masterfrom
fix/crash-reports-25.03-server

Conversation

@Cookiezaurs

Copy link
Copy Markdown
Contributor

Fixes server crashes reported to the crash tracker by 25.03 servers. Each fix is local to the code that crashed: guard a missing value, answer 400 for a bad request parameter, catch and log a promise rejection, or make a callback fire once. No routing or response-shape changes for valid requests.

Fixes

File What now happens instead of the crash Crash groups
api/parts/jobs/manager.js (runLocally) A failed save of the job's done state (job document already gone) is logged as a warning instead of an unhandled rejection 2f19f11674abec9ddc25ef01a3b82e9221d5ef7b
api/parts/jobs/manager.js (schedule) A stored schedule that cannot be compiled is logged and returned as a rejected promise, which clear() now actually logs (its .catch returned a bound function without calling it) 15fcfe4c5b92b9d6e4afc9444512a0dfc37f7479
api/utils/render.js A puppeteer pageerror without an Error object is logged as-is instead of throwing inside the listener daf87db233a6a68a3c934e186669762aa8661c0e
api/jobs/ping.js An error in the job body (e.g. the systemlogs aggregation failing on the database) is logged and the job finishes 65ce065569c884ae3df7c0ce491983fdc33a75bb, 97f7f90ef9a9fc3297f94fefc36a7dc6eed30aed
api/utils/requestProcessor.js A request target without a path is treated as / instead of calling .split on null ba5f63c9b2eac6df10317ecc54f70acda1ac46d3
plugins/server-stats/api/jobs/stats.js An error in the job body (including the stats SDK call) is logged and the job finishes, with done called once 1c207165baf898fe4d2bbe333afaaf8754ba98e5
plugins/reports/api/reports.js, plugins/star-rating/api/api.js (/email/report) A metric's callback is called once: the 30 s plugin timeout and a late plugin answer no longer both call it, and star-rating does not call it again from its catch after answering f189e9db7508e375912228c0229c029f6b337f94
api/parts/data/events.js The segment limit check skips a stored segment list that is not an array instead of calling .indexOf on it 24ae096efb0f86c0d118eebf45ecb6850b8548f1
plugins/push/api/jobs/util/batcher.js multicast skips recipients whose connection pool is gone; do_flush fails the batch with a PushError instead of writing to a missing pool 0e64ba8a41189f720d2f1ad5fb596b7f8fcdcf31, ebd4b53a75191f859c248622adb011aa8afe6d50, e969d607372d5baaf6ddea45bb6aa4c5678500bd
plugins/push/api/api.js (/i) Without an app user, la, auto-trigger and token-session work are skipped instead of reading properties of undefined a010c72394d1e77f122a69c8ac80f62d6710d6e0
plugins/push/api/jobs/util/connector.js A platform entry with no config (plugins.push.<platform> = null) is skipped when loading credentials b7c751164d7b6e3c622a104e1fa1929c77ce5fb3
plugins/push/api/send/platforms/a.js An FCM credential without a service account file (legacy server key) answers with a credentials error ("upload a Firebase service account JSON file") instead of crashing the sending worker in its constructor af846bae2eb5d49ffe6bde48a50ec30350d5055f
plugins/star-rating/api/api.js (/o/feedback/multiple-widgets-by-id) widgets that does not parse to an array answers 400 Invalid widgets d4fbccba883ce28086ad37a29da7bb6832afaf43, dc71e9d445329a578794cc76b58cdaf608f66205
plugins/star-rating/api/api.js (/o?method=star) A non-string period (e.g. a number in a JSON body) answers 400 Bad request parameter: period 84582c4811bc5ce668ca6305002e8aa40d68c779
plugins/dashboards/api/api.js (/master) Scheduling the refresh job retries every second (up to 60 times) until the job manager has scanned the job classes, instead of calling .replace() on undefined in the master process b9460c8f331944da60656cfdcbf2e058bc9a049d
plugins/system-utility/api/api.js /o/system, /i/inspector, /i/profiler without a sub-path fall to the existing unknown-path branch c419585300937aeec9ba7b76444ef8f98fb1f1af
plugins/pluginManager.js (updateApplicationConfigs) Logs through a logger instance; log.e on the log module factory threw cbcdf62e35f9136b1f23d7a02206d2659aa6473b
plugins/views/api/api.js A period that cannot be parsed answers 400 Bad request parameter: period for getTable, getTotals and getExportQuery (a dashboard widget gets empty data) instead of throwing from JSON.parse while building the pipeline ffbaa2f98dbc56c03894c8341c444d612ac07311, 9d2b14e79b7d9081634c5e31f7480ad1f055bdea, ea9d1ab1b86ba0b17d3e0cfee2387c2ab8deec5d, 9cb72ee5e923081774b08c38a436fee8df348899, fcb56543c0b0df5f2ddca3f0f5c4d38861ff34e4, ed4e25ff930fa98f052c68e5a44fa90381db656a, 85085e680a7357b5a696fa7115fe47980a1ea3c5, 7266c80dfe9727e408b4b359573bc94c33b0b359, a96ffa9f2fa316fd541765a788e8363e75736328
plugins/pluginManager.js (dispatch) A handler that throws or rejects in a dispatch with no callback and no params.promises is logged ([plugins] Error in handler of <event>) instead of becoming an unhandled rejection. Logged, no longer crashes only: the handler bugs themselves and how the default branch of requestProcessor dispatches unknown paths are unchanged here and handled separately f961e1dfec05494f685c7fbea7269dc92760a3b2, a3f368fd474c0b5cec5ecbb0e2447aff4377be46, fd40b6c28ccc09d3289da44a9f0e3f1fafdd2c7f, a2be17a5e760fa720d89e7529a8ad629f7fb05bd, 397db82ba257fb0049b8d635d868e7d5ad3573d4, 3f00b27b58f1f539fac2651dc91aef1f4fb6c53b, d9ff65dab157782105572cc30e533b7471884eeb, dfc472c7d2267d3e3df8b0f7887018cad00868c9, 798f65b5814b480c25aac012d392d7b6731be35f, 54b054abd4d27c98474b9de665dff6290c70f331, 61ac5e3fa736cb21865f24d64ad5a6b4562a3d32, 0d215d5de977e9b832e08fcfb86001b20c1beec1, 8b60c9ec9152da84867dcd81e9b7afc93b0ce64f, 5f74ffc547e80b97917bcd2948f174e25386b9a8, d6a77384f72074e98fac5b6e0019609c4a70e097, 2a003fbe0e1d78827d7fd82fbc08a40cb8ad5168, 8dec494f2452013172f1876c82b374e0b3c78139, 7e0930de4d1c1409daa21c26e64a5376e70ce5d9, 37d6ffeb7850cbc379b9828cc005135f2af63ca0, b85c3b3c2a9018012785f93c69d05fc7d8465eee, e9620b4ec1adeb676c306793958cc2764a0c4dee, f19f7fae85e2033c727bbeec3b67477289204d47

Not in this PR

  • Crash groups in the same tracker clusters that are not code on this branch or are already fixed: aab8d0534f6a3fb0f39cbb934c16438c939f55b0, a20446b746970ee0faa0389e11661935907eec9e, 2f38c4a4bcd7ab35aeef1171f874dcb8c36d9242, 8739b9f1bd1b64aa177857210bddfa6562290814 (fixed in earlier 25.03 releases); 3a384f150caa9722354ef89ad27aae0a167e5453, 5caa793c7e2f1e5afde09f61c88cd1583c4055db, 710befde8c812866acf3dca4e3df6a5afc63428c, 5c2bcf037607d85f116212b901cec09b6468f52c, 1b45b2bc075b26733c5171d58d93979a96569354 (development machines); 858caeb58630e71fa069fbb3d78f07df46917ffd (mail transport configuration, not code); 38f7ecf7590c6491dd293a5034044a6927c37ac6, 2aaf7a32cd05c2fc413635fef06ffd339ce4f65a (code outside this repository).
  • server-stats: the SDK side (countly-sdk-nodejs bulk iterating cluster.workers) is not changed; the job now survives it.
  • views: the /dashboard/data widget path keeps its stored period handling; an unparseable period there now yields empty data instead of a thrown error.

How it was checked

  • npx eslint on every changed file: 0 errors (the 5 warnings are pre-existing lines).
  • node --check on every changed file.
  • New unit test in test/unit-tests/api.plugins.dispatch-results.js: a dispatch with no consumer whose handlers throw and reject leaves no unhandled rejection. Passes with the fix, fails without it (npx mocha test/unit-tests/api.plugins.dispatch-results.js).
  • Constructed the FCM connection with a legacy-key credential in a scratch script: the constructor no longer throws and send() rejects with a PushError whose isCredentials is true, which Splitter.connect() turns into "credentials rejected".
  • New API test cases (run by CI's plugin tests, not run locally): views getTable/getTotals with periods ]]> and [1, answer 400; star-rating multiple-widgets-by-id with widgets=null answers 400.
  • Untested here, QA can reproduce: job manager save/schedule failures (remove a running job's document, or store an invalid schedule on a job), ping job on a database without $dateFromParts, report metric timeout racing a late answer, push batcher with a pool closed mid-batch, dashboards /master with a slow job scan, /o/system with no sub-path (now 400 Invalid path), a request whose target has no path, and an event whose stored segment list is not an array.

🤖 Generated with Claude Code

Cookiezaurs and others added 7 commits November 9, 2026 11:37
runLocally now logs a failed save of the done state instead of leaving a
rejected promise, and schedule() returns a rejected promise (logged by
its caller) when a stored schedule cannot be compiled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both jobs run their work in an async callback; an error there is now
logged and the job completes instead of the error becoming an unhandled
rejection with done() never called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-array event segments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A handler that throws or rejects in a dispatch without a callback and
without params.promises is now logged instead of becoming an unhandled
rejection. updateApplicationConfigs logs through a logger instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g and legacy FCM keys

The batcher skips or fails a batch whose connection pool is gone, the
/i hook skips user work when there is no app user, the connector skips
a platform with no config, and an FCM credential without a service
account file answers with a credentials error instead of crashing the
sending worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…idgets and period

The report plugin timeout and a late plugin answer no longer both call
the metric callback; star-rating does not call it again from its catch
after a successful answer. multiple-widgets-by-id answers 400 when
widgets is not an array and method=star answers 400 for a non-string
period.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… missing sub-paths, reject unparseable periods

dashboards retries scheduling its refresh job until the job manager has
found the job class; system-utility treats a missing sub-path as an
unknown path; views answers 400 for a period that cannot be parsed
instead of throwing while building the pipeline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ar2rsawseen
ar2rsawseen merged commit 4a0868e into master Nov 9, 2026
10 of 11 checks passed
@Cookiezaurs
Cookiezaurs deleted the fix/crash-reports-25.03-server branch November 10, 2026 11:59
ar2rsawseen added a commit that referenced this pull request Nov 26, 2026
Same fixes as master's #8246, for crashes 24.05 servers have the same code for:
- events: a segment list stored as something other than an array
- ping and server-stats jobs log errors and finish once
- job manager: a failure computing the next run, clearing a job
- dashboards: retry while the job class is not loaded yet
- plugin dispatch: log failing handlers nobody waits for
- push: missing app user, closed connection pools, missing push config,
  legacy FCM credentials
- reports and star-rating reports answer once
- system-utility: missing sub-path
- views: an unparseable period answers 400

Conflicts kept 24.05's versions where it already had a fix (#8245 views
period fallback, star-rating period check, request docs); the push
connector keeps 24.05's id handling with master's guard.

(cherry picked from commit 4a0868e)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants