Skip to content

The websocket doesn't reconnect after the ECONNRESET error occurs #279

@yaohuiwu

Description

@yaohuiwu

the code that reproduces this issue or a replay of the bug

None

Describe the bug

Describe the bug
We are using the ChatGPT-Midjourney which uses your midjourney-api library.

After the service is started, the image can be generated, but after a period of time (half a day?), the image cannot be generated. After restarting the service, it returns to normal. This situation has occurred many times.

Check the log for ECONNRESET errors. After this error occurs, there is no heartbeat log.

Please check whether the reconnection logic takes into account the ECONNRESET situation.

Expected behavior
The websocket can reconnect when this error happens.

Screenshots
If applicable, add screenshots to help explain your problem.

error log

Error: Client network socket disconnected before secure TLS connection was established
at connResetException (node:internal/errors:720:14)
at TLSSocket.onConnectEnd (node:_tls_wrap:1714:19)
at TLSSocket.emit (node:events:529:35)
at endReadableNT (node:internal/streams/readable:1400:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ECONNRESET',
path: undefined,
host: 'gateway.discord.gg',
port: 443,
localAddress: undefined
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions