fix(backend): pin Node to 22.22 to avoid node-fetch premature-close regression#649
Conversation
…egression
With authz enabled the portal showed "Failed to load platform details"
and broken catalog views: the catalog's internal call to the permission
backend (node-fetch@2 via cross-fetch -> /api/permission/authorize)
failed with ERR_STREAM_PREMATURE_CLOSE, surfacing as a 500 on
/api/catalog/entities/by-refs.
Root cause is the Node 22.23.0 / 24.17.0 security fix for CVE-2026-48931
("response queue poisoning in http.Agent"), which changed keep-alive
socket-reuse behaviour and exposes a latent node-fetch@2 bug (its
malformed-chunked-response detector throws false-positive premature-close
on reused pooled sockets). The base image node:22-bookworm-slim floated
to 22.23.0, which is why this appeared in newly built images. Pin to
22.22 (last release before the regression) until the Node 22.x patch
with nodejs/node#64004 ships.
- backstage/backstage#34651
- nodejs/node#63989
- nodejs/node#64004
Also drop the duplicated helmet/cors/compression from the root router
configure block — applyDefaults() already applies them, so they ran
twice; keep only the IDP token middleware before applyDefaults().
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
|
Warning Review limit reached
More reviews will be available in 44 minutes and 15 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe backend Dockerfile pins the Node runtime base image from ChangesBackend infrastructure and middleware
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Changeset detected — the following file(s) will be released with this PR: |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
With authz enabled the portal showed "Failed to load platform details" and broken catalog views: the catalog's internal call to the permission backend (node-fetch@2 via cross-fetch -> /api/permission/authorize) failed with ERR_STREAM_PREMATURE_CLOSE, surfacing as a 500 on /api/catalog/entities/by-refs.
Root cause is the Node 22.23.0 / 24.17.0 security fix for CVE-2026-48931 ("response queue poisoning in http.Agent"), which changed keep-alive socket-reuse behaviour and exposes a latent node-fetch@2 bug (its malformed-chunked-response detector throws false-positive premature-close on reused pooled sockets). The base image node:22-bookworm-slim floated to 22.23.0, which is why this appeared in newly built images. Pin to 22.22 (last release before the regression) until the Node 22.x patch with nodejs/node#64004 ships.
Also drop the duplicated helmet/cors/compression from the root router configure block — applyDefaults() already applies them, so they ran twice; keep only the IDP token middleware before applyDefaults().
Summary by CodeRabbit