Error while starting to use Jitsi with JWT cert

I have installed jitsi in many ways that we can find in google with JWT token, but every time i get same error in prosody:

Dec 05 16:49:36 mod_bosh	error	Traceback[bosh]: /usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:194: attempt to call field 'decode' (a nil value)
stack traceback:
	/usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:194: in function 'verify_token'
	/usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:291: in function 'process_and_verify_token'
	/usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua:80: in function 'anonymous'
	/usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua:131: in function </usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua:126>
	(...tail calls...)
	/usr/lib/prosody/modules/mod_saslauth.lua:80: in function </usr/lib/prosody/modules/mod_saslauth.lua:69>
	(...tail calls...)
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/core/stanza_router.lua:142: in function 'dispatch_stanza'
	/usr/lib/prosody/modules/mod_bosh.lua:323: in function 'func'
	/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>
stack traceback:
	/usr/lib/prosody/util/async.lua:211: in function 'run'
	/usr/lib/prosody/modules/mod_bosh.lua:465: in function 'cb_handlestanza'
	/usr/lib/prosody/util/xmppstream.lua:182: in function </usr/lib/prosody/util/xmppstream.lua:162>
	[C]: in function 'parse'
	/usr/lib/prosody/util/xmppstream.lua:285: in function 'feed'
	/usr/lib/prosody/modules/mod_bosh.lua:134: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/net/http/server.lua:229: in function </usr/lib/prosody/net/http/server.lua:176>
	[C]: in function 'xpcall'
	/usr/lib/prosody/net/http/server.lua:108: in function 'process_next'
	/usr/lib/prosody/net/http/server.lua:124: in function 'success_cb'
	/usr/lib/prosody/net/http/parser.lua:177: in function 'feed'
	/usr/lib/prosody/net/http/server.lua:155: in function </usr/lib/prosody/net/http/server.lua:154>
	(...tail calls...)
	/usr/lib/prosody/net/server_select.lua:924: in function </usr/lib/prosody/net/server_select.lua:908>
	[C]: in function 'xpcall'
	/usr/bin/prosody:76: in function 'loop'
	/usr/bin/prosody:86: in main chunk
	[C]: in ?

Can you help me?

Probably there is a version issue. What is your distro, prosody and lua version?

Ubuntu 18.04 LTS “Bionic Beaver”
Prosody 0.11.10

I also tried on Ubuntu 20.04 and Debian 10

My recommendation is to install jitsi using this installer and then

apt-get install jitsi-meet-tokens

systemctl restart prosody.service
systemctl restart jicofo.service
systemctl restart jitsi-videobridge2.service

I noticed same error after installing it as You said:

Dec 05 20:13:46 portmanager	error	Error binding encrypted port for https: No certificate present in SSL/TLS configuration for https port 5281
Dec 05 20:13:46 portmanager	error	Error binding encrypted port for https: No certificate present in SSL/TLS configuration for https port 5281
Dec 05 20:18:14 mod_bosh	error	Traceback[bosh]: /usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:194: attempt to call field 'decode' (a nil value)
stack traceback:
	/usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:194: in function 'verify_token'
	/usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:291: in function 'process_and_verify_token'
	/usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua:80: in function 'anonymous'
	/usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua:131: in function </usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua:126>
	(...tail calls...)
	/usr/lib/prosody/modules/mod_saslauth.lua:77: in function </usr/lib/prosody/modules/mod_saslauth.lua:66>
	(...tail calls...)
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/core/stanza_router.lua:142: in function 'dispatch_stanza'
	/usr/lib/prosody/modules/mod_bosh.lua:305: in function 'func'
	/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>
stack traceback:
	/usr/lib/prosody/util/async.lua:211: in function 'run'
	/usr/lib/prosody/modules/mod_bosh.lua:447: in function 'cb_handlestanza'
	/usr/lib/prosody/util/xmppstream.lua:182: in function </usr/lib/prosody/util/xmppstream.lua:162>
	[C]: in function 'parse'
	/usr/lib/prosody/util/xmppstream.lua:282: in function 'feed'
	/usr/lib/prosody/modules/mod_bosh.lua:133: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/net/http/server.lua:228: in function </usr/lib/prosody/net/http/server.lua:176>
	[C]: in function 'xpcall'
	/usr/lib/prosody/net/http/server.lua:108: in function 'process_next'
	/usr/lib/prosody/net/http/server.lua:124: in function 'success_cb'
	/usr/lib/prosody/net/http/parser.lua:177: in function 'feed'
	/usr/lib/prosody/net/http/server.lua:155: in function </usr/lib/prosody/net/http/server.lua:154>
	[C]: in function 'pcall'
	/usr/lib/prosody/net/server_epoll.lua:159: in function 'on'
	/usr/lib/prosody/net/server_epoll.lua:348: in function 'onreadable'
	/usr/lib/prosody/net/server_epoll.lua:734: in function </usr/lib/prosody/net/server_epoll.lua:726>
	[C]: in function 'xpcall'
	/usr/bin/prosody:80: in function 'loop'
	/usr/bin/prosody:90: in main chunk
	[C]: in ?

Does it work before installing jitsi-meet-tokens?

What is the output for

dpkg -l "*lua*" | egrep '^ii'
luarocks list

Yes, Jitsi was working great before installing jitsi-meet-tokens

ii  liblua5.2-0:amd64     5.2.4-1.1build3            amd64        Shared library for the Lua interpreter version 5.2
ii  liblua5.2-dev:amd64   5.2.4-1.1build3            amd64        Development files for the Lua language version 5.2
ii  liblua5.3-0:amd64     5.3.3-1.1ubuntu2           amd64        Shared library for the Lua interpreter version 5.3
ii  libluajit-5.1-2:amd64 2.1.0~beta3+dfsg-5.1build1 amd64        Just in time compiler for Lua - library version
ii  libluajit-5.1-common  2.1.0~beta3+dfsg-5.1build1 all          Just in time compiler for Lua - common files
ii  libnginx-mod-http-lua 1.18.0-0ubuntu1.2          amd64        Lua module for Nginx
ii  lua-any               25                         all          helper script for shebang lines in Lua scripts
ii  lua-bitop:amd64       1.0.2-5                    amd64        fast bit manipulation library for the Lua language
ii  lua-event:amd64       0.4.6-1build1              amd64        asynchronous event notification library for Lua
ii  lua-expat:amd64       1.3.0-4                    amd64        libexpat bindings for the Lua language
ii  lua-filesystem:amd64  1.7.0-2-1                  amd64        luafilesystem library for the Lua language
ii  lua-sec:amd64         0.9-3                      amd64        SSL socket library for the Lua language
ii  lua-socket:amd64      3.0~rc1+git+ac3201d-4      amd64        TCP/UDP socket library for the Lua language
ii  lua5.2                5.2.4-1.1build3            amd64        Simple, extensible, embeddable programming language
ii  luarocks              2.4.2+dfsg-1               all          deployment and management system for Lua modules

Installed rocks:
----------------

basexx
   0.4.1-1 (installed) - /usr/local/lib/luarocks/rocks

lua-cjson
   2.1.0-1 (installed) - /usr/local/lib/luarocks/rocks

luajwtjitsi
   3.0-0 (installed) - /usr/local/lib/luarocks/rocks

luaossl
   20200709-0 (installed) - /usr/local/lib/luarocks/rocks

I can reproduce the same issue in my newly installed server too. I think this is a new bug

Okay, i will be very thankful if you provide with me any solution that you’ll find.

It seems that there is a new release for luajwtjitsi and it breaks the system

luarocks remove luajwtjitsi
luarocks install luajwtjitsi 2.0-0
systemctl restart prosody.service
8 Likes

Awesome, it works great. Thanks a lot :sunglasses: :clap:

1 Like

the same thing was happening and it was never happened with me before, thanks with this guide I have resolved this

2 Likes

@emrah Many thanks for this info, which helped us. Do you know what components need to be updated so that the latest luajwtjitsi (3.0-0) doesn’t break things?

IIRC util.lib.lua which is in /usr/share/jitsi-meet/prosody-plugins/token

Many thanks for the helpful response on this @emrah - we’ll take a look at upgrading that.

I think I misunderstood you.

You don’t need to upgrade util.lib.lua or any other component. The current stable Jitsi works with luajwtjitsi-2.0-0 and this issue has already been fixed