#475 mod_bosh.lua:251: bad argument #1 to 'math_min'

Reporter trelauney
Owner Zash
Created
Updated
Stars ★★ (2)
Tags
  • Type-Defect
  • Priority-Medium
  • Status-Fixed
  1. trelauney on

    Prosody 0.9.7 Unknown cause, unable to reproduce. Server is configured To allow both anonymous & non-anonymous logins. Primary access is intended to be candy-chat, cross_domain_bosh is configured for the subdomain candy-chat is hosted on. bosh_max_inactivity is set to 240 in prosody.cfg.lua, bosh_max_wait (as it is part of that line) is not set (and not documented at https://prosody.im/doc/modules/mod_bosh). This error appeared 3 times in the same second. Feb 12 19:55:56 http.server error Traceback[httpserver]: /usr/lib/prosody/modules/mod_bosh.lua:251: bad argument #1 to 'math_min' (number expected, got nil) stack traceback: [C]: in function 'parse' /usr/lib/prosody/util/xmppstream.lua:255: in function 'feed' /usr/lib/prosody/modules/mod_bosh.lua:128: in function '?' /usr/lib/prosody/util/events.lua:67: in function 'fire_event' /usr/lib/prosody/net/http/server.lua:221: in function </usr/lib/prosody/net/http/server.lua:164> (tail call): ? [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:154: in function 'feed' /usr/lib/prosody/net/http/server.lua:150: in function 'onincoming' /usr/lib/prosody/net/server_event.lua:632: in function </usr/lib/prosody/net/server_event.lua:578> [C]: in function 'loop' /usr/lib/prosody/net/server_event.lua:793: in function </usr/lib/prosody/net/server_event.lua:792> [C]: in function 'xpcall' /usr/lib/prosody/../../bin/prosody:376: in function 'loop' /usr/lib/prosody/../../bin/prosody:407: in main chunk [C]: ?

  2. trelauney on

    Found the same error in my logs again while trying to debug other things - this time 5 times in the same second. Might have to do with the number of people chatting. Aug 02 00:21:50 http.server error Traceback[httpserver]: /usr/lib64/prosody/modules/mod_bosh.lua:251: bad argument #1 to 'math_min' (number expected, got nil) stack traceback: [C]: in function 'parse' /usr/lib64/prosody/util/xmppstream.lua:255: in function 'feed' /usr/lib64/prosody/modules/mod_bosh.lua:128: in function '?' /usr/lib64/prosody/util/events.lua:67: in function 'fire_event' /usr/lib64/prosody/net/http/server.lua:221: in function </usr/lib64/prosody/net/http/server.lua:164> (tail call): ? [C]: in function 'xpcall' /usr/lib64/prosody/net/http/server.lua:108: in function 'process_next' /usr/lib64/prosody/net/http/server.lua:124: in function 'success_cb' /usr/lib64/prosody/net/http/parser.lua:154: in function 'feed' /usr/lib64/prosody/net/http/server.lua:150: in function 'onincoming' /usr/lib64/prosody/net/server_event.lua:632: in function </usr/lib64/prosody/net/server_event.lua:578> [C]: in function 'loop' /usr/lib64/prosody/net/server_event.lua:793: in function </usr/lib64/prosody/net/server_event.lua:792> [C]: in function 'xpcall' /usr/lib64/prosody/../../bin/prosody:376: in function 'loop' /usr/lib64/prosody/../../bin/prosody:407: in main chunk [C]: ? I'll be trying the following modification on my current version (prosody-0.9.8-4.el7.x86_64) to see stops the issue. - bosh_version = attr.ver, bosh_wait = math_min(attr.wait, bosh_max_wait), streamid = sid, + bosh_version = attr.ver, bosh_wait = math_min(attr.wait == nil ? 0 : attr.wait, bosh_max_wait), streamid = sid,

  3. Zash on

    This is included in #343 so assigning to MattJ. Mark this as duplicate?

    Changes
    • owner MattJ
  4. Zash on

    Changes
    • owner MattJ Zash
    • tags Status-Started
  5. Zash on

    Fixed in https://hg.prosody.im/0.10/rev/250855633092

    Changes
    • tags Status-Fixed

New comment

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