I’d been using jitsi meet successfully for a couple of years. Recently, I started having a problem where it would fail to start at boot. The logged messages would be wildly inconsistent from boot to boot (and, very occasionally, the program would start and run properly until the next restart). I tried the dev’s suggestions, I wiped all the jitsi software and re-installed, but the symptoms remained consistently inconsistent (and the program remained unusable). Finally, I provisioned a brand-new server box with a clean install of Devuan Ascii and installed jitsi meet using apt and the quick install instructions. It worked fine until an update about a month ago, and I was back to not being able to get the program to launch no matter what I did. The log messages were at least consistent this time, if completely unhelpful (stack traces).
After many, many hours of fiddling I discovered that there appears to be some sort of race condition between components (prosody, jicofo, and jitsi-videobridge). I now have an
init.d script which will consistently work, but it’s ugly:
/etc/init.d/prosody start /etc/init.d/jicofo start /etc/init.d/jitsi-videobridge start sleep 25 /etc/init.d/prosody restart sleep 5 /etc/init.d/jicofo restart sleep 5 /etc/init.d/jitsi-videobridge restart
Ugh. Obviously, there’s a lot of empiricism here and the sleep timing (1) has not been rigorously optimized and (2) might be different on different systems. All I know is it has worked here for 20 consecutive restarts, and having totally blown my time budget for several projects I simply have to put it into production without fiddling more. I wanted to get this posted so, until there’s some explanation or solutions, others having the same issues will at least have access to a workaround.
Here’s what I know for sure:
- You have to start at least one of the components (I have only tested all three) and then restart again to get things to work.
- There must be some delay (5 seconds wasn’t enough, 25 is probably overkill given how consistently it’s working now) between the first series of starts and the restarts.
- There must be some delay between re-starting prosody, re-starting jicofo, and re-starting jitsi-videobridge or it will fail. Two seconds was not sufficient, but five was. I don’t know whether both delays are needed.
I don’t know if this is a race condition that is somehow covered up by systemd (Devuan is a Debian fork without systemd) or whether this would happen on distros that use systemd; I don’t have time to test right now. But I assume this isn’t breaking on all distros or there would be some noise about it here.
I hope this is helpful to others, and I’d appreciate any thoughts on a cleaner workaround than this one.