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

listforwarders request generates a "Failed to stringify message" error #2846

Closed
amoizard opened this issue Dec 30, 2021 · 4 comments
Closed

Comments

@amoizard
Copy link
Contributor

Hi,

Janus version: "multistream branch" (commit 237282e)

short: "listforwarders" generate a "Failed to stringify message" error in the logs

To reproduce:
1/ I use HTTP API
2/ I create a room
3/ I wait for a publisher to come
4/ I send "rtp_forward" (success reported and forward working)
5/ I send a "listforwarders".

This last request generate

 [ERR] [transports/janus_http.c:janus_http_send_message:1107] Failed to stringify message...

And no HTTP answer is returned by janus.

When "rtp_forward" is not configured yet, the "listforwarders" correctly reports an empty list:

"plugindata":{
  "plugin":"janus.plugin.videoroom",
  "data":{
   "videoroom":"forwarders",
   "room":"room1",
   "publishers":[
     {"publisher_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","display":"yyyyyyyyyyyyyyyyyyyyyyyyyy"}
   ]
  }
}

The issue looks related to janus_videoroom_rtp_forwarder_summary method. When line 6154 below is commented, the json is returned (without required information)

// LINE 6154 //json_object_set_new(pl, "forwarders", flist);

I have not been able to locate the issue more precisely.

@lminiero
Copy link
Member

lminiero commented Jan 3, 2022

If commenting out that line fixes it, then it means something is broken in how the flist object itself is created, so you can try commenting other parts of the code instead, that is those that actually add stuff to that object . I don't have time right now to test, but I'll try to do that in the next few days.

@amoizard
Copy link
Contributor Author

amoizard commented Jan 3, 2022

Thanks for answering.

I already tried to modify only "janus_videoroom_rtp_forwarder_summary" method to minimize the object returned.
I have added "return json;" after line 2634

json_object_set_new(json, "stream_id", json_integer(f->stream_id));
//ADDED
return json;
//ADDED

But the error was still the same!
I probably missed something obvious...

@lminiero
Copy link
Member

lminiero commented Jan 3, 2022

The above commit fixes it for me.

@lminiero lminiero closed this as completed Jan 3, 2022
@amoizard
Copy link
Contributor Author

Thanks a lot! I confirmed it also worked for me.

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

2 participants