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

[1.3.1] Server stops responding after pushEvent() is called with built-in lua plugin (echotest/videoroom) #3505

Open
melbek opened this issue Jan 16, 2025 · 7 comments
Labels
multistream Related to Janus 1.x

Comments

@melbek
Copy link

melbek commented Jan 16, 2025

What version of Janus is this happening on?
1.3.1

Have you tested a more recent version of Janus too?
Only master

Was this working before?
First try

Is there a gdb or libasan trace of the issue?
No segfault or anything else, just freeze and stops working.

Additional context
Made a clean install on a ubuntu server and the default plugins with the demo website are working.
But if I try to use the lua echotest or videoroom plugins, the logs stop at "pushEvent". I see all relevant logs before pushEvent, the json given to pushEvent is also correct, but nothing after that coroutine is called anymore.

Although I have some experience with IT Administration, this is my first time trying Janus, sorry for stupid questions.

I don't know where to go from here and where to look for logs. I would appreciate ANY help in any direction.
Thank you very much.

@melbek melbek added the multistream Related to Janus 1.x label Jan 16, 2025
@lminiero
Copy link
Member

lminiero commented Jan 17, 2025

I just tried the EchoTest demo using the Lua plugin

[..]/demos/echotest.html?plugin=lua

and it works as expected for me.

@lminiero
Copy link
Member

What version of Lua are you using? FYI the one on my Fedora is 5.4.6.

@melbek
Copy link
Author

melbek commented Jan 17, 2025

I'm using lua version 5.3.
Interestingly, the echo test via /demos/echotest.html?plugin=lua works for me too, it goes even beyond "pushEvent()".
But videoroom.lua is still freezing after a call to "pushEvent()".

@melbek
Copy link
Author

melbek commented Jan 23, 2025

Alright so I updated lua to 5.4.6 and it's still not working. The code runs until the end if I remove "pushEvent()" calls, so the problem is really the pushEvent.
Does anyone has a hint in which direction I can check for? The json I pass to pushEvent is also valid, so that should not be a problem.

@melbek
Copy link
Author

melbek commented Jan 23, 2025

Or could maybe please anyone confirm that the videroom lua plugin is working with them? Would be greatly appreciated!

@melbek
Copy link
Author

melbek commented Jan 23, 2025

Maybe some mor info:
Could it maybe be a problem with the missing jsep?
If I convert this line in echotest.lua from
pushEvent(id, tr, jsonevent, jsonjsep)
to
pushEvent(id, tr, jsonevent, nil)
I get the same result, freezing the service and the restart takes like a minute or so.

Line 521 in janus_lua.c says:
/* If there's an SDP attached, create a thread to send the event asynchronously: * sending it here would keep the locked Lua state busy much longer than intended */

Maybe because of the synchronously sent event?

@lminiero
Copy link
Member

Using the VideoRoom demo page with the Lua plugin, I don't get any freezes, but I'm getting a crash when a second user joins a room:

PANIC: unprotected error in call to Lua API (/home/lminiero/Work/code/test/github/share/janus/lua/videoroom.lua:916: attempt to call a table value (global 'colors'))
Aborted (core dumped)

This is probably because of an incorrect usage of term-colors here:
https://github.com/meetecho/janus-gateway/blob/master/src/plugins/lua/videoroom.lua#L916

Fixing that (I'll push a fix shortly) I get this:

videoroom.lua  /home/lminiero/Work/code/test/github/share/janus/lua/videoroom.lua:403: attempt to concatenate a nil value (local 'feedId')

which makes sense, because I was using the 1.x VideoRoom demo, which uses the new API even for the "old style" demo. Using the 0.x VideoRoom demo with the 1.x Lua plugin and videoroom.lua, everything works fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multistream Related to Janus 1.x
Projects
None yet
Development

No branches or pull requests

2 participants