Comparison

util/prosodyctl/check.lua @ 13830:145b71d1283c 13.0

prosodyctl check config: List modules which Prosody cannot successfully load
author Matthew Wild <mwild1@gmail.com>
date Wed, 09 Apr 2025 10:54:01 +0100
parent 13811:83478fc0806b
child 13841:d01cfbb7fc4f
comparison
equal deleted inserted replaced
13829:dde0ce03049b 13830:145b71d1283c
640 end 640 end
641 if all_modules:contains("posix") then 641 if all_modules:contains("posix") then
642 print(""); 642 print("");
643 print(" mod_posix is loaded in your configuration file, but it has"); 643 print(" mod_posix is loaded in your configuration file, but it has");
644 print(" been deprecated. You can safely remove it."); 644 print(" been deprecated. You can safely remove it.");
645 end
646
647 local load_failures = {};
648 for mod_name in all_modules do
649 local mod, err = modulemanager.loader:load_resource(mod_name, nil);
650 if not mod then
651 load_failures[mod_name] = err;
652 end
653 end
654
655 if next(load_failures) ~= nil then
656 print("");
657 print(" The following modules failed to load:");
658 print("");
659 for mod_name, err in it.sorted_pairs(load_failures) do
660 print((" mod_%s: %s"):format(mod_name, err));
661 end
662 print("")
663 print(" Check for typos and remove any obsolete/incompatible modules from your config.");
645 end 664 end
646 665
647 for host, host_config in pairs(config) do --luacheck: ignore 213/host 666 for host, host_config in pairs(config) do --luacheck: ignore 213/host
648 if type(rawget(host_config, "storage")) == "string" and rawget(host_config, "default_storage") then 667 if type(rawget(host_config, "storage")) == "string" and rawget(host_config, "default_storage") then
649 print(""); 668 print("");