#1978 prosodyctl check crashes if there are no modules
Reporter
tracteur
Owner
Zash
Created
Updated
Stars
★ (1)
Tags
Priority-Medium
Status-Fixed
Milestone-13.0
Type-Defect
tracteur
on
What steps will reproduce the problem?
1. Installed jitsi-meet on Debian 12 Bookworm, which installed prosody 13.0.2-1~bookworm1
2. Do a prosodyctl check
What is the expected output?
Anything but a crash, or at least a mention that there is an issue with the modules
What do you see instead?
# prosodyctl check
Checking config...
No global modules_enabled is set?
Consider moving these modules into modules_enabled in the global section:
{"smacks"}
lua: /usr/bin/prosodyctl:629: /usr/share/lua/5.2/prosody/util/prosodyctl/check.lua:544: attempt to index local 'modules' (a nil value)
stack traceback:
/usr/share/lua/5.2/prosody/util/prosodyctl/check.lua:544: in function 'config'
/usr/share/lua/5.2/prosody/util/prosodyctl/check.lua:1857: in function '?'
/usr/bin/prosodyctl:745: in function 'func'
/usr/share/lua/5.2/prosody/util/async.lua:149: in function </usr/share/lua/5.2/prosody/util/async.lua:147>
stack traceback:
[C]: in function 'error'
/usr/bin/prosodyctl:629: in function 'handler'
/usr/share/lua/5.2/prosody/util/async.lua:244: in function 'run'
/usr/bin/prosodyctl:748: in main chunk
[C]: in ?
Please provide any additional information below.
As stated in the output, the issue is here: https://hg.prosody.im/trunk/file/tip/util/prosodyctl/check.lua#l544 The issue is that the "if" tried to access a function of an object before checking if the object exists first.
There is a workaround, which requires to change:
if component_module and modules:contains(component_module) then
to:
if modules and component_module and modules:contains(component_module) then
I didn't propose a pull request because I'm not familiar with the codebase nor Lua and there might be some other issues I'm overlooking.
What steps will reproduce the problem? 1. Installed jitsi-meet on Debian 12 Bookworm, which installed prosody 13.0.2-1~bookworm1 2. Do a prosodyctl check What is the expected output? Anything but a crash, or at least a mention that there is an issue with the modules What do you see instead? # prosodyctl check Checking config... No global modules_enabled is set? Consider moving these modules into modules_enabled in the global section: {"smacks"} lua: /usr/bin/prosodyctl:629: /usr/share/lua/5.2/prosody/util/prosodyctl/check.lua:544: attempt to index local 'modules' (a nil value) stack traceback: /usr/share/lua/5.2/prosody/util/prosodyctl/check.lua:544: in function 'config' /usr/share/lua/5.2/prosody/util/prosodyctl/check.lua:1857: in function '?' /usr/bin/prosodyctl:745: in function 'func' /usr/share/lua/5.2/prosody/util/async.lua:149: in function </usr/share/lua/5.2/prosody/util/async.lua:147> stack traceback: [C]: in function 'error' /usr/bin/prosodyctl:629: in function 'handler' /usr/share/lua/5.2/prosody/util/async.lua:244: in function 'run' /usr/bin/prosodyctl:748: in main chunk [C]: in ? Please provide any additional information below. As stated in the output, the issue is here: https://hg.prosody.im/trunk/file/tip/util/prosodyctl/check.lua#l544 The issue is that the "if" tried to access a function of an object before checking if the object exists first. There is a workaround, which requires to change: if component_module and modules:contains(component_module) then to: if modules and component_module and modules:contains(component_module) then I didn't propose a pull request because I'm not familiar with the codebase nor Lua and there might be some other issues I'm overlooking.
Thanks for the report. Fixed in https://hg.prosody.im/trunk/rev/d8a30fdfbddd
Changes