Cannot activate Private Stats for JVB


#1

Hello All,
On the JVB host machine, I am not able to get internal stats from the jvb by doing:

curl -v  http://localhost:8080/colibri/stats
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* Connection refused
* Failed connect to localhost:8080; Connection refused

on the host machine where jvb is running using following docker configuration:

# Video bridge
jvb:
    image: jitsi/jvb
    ports:
        - '${JVB_PORT}:${JVB_PORT}/udp'
    environment:
        - DOCKER_HOST_ADDRESS
        - XMPP_AUTH_DOMAIN
        - XMPP_INTERNAL_MUC_DOMAIN
        - XMPP_SERVER
        - JVB_AUTH_USER
        - JVB_AUTH_PASSWORD
        - JVB_BREWERY_MUC
        - JVB_PORT
        - JVB_OPTS
        - JVB_STUN_SERVERS
        - JICOFO_AUTH_USER
        - TZ
    depends_on:
        - prosody

the .env file contains :

JVB_OPTS="–apis=rest"

When I am looking at docker logs:

docker logs jitsi_jvb_1 2>&1 | grep “8080”

I am getting:

INFO: [10] org.jitsi.rest.AbstractJettyBundleActivator.start().572 Not starting the Jetty service for org.jitsi.videobridge.rest.PublicClearPortRedirectBundleActivator(port=8080)

It looks like the Rest API is not getting activated and started.

I have tried also to edit manually /etc/jitsi/videobridge/config file directly and add JVB_OPTS without success.
Am I missing something to get the REST API on port 8080 activated?

Thank you for your help!!
Fabrice


#2

Hello Fabrice, that’s strange. Could you please post the contents of /etc/jitsi/videobridge/sip-communicator.properties? Do you see a line like this org.jitsi.videobridge.ENABLE_STATISTICS=true?


#3

Hi sure, @gpolitis, I dont see such line indeed, I only have:
org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=focus@auth.localhost/.*
into /etc/jitsi/videobridge/sip-communicator.properties of such jvb image running (pulled from https://hub.docker.com/r/jitsi/jvb)
I added it then into it and did a docker stop & start of jvb image but the

curl -v http://localhost:8080/colibri/stats

is giving same results…
Thank you


#4

I see… Can you check if the --rest option is actually passed to the JVB? You could modify the startup script and make it echo the options.


#5

If I enter into the image and do:

echo $JVB_OPTS
“–apis=rest”

So looks like such JVB_OPTS value is there into the jvb docker image.
Still I could not locate the jvb start up file you mentioned inside the image… Could you please help me in telling me where it is so I can modify it?
Thank you
Fabrice


#6

The script to run the JVB daemon seems to be here https://github.com/jitsi/docker-jitsi-meet/blob/master/jvb/rootfs/etc/services.d/jvb/run and I don’t see a reference to the JVB_OPTS variable.

Now, I’m not very familiar with our Docker scripts, so @saghul please feel free to correct me here, but maybe that is the problem here.

@Fabrice_Richard could you please try to print the DAEMON_OPTS variable?


#7

Hi @gpolitis
Thanks for pointing me to the right direction.
I found then inside jvb docker image a “run” file in /etc/services.d/jvb/, looking at it:

DAEMON=/usr/share/jitsi-videobridge/jvb.sh
DEFAULT_DAEMON_OPTS="none"

DAEMON_OPTS=${JVB_ENABLE_APIS:=$DEFAULT_DAEMON_OPTS}
exec s6-setuidgid jvb /bin/bash -c “JAVA_SYS_PROPS=”$JAVA_SYS_PROPS" exec DAEMON --apis={DAEMON_OPTS}"

So I changed and put:

DEFAULT_DAEMON_OPTS=“rest”

and it worked! I was able to get STATS with curl command.
So it looks like API option are some kind set up by default with None value that makes that such image cannot generate STATS in any way.

Am I correct?

Thank you
Fabrice


#8

I’m glad it worked! In the jitsi-docker README file there’s mention of a JVB_ENABLE_APIS variable and that’s probably the correct way to enable the rest interface (i.e. not supporting JVB_OPTS seems by design).


#9

That’s correct @gpolitis


#10

Thank you @gpolitis, @saghul
I have used then instead the JVB_ENABLE_APIS option as you suggested and passed it to docker image and it is working fine now.
(Had to add port mapping 8080 too)
Thanks a lot for your help!!


#11

Glad it works for you!