Skip to content

[Bug] Application fails to start due to "Unsupported protocol" error when connecting to InfluxDB #9

@medchedli

Description

@medchedli

Hexabot API is crashing during the startup process with an unhandledRejection error. The error originates from the InfluxDB client, which is unable to parse the provided connection URL. This is a critical issue as it prevents the application from running.

The root cause is that the URL provided to the @influxdata/influxdb-client is missing a valid network protocol (like http:// or https://). The client received "influxdb:8086" and interpreted "influxdb:" as an unsupported protocol.

[Nest] 288  - 07/31/2025, 9:40:06 AM   ERROR [unhandledRejection] 
┌─ UNHANDLED PROMISE REJECTION ─────────────────────
│ Error: Unsupported protocol "influxdb: in URL: "influxdb:8086"
│ Type: Error
│ Time: 2025-07-31T09:40:06.817Z
│ Stack:
│   Error: Unsupported protocol "influxdb: in URL: "influxdb:8086"
│       at Ce (/app/node_modules/@influxdata/influxdb-client/src/impl/node/NodeHttpTransport.ts:110:13)
│       at U (/app/node_modules/@influxdata/influxdb-client/src/InfluxDB.ts:45:49)
│       at InfluxdbHelper.onApplicationBootstrap (/app/src/.hexabot/contrib/extensions/helpers/hexabot-helper-influxdb/index.helper.ts:54:19)
│       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
│       at async Promise.all (index 1)
│       at async callModuleBootstrapHook (/app/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js:43:5)
│       at async NestApplication.callBootstrapHook (/app/node_modules/@nestjs/core/nest-application-context.js:243:13)
│       at async NestApplication.init (/app/node_modules/@nestjs/core/nest-application.js:102:9)
│       at async NestApplication.listen (/app/node_modules/@nestjs/core/nest-application.js:169:33)
│       at bootstrap (/app/src/main.ts:186:3)
└───────────────────────────────────────────────────

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions