#1133 Connection to mod-websocket fails

Reporter Abraham Przewodnik
Owner Zash
Created
Updated
Stars ★ (1)
Tags
  • Component-Docs
  • Priority-Medium
  • Status-Fixed
  • Type-Defect
  1. Abraham Przewodnik on

    What steps will reproduce the problem? 1. Enable "websocket" in prosody.cfg.lua and restart prosody 2. Try to connect using websockets What is the expected output? The client should successfully connect to prosody What do you see instead? 1. The client gets Error 501 and the connection is refused 2. The logs show "Top-level error, please report: /usr/lib/prosody/net/websocket/frames.lua:57: bad argument #3 to 's_pack' (number expected, got no value)" What version of the product are you using? On what operating system? Prosody trunk nightly build 883 (2018-04-25, b6e193e33145) Debian GNU/Linux 8 (jessie) – All Updates installed Lua 5.1 – This is what the dependencies of the package say # Lua module versions lfs: LuaFileSystem 1.6.2 libevent: 2.0.21-stable luaevent: 0.4.4 lxp: LuaExpat 1.3.0 socket: LuaSocket 3.0-rc1 ssl: 0.5.PR Please provide any additional information below. - I verified that "lua-bitop" is installed. - I connect using ssl. The ssl-certificate is valid and works in apache and for normal xmpp-sessions. Complete log: Apr 26 13:14:15 socket debug server.lua: auto-starting ssl negotiation... Apr 26 13:14:15 socket debug server.lua: attempting to start tls on tcp{client}: 0x1c48638 Apr 26 13:14:15 socket debug server.lua: accepted new client connection from 87.138.176.20:55207 to 5281 Apr 26 13:14:15 socket debug server.lua: ssl handshake done Apr 26 13:14:15 http.server debug Firing event: GET chat.***.de/xmpp-websocket Apr 26 13:14:15 c2s1ac6950 info Client connected Apr 26 13:14:15 c2s1ac6950 debug Sending WebSocket handshake Apr 26 13:14:15 mod_websocket debug Websocket received frame: opcode=1, 89 bytes Apr 26 13:14:15 c2s1ac6950 debug Client sent opening <stream:stream> to chat.bluprevent.de Apr 26 13:14:15 general error Top-level error, please report: /usr/lib/prosody/net/websocket/frames.lua:57: bad argument #3 to 's_pack' (number expected, got no value) Apr 26 13:14:15 general error stack traceback: [C]: in function 'parse' /usr/lib/prosody/util/xmppstream.lua:278: in function 'feed' /usr/lib/prosody/modules/mod_c2s.lua:272: in function 'data' /usr/lib/prosody/modules/mod_c2s.lua:295: in function </usr/lib/prosody/modules/mod_c2s.lua:292> (tail call): ? /usr/lib/prosody/net/server_select.lua:911: in function </usr/lib/prosody/net/server_select.lua:895> [C]: in function 'xpcall' /usr/lib/prosody/../../bin/prosody:80: in function 'loop' /usr/lib/prosody/../../bin/prosody:90: in main chunk [C]: ?

  2. Zash on

    Hi, thanks for the report! It looks like you have something installed that's providing a Lua "struct" module that is not behaving as it should. I was recently made aware that there is more than one such library, at least one of which is incompatible with the one Prosody was tested with. Prosody is compatible with http://www.inf.puc-rio.br/~roberto/struct/ which is largely compatible with functionality that was added in Lua 5.3.

    Changes
    • owner Zash
    • tags Status-NeedInfo
  3. Abraham Przewodnik on

    Thank You for Your quick answer. I followed Your hint about a library and I found that I had the luarock "lua_pack" installed. Since I don't need this luarock anymore I have simply removed it and now connections over websocket don't crash anymore. I don't know enough about Lua to know weather this can be considered a bug or it's just me having the wrong luarocks installed.

  4. Zash on

    Thanks for confirming. I've added a note to our documentation about this library, it wasn't mentioned before. https://hg.prosody.im/site/rev/6a77d25e21e3

    Changes
    • tags Status-Fixed Component-Docs

New comment

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