matrix-org / matrix-hookshot

A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA.
https://matrix-org.github.io/matrix-hookshot/
Apache License 2.0
267 stars 66 forks source link

Error on startup with arm64 Docker image with Node > 20.12 #948

Open AndrewFerr opened 2 weeks ago

AndrewFerr commented 2 weeks ago

Deploying the 5.4.0 Docker image on an arm64 deployment hits this crash on startup:

TypeError: request.headers.split is not a function
    at setHeadersOnRequest (/usr/bin/matrix-hookshot/node_modules/@sentry/node/cjs/integrations/undici/index.js:248:39)
    at _onRequestCreate (/usr/bin/matrix-hookshot/node_modules/@sentry/node/cjs/integrations/undici/index.js:158:9)
    at Channel.publish (node:diagnostics_channel:143:9)
    at new Request (node:internal/deps/undici/undici:6295:27)
    at [dispatch] (node:internal/deps/undici/undici:9077:25)
    at Intercept (node:internal/deps/undici/undici:8812:20)
    at [Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16)
    at Client.dispatch (node:internal/deps/undici/undici:5689:44)
    at [dispatch] (node:internal/deps/undici/undici:5920:32)
    at [Intercepted Dispatch] (node:internal/deps/undici/undici:5666:33)
    at Pool.dispatch (node:internal/deps/undici/undici:5689:44)
    at [dispatch] (node:internal/deps/undici/undici:9499:27)
    at Intercept (node:internal/deps/undici/undici:8812:20)
    at [Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16)
    at Agent.dispatch (node:internal/deps/undici/undici:5689:44)
    at node:internal/deps/undici/undici:10485:55

Interestingly, this even happens with a rebuilt image of 5.3.0, which uses a newer version of Node (20.14.0) than was used in the release build from back in April (20.12.2).

Rebuilding 5.4.0 with the older version of Node bypasses this error, so it looks like there is a Node-specific issue with the undici library.

A workaround is to cut a patch release that pins the node:20-slim base image on the working Node version. The true cause of this should be diagnosed to avoid potentially hitting this error when inevitably moving to the next Node version.

AndrewFerr commented 2 weeks ago

The same crash happens with Node 20.13.1.

Half-Shot commented 5 days ago

Looks like https://github.com/getsentry/sentry-javascript/issues/10936