Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: request.headers.split is not a function #61

Closed
thospr opened this issue May 18, 2024 · 4 comments
Closed

TypeError: request.headers.split is not a function #61

thospr opened this issue May 18, 2024 · 4 comments
Assignees

Comments

@thospr
Copy link

thospr commented May 18, 2024

After installation and adding the bottoken the adaptor stops and restarts with following error:

2024-05-18 23:17:01.349  - info: host.iobroker instance system.adapter.discord.0 started with pid 15268
2024-05-18 23:17:02.491  - info: discord.0 (15268) starting. Version 2.3.0 in /opt/iobroker/node_modules/iobroker.discord, node: v18.20.2, js-controller: 5.0.19
2024-05-18 23:17:02.594  - error: discord.0 (15268) No or invalid token!
2024-05-18 23:17:12.536  - info: host.iobroker stopInstance system.adapter.discord.0 (force=false, process=true)
2024-05-18 23:17:12.542  - info: discord.0 (15268) Got terminate signal TERMINATE_YOURSELF
2024-05-18 23:17:12.561  - info: discord.0 (15268) terminating
2024-05-18 23:17:12.562  - info: discord.0 (15268) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason
2024-05-18 23:17:12.579  - info: host.iobroker stopInstance system.adapter.discord.0 send kill signal
2024-05-18 23:17:13.043  - info: discord.0 (15268) terminating
2024-05-18 23:17:13.101  - info: host.iobroker instance system.adapter.discord.0 terminated with code 11 (ADAPTER_REQUESTED_TERMINATION)
2024-05-18 23:17:15.621  - info: host.iobroker instance system.adapter.discord.0 started with pid 15395
2024-05-18 23:17:16.771  - info: discord.0 (15395) starting. Version 2.3.0 in /opt/iobroker/node_modules/iobroker.discord, node: v18.20.2, js-controller: 5.0.19
2024-05-18 23:17:16.796  - info: discord.0 (15395) Authorization is enabled but no authorized users are defined!
2024-05-18 23:17:16.938  - error: discord.0 (15395) uncaught exception: request.headers.split is not a function
2024-05-18 23:17:16.938  - error: discord.0 (15395) TypeError: request.headers.split is not a function
    at setHeadersOnRequest (/opt/iobroker/node_modules/@sentry/src/integrations/undici/index.ts:312:39)
    at _onRequestCreate (/opt/iobroker/node_modules/@sentry/src/integrations/undici/index.ts:223:7)
    at Channel.publish (node:diagnostics_channel:141:9)
    at new Request (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:190:23)
    at Client.[dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/client.js:304:21)
    at Intercept (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/interceptor/redirect-interceptor.js:11:16)
    at Client.[Intercepted Dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/dispatcher-base.js:158:12)
    at Client.dispatch (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/dispatcher-base.js:179:40)
    at Pool.[dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/pool-base.js:143:28)
    at Pool.[Intercepted Dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/dispatcher-base.js:150:29)
2024-05-18 23:17:16.938  - error: discord.0 (15395) request.headers.split is not a function
2024-05-18 23:17:17.086  - error: host.iobroker Caught by controller[0]: TypeError: request.headers.split is not a function
2024-05-18 23:17:17.086  - error: host.iobroker Caught by controller[0]:     at setHeadersOnRequest (/opt/iobroker/node_modules/@sentry/src/integrations/undici/index.ts:312:39)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at _onRequestCreate (/opt/iobroker/node_modules/@sentry/src/integrations/undici/index.ts:223:7)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at Channel.publish (node:diagnostics_channel:141:9)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at new Request (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:190:23)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at Client.[dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/client.js:304:21)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at Intercept (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/interceptor/redirect-interceptor.js:11:16)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at Client.[Intercepted Dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/dispatcher-base.js:158:12)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at Client.dispatch (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/dispatcher-base.js:179:40)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at Pool.[dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/pool-base.js:143:28)
2024-05-18 23:17:17.087  - error: host.iobroker Caught by controller[0]:     at Pool.[Intercepted Dispatch] (/opt/iobroker/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher/dispatcher-base.js:150:29)
2024-05-18 23:17:17.087  - error: host.iobroker instance system.adapter.discord.0 terminated with code 1 (JS_CONTROLLER_STOPPED)
2024-05-18 23:17:17.087  - info: host.iobroker Restart adapter system.adapter.discord.0 because enabled

Versions:

  • Adapter version: 2.3.0
  • JS-Controller version: 5.0.19
  • Node version: v18.20.2
  • Operating system: Debian 12
@crycode-de crycode-de self-assigned this May 19, 2024
@crycode-de
Copy link
Owner

According to the error stack trace, the issue is related to sentry (the error reporting tool used by many ioBroker adapters).
Can you run npm list @sentry/node inside the ioBroker installation dir (/opt/iobroker/) and post the output?

@thospr
Copy link
Author

thospr commented May 19, 2024

admin@iobroker /opt/iobroker $ npm list @sentry/node
iobroker.inst@3.0.0 /opt/iobroker
+-- iobroker.js-controller@5.0.19
| `-- @iobroker/plugin-sentry@1.2.1
|   `-- @sentry/node@7.101.1
`-- iobroker.sourceanalytix@0.4.14
  `-- @sentry/node@5.30.0

admin@iobroker /opt/iobroker $

@crycode-de
Copy link
Owner

Your installation contains an outdated version of the @sentry/node module which might be affected by this issue.

Try to run npm update @sentry/node to update this module.
After the update, it should look like this:

peter@iobroker-test:/opt/iobroker$ npm update @sentry/node

changed 6 packages in 13s

47 packages are looking for funding
  run `npm fund` for details

peter@iobroker-test:/opt/iobroker$ npm list @sentry/node
iobroker.inst@3.0.0 /opt/iobroker
`-- iobroker.js-controller@5.0.19
  `-- @iobroker/plugin-sentry@1.2.1
    `-- @sentry/node@7.116.0

@thospr
Copy link
Author

thospr commented May 19, 2024

Thanks, now the adapter starts without errors.

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

No branches or pull requests

2 participants