Skip to content

Encountered error on websocket #673

Open
@salvoversonic

Description

@salvoversonic

Observed behavior

Hi, in my company we are using NATS on several services. The client connects via websocket. We have noticed that randomly this error happens:

nats: encountered error
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/nats/aio/client.py", line 2117, in _read_loop
    await self._ps.parse(b)
  File "/usr/local/lib/python3.8/dist-packages/nats/protocol/parser.py", line 95, in parse
    self.buf.extend(data)
TypeError: can't extend bytearray with int

After this error I have to restart the service because the client doesn't reconnect with the server.

I have investigated a bit and I found this other issue:

where it seems the same problem but should be fixed and the commit merged time ago.

Someone can kindly help me to understand the problem and trying to find a workaround to handle it?? Thank you in advance!

Expected behavior

I expected a reconnection of the client ideally or a way to handle it

Server and client version

nats-server: v2.10.22
nats-py: 2.9.0

Host environment

No response

Steps to reproduce

It happens randomly, I was not able to reproduce it by myself, sorry

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSuspected defect such as a bug or regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions