viser icon indicating copy to clipboard operation
viser copied to clipboard

viser 0.2.23.1 message issue

Open hongsukchoi opened this issue 11 months ago • 1 comments

I am using viser 0.2.23 and encountered this issue:

(viser) Connection opened (30, 31 total), 18 persistent messages
connection handler failed
Traceback (most recent call last):
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/websockets/asyncio/server.py", line 374, in conn_handler
    await self.handler(connection)
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/viser/infra/_infra.py", line 368, in ws_handler
    await asyncio.gather(
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/viser/infra/_infra.py", line 566, in _message_consumer
    message = message_class.deserialize(raw)
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/viser/infra/_messages.py", line 155, in deserialize
    return message_type(**message_kwargs)
TypeError: ViewerCameraMessage.__init__() missing 2 required positional arguments: 'near' and 'far'
(viser) Connection opened (31, 32 total), 18 persistent messages
connection handler failed
Traceback (most recent call last):
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/websockets/asyncio/server.py", line 374, in conn_handler
    await self.handler(connection)
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/viser/infra/_infra.py", line 368, in ws_handler
    await asyncio.gather(
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/viser/infra/_infra.py", line 566, in _message_consumer
    message = message_class.deserialize(raw)
  File "/home/hongsuk/anaconda3/envs/hsfm/lib/python3.10/site-packages/viser/infra/_messages.py", line 155, in deserialize
    return message_type(**message_kwargs)
TypeError: ViewerCameraMessage.__init__() missing 2 required positional arguments: 'near' and 'far'

I have the same problem when I downgraded to 0.2.22. 0.2.19 works.

hongsukchoi avatar Feb 13 '25 01:02 hongsukchoi

This can happen if an older version of the Viser client tries to connect to a newer version of the server.

Some possible reasons:

  • If you have an old version of the Viser client in a different tab.
  • If you're on a shared server and somebody else has an old version of the Viser client open (and is trying to connect to the same port).

Ideally we should check that versions match when making connection requests!

brentyi avatar Feb 13 '25 03:02 brentyi