#938 Garbage SQL error when preparing statement handle

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

    What steps will reproduce the problem? - Unknown, happend after some some time. What is the expected output? What do you see instead? No crash What version of the product are you using? On what operating system? latest trunk, ubuntu:16.04 ( https://github.com/Fankserver/docker-prosody/blob/master/trunk/Dockerfile ) Please provide any additional information below. ``` c2s34daa20 info Client connected c2s34daa20 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384) sql error Error in SQL transaction: /lib/prosody/util/sql.lua:176: Error preparing statement handle: 耸�� stack traceback: /lib/prosody/util/sql.lua:176: in function 'select' /lib/prosody/modules/mod_storage_sql.lua:65: in function </lib/prosody/modules/mod_storage_sql.lua:57> (tail call): ? [C]: in function 'xpcall' /lib/prosody/util/sql.lua:229: in function '_transaction' /lib/prosody/util/sql.lua:243: in function 'transaction' /lib/prosody/modules/mod_storage_sql.lua:117: in function 'get' /lib/prosody/modules/mod_auth_internal_hashed.lua:120: in function '?' /lib/prosody/util/sasl/scram.lua:175: in function </lib/prosody/util/sasl/scram.lua:105> (tail call): ? /lib/prosody/modules/mod_saslauth.lua:77: in function </lib/prosody/modules/mod_saslauth.lua:66> (tail call): ? //lib/prosody/util/events.lua:78: in function <//lib/prosody/util/events.lua:74> (tail call): ? /lib/prosody/core/stanza_router.lua:151: in function 'core_process_stanza' /lib/prosody/modules/mod_c2s.lua:253: in function 'func' /lib/prosody/util/async.lua:90: in function </lib/prosody/util/async.lua:88> c2s34daa20 info Authenticated as <UID1> c2s29562a0 info Client disconnected: closed c2s2fa8e10 info Client connected c2s2689a00 info Client connected c2s2fa8e10 info Client disconnected: closed c2s32e4c50 info Client connected c2s2689a00 info Client disconnected: closed c2s358bb40 info Client connected c2s32e4c50 info Client disconnected: closed c2s358bb40 info Client disconnected: closed c2s2c74220 info Client connected c2s2c74220 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384) c2s2c74220 info Authenticated as <UID1> c2s37ae600 info Client connected c2s37ae600 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384) c2s37ae600 info Authenticated as <UID2> c2s2df2680 info Client disconnected: closed c2s2fcee80 info Client connected c2s2fcee80 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384) ```

  2. Fank on

    maybe related, an other crash 2days ago: sql error Error in SQL transaction: /lib/prosody/util/sql.lua:176: Error preparing statement handle: ��� stack traceback: /lib/prosody/util/sql.lua:176: in function 'select' /lib/prosody/modules/mod_storage_sql.lua:65: in function </lib/prosody/modules/mod_storage_sql.lua:57> (tail call): ? [C]: in function 'xpcall' /lib/prosody/util/sql.lua:229: in function '_transaction' /lib/prosody/util/sql.lua:243: in function 'transaction' /lib/prosody/modules/mod_storage_sql.lua:117: in function 'get' ..._modules/mod_adhoc_blacklist/mod_adhoc_blacklist.lua:59: in function 'is_blocked' ..._modules/mod_adhoc_blacklist/mod_adhoc_blacklist.lua:77: in function '?' //lib/prosody/util/events.lua:78: in function <//lib/prosody/util/events.lua:74> (tail call): ? /lib/prosody/modules/mod_s2s/mod_s2s.lua:373: in function '_streamopened' /lib/prosody/modules/mod_s2s/mod_s2s.lua:536: in function 'func' /lib/prosody/util/async.lua:90: in function </lib/prosody/util/async.lua:88> s2sin4b5b110 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384) fankserver.com:saslauth info Accepting SASL EXTERNAL identity from jabber.org s2sin4b5b110 info Incoming s2s connection jabber.org->fankserver.com complete s2sin30c0f10 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384) fankserver.com:saslauth info Accepting SASL EXTERNAL identity from jabber.org s2sin30c0f10 info Incoming s2s connection jabber.org->fankserver.com complete s2sin307a180 info Stream encrypted (TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384) fankserver.com:saslauth info Accepting SASL EXTERNAL identity from jabber.org s2sin307a180 info Incoming s2s connection jabber.org->fankserver.com complete c2s2aa9600 info Client disconnected: closed

  3. Zash on

    Looks like something really weird is going on with the LuaDBI driver, however you don't include information about which one is used.

  4. Zash on

    Could you please post information about your storage setup, version of LuaDBI and database etc?

    Changes
    • tags Status-NeedInfo
  5. Fank on

    Here are all installed lua packages: Installed rocks: ---------------- lua-zlib 1.1-0 (installed) - /usr/local/lib/luarocks/rocks luabitop 1.0.2-3 (installed) - /usr/local/lib/luarocks/rocks luadbi 0.5-1 (installed) - /usr/local/lib/luarocks/rocks luadbi-mysql 0.5-1 (installed) - /usr/local/lib/luarocks/rocks luadbi-postgresql 0.5-1 (installed) - /usr/local/lib/luarocks/rocks luadbi-sqlite3 0.5-1 (installed) - /usr/local/lib/luarocks/rocks luaevent 0.4.4-1 (installed) - /usr/local/lib/luarocks/rocks luaexpat 1.3.0-1 (installed) - /usr/local/lib/luarocks/rocks luafilesystem 1.6.3-2 (installed) - /usr/local/lib/luarocks/rocks luasec 0.6-1 (installed) - /usr/local/lib/luarocks/rocks luasocket 3.0rc1-2 (installed) - /usr/local/lib/luarocks/rocks Will update the server and see if something changes.

  6. Zash on

    And which SQL driver is actually used?

  7. Zash on

    I don't think this has anything to do with mod_saslauth and it's not a crash.

    Changes
    • title mod_saslauth crash "Error preparing statement handle" Garbage SQL error when preparing statement handle
  8. Fank on

    postgresql Im currently testing the https://github.com/mwild1/luadbi because 0.5 https://github.com/mwild1/luadbi/issues/36#issuecomment-255437377 is 6+ years old

  9. Zash on

    Please report back on whether the latest code fixes it. I found at least one commit¹ that looked like a potential fix. Also, reporting this to the bug tracker on Github is probably a good idea since this looks like a LuaDBI bug, not a Prosody bug. ¹ https://github.com/mwild1/luadbi/commit/2ce489c11091e35cb1d987ba2b771f5a2dbd75eb

  10. Fank on

    From my side i can confirm using the latest luadbi build from github fix it. Service is running since 11 days without any crashes. We should change the docs to use latest github version instead of 0.5

  11. Zash on

    Thanks. Looks like LuaDBI is in need of a release then.

    Changes
    • owner MattJ
  12. Zash on

    LuaDBI had a 0.6 release, I'm assuming this can be closed.

    Changes
    • tags Status-Fixed

New comment