#1723 mod_pubsub_feeds: called util.jid.split with wrong argument?

Reporter Philippe
Owner MattJ
Stars ★ (1)
  • Milestone-0.12
  • Type-Defect
  • Priority-Medium
  • Status-Fixed
  1. Philippe on

    What steps will reproduce the problem? 1. enable pubsub_feed maybe like this: --%snip%-- Component "pubsub.example.com" "pubsub" autocreate_on_subscribe = true autocreate_on_publish = true expose_publisher = true modules_enabled = { "pubsub_feeds"; } feeds = { prosody_blog = "http://blog.prosody.im/feed/atom.xml"; crt_sh = "https://crt.sh/atom?q=%25.example.com"; } --%snip%-- 2. start prosody 3. get error message What is the expected output? none. What do you see instead? --%snip%-- http error Traceback[http]: /usr/lib64/prosody/util/jid.lua:36: bad argument #1 to 'match' (string expected, got boolean) stack traceback: [C]: in function 'string.match' /usr/lib64/prosody/util/jid.lua:36: in function 'util.jid.split' /usr/lib64/prosody/util/jid.lua:45: in function 'util.jid.bare' /usr/lib64/prosody/modules/mod_pubsub/mod_pubsub.lua:88: in function </usr/lib64/prosody/modules/mod_pubsub/mod_pubsub.lua:68> (...tail calls...) /usr/lib64/prosody/util/pubsub.lua:588: in method 'publish' /usr/lib64/prosody/modules_contrib-enabled/mod_pubsub_feeds/mod_pubsub_feeds.lua:126: in upvalue 'callback' /usr/lib64/prosody/modules_contrib-enabled/mod_pubsub_feeds/mod_pubsub_feeds.lua:158: in function </usr/lib64/prosody/modules_contrib-enabled/mod_pubsub_feeds/mod_pubsub_feeds.lua:155> [C]: in function 'util.xpcall.xpcall' /usr/lib64/prosody/net/http.lua:134: in field 'callback' /usr/lib64/prosody/net/http.lua:106: in upvalue 'success_cb' /usr/lib64/prosody/net/http/parser.lua:167: in method 'feed' /usr/lib64/prosody/net/http.lua:116: in method 'reader' /usr/lib64/prosody/net/http.lua:187: in function </usr/lib64/prosody/net/http.lua:178> [C]: in function 'util.xpcall.xpcall' /usr/lib64/prosody/net/server_epoll.lua:240: in function </usr/lib64/prosody/net/server_epoll.lua:226> (...tail calls...) /usr/lib64/prosody/net/server_epoll.lua:456: in method 'onreadable' /usr/lib64/prosody/net/server_epoll.lua:1044: in function 'net.server.loop' [C]: in function 'util.xpcall.xpcall' /usr/bin/prosody:78: in local 'loop' /usr/bin/prosody:83: in main chunk [C]: in ? --%snip%-- What version of the product are you using? On what operating system? prosody 0.12.0 on oracle linux 8.5 with lua 5.3.4. Please provide any additional information below. Tracking down the argument in question (split(jid)) leads to mod_pubsub_feeds/mod_pubsub_feeds.lua where the 'actor' is passed as a boolean (true): pubsub.service:publish(node, true, id, xitem)

  2. MattJ on

    Hi, thanks for the report! This is triggered by setting expose_publisher to true, which is not the default, explaining why this error hasn't been reported before. Boolean 'true' is a valid value for the actor (it means the operation was performed by the server itself, and not an XMPP entity). However it is obviously not a valid value for the 'publisher' attribute. I've pushed a fix to the 0.12 branch at https://hg.prosody.im/trunk/rev/018ac691ee22 - it will be included in 0.12.1 when that is released, and 0.12 nightly builds when they appear.

    • owner MattJ
    • tags Milestone-0.12 Status-Fixed

New comment

Not published. Used for spam prevention and optional update notifications.