Jitsi videobridge graceful_shutdown

videobridge graceful_shutdown give me an error

Invalid HTTP status for shutdown request: 503

Only certain entities are allowed to make this call on the bridge, and there’s some configuration that needs to happen for you to be able to do it. Did you set org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP to something in the config? cc @damencho

@bbaldino now I have added. then I got error

Invalid HTTP status for shutdown request: 401

I have setup jitsi-videobridge2 in an external instance. videocall is working but I got error
This is the jvb sip-communicator.properties

org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER=true
org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=meet-jit-si-turnrelay.jitsi.net:443
org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc
org.jitsi.videobridge.xmpp.user.shard.HOSTNAME=a.domain.com
org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.a.domain.com
org.jitsi.videobridge.xmpp.user.shard.USERNAME=jvb
org.jitsi.videobridge.xmpp.user.shard.PASSWORD=KH3ufk0D
org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.a.domain.com
org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=e77f5e2f-54cb-48c1-a6b7-582138edb930
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=true
org.jitsi.videobridge.ENABLE_REST_SHUTDOWN=true
org.jitsi.videobridge.ENABLE_REST_COLIBRI=true
org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=jvbbrewery@internal.auth.a.domain.com/.*

config.js

Jitsi Videobridge settings

sets the XMPP domain (default: none)

JVB_HOSTNAME=a.domain.com

sets the hostname of the XMPP server (default: domain if set, localhost otherwise)

JVB_HOST=a.domain.com

sets the port of the XMPP server (default: 5275)

JVB_PORT=5347

sets the shared secret used to authenticate to the XMPP server

JVB_SECRET=KH3ufk0D

extra options to pass to the JVB daemon

JVB_OPTS="–apis=rest,xmpp,"

adds java system props that are passed to jvb (default are for home and logging config file)

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"

jvb.log

2020-04-08 07:09:28.850 INFO: [27] Videobridge.createConference#326: create_conf, id=efd95cd8ab41fe44 gid=null logging=false

2020-04-08 07:09:28.853 INFO: [27] Health.doRun#294: Performed a successful health check in 3ms. Sticky failure: false

2020-04-08 07:09:29.338 SEVERE: [35] ComponentMain.lambda$getConnectCallable$0#293: java.net.ConnectException: Connection refused (Connection refused), host:a.domain.com, port:5347

org.xmpp.component.ComponentException: java.net.ConnectException: Connection refused (Connection refused)

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:296)

at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentManager.java:242)

at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentManager.java:222)

at org.jitsi.meet.ComponentMain.lambda$getConnectCallable$0(ComponentMain.java:285)

at org.jitsi.retry.RetryStrategy$TaskRunner.run(RetryStrategy.java:193)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.net.ConnectException: Connection refused (Connection refused)

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:607)

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:174)

jicofo log

Jicofo 2020-04-08 03:17:51.681 INFO: [102] org.jitsi.protocol.xmpp.AbstractOperationSetJingle.terminateSession().620 Terminate session: 123@conference.a.domain.com/4f51ff5b

Jicofo 2020-04-08 03:17:51.682 INFO: [102] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Removing 123@conference.a.domain.com/4f51ff5b sources Sources{ video: [ssrc=1657394189 ssrc=383759752 ssrc=1562039570 ssrc=2251536954 ssrc=3970686063 ssrc=2882585986 ] audio: [ssrc=81341128 ] }@1190788939
Jicofo 2020-04-08 03:17:51.682 INFO: [102] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Region info, conference=ff92de octo_enabled= false: [[null]]
Jicofo 2020-04-08 03:17:51.683 INFO: [102] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Expiring channels for: 123@conference.a.domain.com/4f51ff5b on: Bridge[jid=jvbbrewery@internal.auth.a.domain.com/e77f5e2f-54cb-48c1-a6b7-582138edb930, relayId=null, region=null, stress=0.00]
Jicofo 2020-04-08 03:17:51.684 INFO: [102] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Removed participant: true, 123@conference.a.domain.com/4f51ff5b
Jicofo 2020-04-08 03:22:19.899 INFO: [27] org.jitsi.jicofo.ChatRoomRoleAndPresence.log() Chat room event ChatRoomMemberPresenceChangeEvent[type=MemberLeft sourceRoom=org.jitsi.impl.protocol.xmpp.ChatRoomImpl@51cf5493 member=ChatMember[123@conference.a.domain.com/4f51ff5b, jid: 4f51ff5b-19b0-481b-8cac-a86b32ba679e@a.domain.com/5b1a90c3-9e25-417d-826d-bb5a72035340]@1816542022]
Jicofo 2020-04-08 03:22:19.899 INFO: [27] org.jitsi.jicofo.ChatRoomRoleAndPresence.log() Owner has left the room !
Jicofo 2020-04-08 03:22:19.899 INFO: [27] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Member 123@conference.a.domain.com/4f51ff5b is leaving
Jicofo 2020-04-08 03:22:19.899 WARNING: [27] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Participant not found for 123@conference.autoj.meetrix.io/4f51ff5b terminated already or never started ?
Jicofo 2020-04-08 03:22:19.900 INFO: [27] org.jitsi.jicofo.FocusManager.log() Disposed conference for room: 123@conference.a.domain.com conference count: 0

prosody log

Apr 08 07:30:32 conference.a.domain.com:muc_domain_mapper warn Session filters applied
Apr 08 07:30:32 c2s562f71c8b420 info Client connected
Apr 08 07:30:32 c2s562f71c8b420 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384)
Apr 08 07:30:32 c2s562f71c8b420 info Authenticated as jvb@auth.a.domain.com

This error is occurred when i enabled xmpp,rest apis

I’m having a hard time parsing these logs. Can you just attach the jvb log file?

here is the jvb log jvb.txt (5.2 KB)
prosody prosody.txt (10.2 KB)
jicofo log jicofo.txt (1.8 KB)

Videobridge.handleShutdownIQ#752: Rejected shutdown request from: 127.0.0.1

@bbaldino any suggestion

@bbaldino


This line match with from address (127.0.0.1).

I got error Videobridge.handleShutdownIQ#752: Rejected shutdown request from: 127.0.0.1

org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP =jvbbrewery@internal.auth.autoj.meetrix.io/.*

@damencho is that pattern correct? I don’t remember what from ends up looking like here.

@bbaldino
I run jvb in external server i run graceful_shutdown script inside jvb server.

I have exactly the same problem.
I have tried everything. When I curl to / colibri / stats it returns a 200 correctly, however with:

curl -s -H “Content-Type: application / json” -d ‘{“graceful-shutdown”: “true”}’ -w “% {http_code}” “http: // localhost: 8080 / colibri / shutdown” I get:

Error 503 Service Unavailable

HTTP ERROR 503

Problem accessing / colibri / shutdown. Reason:

 Service Unavailable 

Powered by Jetty: // 9.4.15.v20190215

Can anyone know why?

If you run the command from the server itself, try
org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=127\.0\.0\.1

1 Like

You probably need
org.jitsi.videobridge.ENABLE_REST_SHUTDOWN=true
In /etc/jitsi/videobridge/sip-communicator.properties

1)Is the following code OK for Graceful Shutdown
curl -s -H “Content-Type: application/json” -d ‘{“graceful-shutdown”: “true”}’ -w “% {http_code}” “http://localhost:8080/colibri/shutdown”
#Code is from above …Just wanted to check it work or not…

2)Once we do “Graceful Shutdown” …How we can turn it on?Bring JVB Instance
curl -s -H “Content-Type: application/json” -d ‘{“graceful-shutdown”: “true”}’ -w “% {http_code}” “http://localhost:8080/colibri/shutdown”

@bbaldino @Supun_Madushanka

change localhost to 127.0.0.1

Can multiple authorized sources be added or can an authorized source be added just for the shutdown command?