webRTC Stream "FAILED: Session does not exist"

derrek800

New Member
we are using webRTC stream, stream start API response success and video inject response also success but stream not started and showing "FAILED: Session does not exist "
some time stream working and some time failed to start.

workflow process :

start stream (response success) > inject video (response success). stream showing "FAILED: Session does not exist "
repeat same flow again and stream works

we are using below API request to start stream and inject video into stream
API : /rest-api/vod/startup
Request :
{ "uri": "vod-live://ps/bg.mp4", "localStreamName": "loalstream", "loop": true }

Response:
{ "StatusCode": 200, "StatusDescription": "OK", "ResponseBody": "" }


API : /rest-api/stream/inject2/startup
Request:
{ "localStreamName": "loalstream", "remoteStreamName": "vod-live://ps/2026-10-06_12-43-01.mp4", "video": true, "audio": false }

Response :
{ "StatusCode": 200, "StatusDescription": "OK", "ResponseBody": "" }


your resolution will helpful me for continues workflow process.
 
Good day.
VOD streaming is an asynchronous operation, so 200 OK response to /rest-api/vod/startup means the request is accepted only. There is a new REST API v3 in WCS 5.3 branch returning 202 Accepted response in this case.
Please update to the latest WCS build 5.3.500 (or 5.2.2317 if you still using WCS 5.2 branch). If the problem still persists, check the files you're trying to play as VOD for supported codecs and format requirements. Please also check the server log /usr/local//FlashphonerWebCallServer/logs/server_logs/flashphoner.log for possible errors when starting the first VOD stream.
 
we are using webRTC stream, stream start API response success and video inject response also success but stream not started and showing "FAILED: Session does not exist "
some time stream working and some time failed to start.

workflow process :

start stream (response success) > inject video (response success). stream showing "FAILED: Session does not exist "
repeat same flow again and stream works

we are using below API request to start stream and inject video into stream
API : /rest-api/vod/startup
Request :
{ "uri": "vod-live://ps/bg.mp4", "localStreamName": "loalstream", "loop": true }

Response:
{ "StatusCode": 200, "StatusDescription": "OK", "ResponseBody": "" }


API : /rest-api/stream/inject2/startup
Request:
{ "localStreamName": "loalstream", "remoteStreamName": "vod-live://ps/2026-10-06_12-43-01.mp4", "video": true, "audio": false }

Response :
{ "StatusCode": 200, "StatusDescription": "OK", "ResponseBody": "" }


your resolution will helpful me for continues workflow process.
I’ve run into this exact intermittent pattern before. Here’s what fixed it for us.

What’s going on

A 200 OK from /vod/startup only means the server accepted the command. It doesn’t mean the session exists yet. The VOD session is created asynchronously, so when you call inject2 immediately afterwards, the localStream session sometimes isn’t registered yet. That gives you “Session does not exist”. When you repeat the flow, the session is already up, so it works. That’s why it’s intermittent: it’s a race condition, not a bad request.

What worked for us

Don’t chain the calls back-to-back. Poll for the stream before injecting. Check the stream list (/rest-api/stream/list or your server’s equivalent) until loalstream shows up, then call inject. A short delay (300 to 500 ms) is a quick patch, but polling is the reliable fix.
Add retry logic on inject. If inject succeeds but the stream still fails, retry the whole sequence 2 or 3 times with a short backoff (for example 500 ms, then 1 s) instead of relying on a manual repeat.
Check your server logs, not just API responses. The real failure reason is usually logged there: the session was torn down, the VOD source couldn’t be opened, or a timeout occurred. The API 200 won’t tell you that.
Verify the source URI. vod-live://ps/bg.mp4 in startup and vod-live://ps/2026-10-06_12-43-01.mp4 in inject are different files. Make sure both are valid, accessible, and fully written. If the inject file is still being recorded or finalized, the session can drop right after starting.
Clean up before restarting. If a previous session with the same localStreamName is still being torn down, the new one can collide with it. Stop or shutdown the old stream and wait for confirmation before starting again, or use a unique stream name per session.
Keep the WebRTC side in sync. Only start the WebRTC player or negotiation after the stream is confirmed active. Connecting the client before the session exists is another common source of this error.

Suggested flow

start vod → poll until stream is listed → inject → verify stream active → start WebRTC player
(retry w/ backoff on any failure)

After switching from fixed calls to polling plus retry, our failures dropped to essentially zero. If it still happens, the server log line at the moment of failure will pinpoint the cause. Feel free to share it and I can help narrow it down.
 
Top