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

CartesiaTTSService: Potential Bug in WebSocket Handling #471

Open
dominikroblek opened this issue Sep 18, 2024 · 3 comments
Open

CartesiaTTSService: Potential Bug in WebSocket Handling #471

dominikroblek opened this issue Sep 18, 2024 · 3 comments

Comments

@dominikroblek
Copy link

dominikroblek commented Sep 18, 2024

Occasionally, I encounter this error in CartesiaTTSService. Could this be a bug in the CartesiaTTSService, the Cartesia library, or my code?

2024-09-18 09:25:01.202 | ERROR | pipecat.services.cartesia:_receive_task_handler:189 - CartesiaTTSService#0 exception: no close frame received or sent
Traceback (most recent call last):

File "/Users/magnacarta/p/sunray/.venv/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 963, in transfer_data
message = await self.read_message()
│ └ <function WebSocketCommonProtocol.read_message at 0x13c9f4360>
└ <websockets.legacy.client.WebSocketClientProtocol object at 0x175ec6fc0>
File "/Users/magnacarta/p/sunray/.venv/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1033, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
│ │ │ └ 1048576
│ │ └ <websockets.legacy.client.WebSocketClientProtocol object at 0x175ec6fc0>
│ └ <function WebSocketCommonProtocol.read_data_frame at 0x13c9f4400>
└ <websockets.legacy.client.WebSocketClientProtocol object at 0x175ec6fc0>
File "/Users/magnacarta/p/sunray/.venv/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1108, in read_data_frame
frame = await self.read_frame(max_size)
│ │ └ 1048576
│ └ <function WebSocketCommonProtocol.read_frame at 0x13c9f44a0>
└ <websockets.legacy.client.WebSocketClientProtocol object at 0x175ec6fc0>
File "/Users/magnacarta/p/sunray/.venv/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1165, in read_frame
frame = await Frame.read(
│ └ <classmethod(<function Frame.read at 0x13c9cefc0>)>
└ <class 'websockets.legacy.framing.Frame'>
File "/Users/magnacarta/p/sunray/.venv/lib/python3.12/site-packages/websockets/legacy/framing.py", line 68, in read
data = await reader(2)
└ <bound method StreamReader.readexactly of <StreamReader eof limit=32768 transport=<asyncio.sslproto._SSLProtocolTransport obj...

File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/streams.py", line 750, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
│ │ │ └ 2
│ │ └ b''
│ └ <class 'asyncio.exceptions.IncompleteReadError'>
└ <module 'asyncio.exceptions' from '/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/pyth...

asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

@sourav-bz
Copy link

getting the same issue as well, i think the connection is timing out after inactivity and not connecting back after that.

@Shoshin23
Copy link

I'm getting a similar issue, but with ElevenLabs TTS. Here's the link to my issue: #563

This seems to be happening fairly commonly. I'm not sure if this is to do with my code or if it's to do with Pipecat. My code itself is fairly straightforward. It uses based on one of the foundational examples so i'm not sure.

Thanks!

@markbackman
Copy link
Contributor

Hi, I'm interested in understanding this issue. Do you have repro steps that you can share?

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

4 participants