Private Interface API return 503

I am following this guide to enable the API

I add modified the java parameter:

extra options to pass to the JVB daemon

JVB_OPTS="–apis=rest,xmpp"

then test the api from jitsi server using curl:

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

  • Trying ::1:8080…
  • TCP_NODELAY set
  • Connected to localhost (::1) port 8080 (#0)

GET /colibri/stats HTTP/1.1
Host: localhost:8080
User-Agent: curl/7.65.2
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 503 Service Unavailable
    < Date: Thu, 26 Dec 2019 08:38:00 GMT
    < Content-Type: application/json;charset=utf-8
    < Access-Control-Allow-Origin: *
    < Content-Length: 0
    < Server: Jetty(9.4.15.v20190215)
    <
  • Connection #0 to host localhost left intact

it return 503 error.

I see some errors in the jvb log.
JVB 2019-12-26 08:25:10.641 INFO: [10] org.eclipse.jetty.server.AbstractConnector.doStart() Started MuxServerConnector@4d7acfe4{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
JVB 2019-12-26 08:25:10.641 INFO: [10] org.eclipse.jetty.server.Server.doStart() Started @516ms
JVB 2019-12-26 08:25:10.645 INFO: [10] org.jitsi.rest.AbstractJettyBundleActivator.start().613 Not starting the Jetty service for org.jitsi.videobridge.rest.PublicRESTBundleActivator(port=-1)
JVB 2019-12-26 08:25:10.645 INFO: [10] org.jitsi.rest.AbstractJettyBundleActivator.start().613 Not starting the Jetty service for org.jitsi.videobridge.rest.PublicClearPortRedirectBundleActivator(port=8080)

is there any other steps need to do ?

Make sure stats are enabled.

Thanks. it works now.

I am learning the Colibri API now. I want to translate the colibri to SDP. is there any code in jitsi web I can learn ?

@damencho how do you make sure stats are enabled? I am looking at the same behavior here:

JVB_OPTS="--apis=rest,xmpp"

curl -v http://localhost:8080/colibri/stats resulting in 503

I managed to get this up:

in /etc/jitsi/videobridge/config

JVB_OPTS="--apis=rest,xmpp"

and

JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/videobridge/logging.properties -Dorg.jitsi.videobridge.ENABLE_STATISTICS=true

curl now does work, but looks like there are no statistics:

root@meet:~# curl -v http://localhost:8080/colibri/stats
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /colibri/stats HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 17 Mar 2020 18:50:08 GMT
< Content-Type: application/json;charset=utf-8
< Access-Control-Allow-Origin: *
< Content-Length: 389
< Server: Jetty(9.4.15.v20190215)
<
* Connection #0 to host localhost left intact
{"largest_conference":0,"conference_sizes":"[]","used_memory":0,"threads":0,"videochannels":0,"loss_rate_upload":0.0,"bit_rate_download":0,"videostreams":0,"jitter_aggregate":0.0,"loss_rate_download":0.0,"rtp_loss":0.0,"total_memory":0,"bit_rate_upload":0,"current_timestamp":"2020-03-17 18:42:12.754","rtt_aggregate":0.0,"cpu_usage":0.0,"audiochannels":0,"conferences":0,"participants":0}

jvb.log contains now a lot of entries like:

JVB 2020-03-17 19:50:55.587 SEVERE: [26] org.jitsi.utils.concurrent.RecurringRunnableExecutor.log() The invocation of the method org.jitsi.videobridge.stats.StatsManager$StatisticsPeriodicRunnable.run() threw an exception.
java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getTotalPhysicalMemorySize() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @1def64d6
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
	at org.jitsi.videobridge.stats.OsStatistics.getTotalMemory(OsStatistics.java:138)
	at org.jitsi.videobridge.stats.VideobridgeStatistics.generate0(VideobridgeStatistics.java:703)
	at org.jitsi.videobridge.stats.VideobridgeStatistics.generate(VideobridgeStatistics.java:450)
	at org.jitsi.videobridge.stats.StatsManager$StatisticsPeriodicRunnable.doRun(StatsManager.java:321)
	at org.jitsi.utils.concurrent.PeriodicRunnableWithObject.run(PeriodicRunnableWithObject.java:87)
	at org.jitsi.utils.concurrent.RecurringRunnableExecutor.run(RecurringRunnableExecutor.java:216)
	at org.jitsi.utils.concurrent.RecurringRunnableExecutor.runInThread(RecurringRunnableExecutor.java:292)
	at org.jitsi.utils.concurrent.RecurringRunnableExecutor.access$000(RecurringRunnableExecutor.java:36)
	at org.jitsi.utils.concurrent.RecurringRunnableExecutor$1.run(RecurringRunnableExecutor.java:328)

server is running using openjdk 11:

root@meet:~# apt list --installed|grep jdk

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

openjdk-11-jre-headless/bionic-updates,bionic-security,now 11.0.6+10-1ubuntu1~18.04.1 amd64 [installed,automatic]```

downgrading to jdk 8 “fixes” this.