Prosody: problems with PubSub

What type of hardware are you using: VPS bought online
What YunoHost version are you running: YunoHost 12.0.17 (stable)
What app is this about: Prosody

Describe your issue

Dear All,

I’m running Prosody 0.12.3 on YunoHost and I’m having trouble enabling the PubSub component on a subdomain (pubsub.sabatino.cloud).

:hammer_and_wrench: What I’ve configured:
In my /etc/prosody/conf.avail/sabatino.cloud.cfg.lua file, I added:

Component "pubsub.sabatino.cloud" "pubsub"
    name = "PubSub"
    restrict_node_creation = true
    allow_unaffiliated_publish = true
    default_node_config = {
        access_model = "open";
        publish_model = "open";
        persist_items = true;
        max_items = 1000;
    }

This file is symlinked correctly in /etc/prosody/conf.d/ and the domain is resolvable. I’ve restarted Prosody multiple times.

:cross_mark: The problem:
When I try to interact with the component via prosodyctl:

sudo prosodyctl mod_pubsub create-node pubsub.sabatino.cloud test mario@sabatino.cloud
Error loading module 'pubsub' on '*': /usr/lib/prosody/util/pubsub.lua:181: attempt to call a boolean value (for iterator 'for iterator')

inside prosodyctl shell, this returns nil:

hosts["pubsub.sabatino.cloud"]

:magnifying_glass_tilted_left: What I’ve checked:
The component line is present in the correct config file.

The file is symlinked into /etc/prosody/conf.d/.

The PubSub module seems to exist: /usr/lib/prosody/modules/mod_pubsub.lua is present.

DNS resolves correctly.

sudo prosodyctl check returns OK (except for localhost warnings).

Ports 5222 and 5269 are open and tested via openssl and nc.

:puzzle_piece: Suspicions:
The Lua error (attempt to call a boolean value) suggests something may be wrong inside util.pubsub.new, maybe a broken or misconfigured module.

YunoHost might ship a modified Prosody or install it differently.

The component isn’t properly loaded at all (missing from hosts[…] and prosody.components).

:light_bulb: Question:
How can I resolve this error and get the PubSub component properly loaded? Is this related to the version or an incompatibility with YunoHost?

Any help or advice is greatly appreciated!

Thanks in advance.
– Mario

Share relevant logs or error messages

When I try to interact with the component via prosodyctl:

sudo prosodyctl mod_pubsub create-node pubsub.sabatino.cloud test mario@sabatino.cloud
Error loading module 'pubsub' on '*': /usr/lib/prosody/util/pubsub.lua:181: attempt to call a boolean value (for iterator 'for iterator')

inside prosodyctl shell, this returns nil:

hosts["pubsub.sabatino.cloud"]

I can reproduce, but I don’t know what to do about that error. Maybe it’s “normal”.
What makes you think that mod_pubsub can be managed with prosodyctl command? I could not find any example of such usage.

There is something that probably I’m missing but in prosodyctl shell:

prosody> help pubsub
| Help: pubsub
| Manage publish/subscribe nodes
| ------------------------------
| 
| pubsub:create_node(service_jid, node_name) - Create a new node
| pubsub:delete_all_items(service_jid, node_name, notify_subscribers) - Delete all items from a node
| pubsub:delete_item(service_jid, node_name, item_name) - Delete a single item from a node
| pubsub:delete_node(service_jid, node_name) - Delete a node entirely
| pubsub:get_item(service_jid, node_name, item_name) - Show item content on a pubsub node
| pubsub:get_node_config(service_jid, node_name, option_name) - Get the current configuration for a node
| pubsub:list_items(service_jid, node_name) - List items on a pubsub node
| pubsub:list_nodes(service_jid) - List nodes on a pubsub service
| pubsub:set_node_config_option(service_jid, node_name, option_name, option_value) - Set a config option on a pubsub node
| 

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.