ejabberd + debian + odbc + mysql issue

Hello,
I've ejabberd server with circa 600 people connected simultaneously. Server is from Debian backports (2.1.5-2~bpo50+1) configured on Debian Lenny (libmyodbc - 3.51.15r409-4, unixodbc - 2.2.11-16, erlang-nox 1:12.b.3-dfsg-4). In erlang.log and also in ejabberd.log can see such errors repeating:

=CRASH REPORT==== 21-Jan-2011::12:49:17 ===
  crasher:
    pid: <0.1867.0>
    registered_name: []
    exception exit: {port_exit,could_not_access_column_count}
      in function  gen_server:terminate/6
    initial call: gen:init_it(gen_server,<0.297.0>,<0.297.0>,odbc,
                              [{client,<0.283.0>}],
                              [])
    ancestors: [odbc_sup,<0.295.0>]
    messages: [{'EXIT',#Port<0.4185>,normal}]
    links: [<0.297.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 23
    reductions: 9391
  neighbours:

=SUPERVISOR REPORT==== 21-Jan-2011::12:49:17 ===
     Supervisor: {local,odbc_sup}
     Context:    child_terminated
     Reason:     {port_exit,could_not_access_column_count}
     Offender:   [{pid,<0.1867.0>},
                  {name,[]},
                  {mfa,{odbc,start_link_sup,[[{client,<0.283.0>}]]}},
                  {restart_type,temporary},
                  {shutdown,7000},
                  {child_type,worker}]
=CRASH REPORT==== 21-Jan-2011::12:57:53 ===
  crasher:
    pid: <0.344.0>
    registered_name: []
    exception exit: {port_exit,could_not_access_column_count}
      in function  gen_server:terminate/6
    initial call: gen:init_it(gen_server,<0.297.0>,<0.297.0>,odbc,
                              [{client,<0.279.0>}],
                              [])
    ancestors: [odbc_sup,<0.295.0>]
    messages: [{'EXIT',#Port<0.498>,normal}]
    links: [<0.297.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 6765
    stack_size: 23
    reductions: 31999
  neighbours:

=SUPERVISOR REPORT==== 21-Jan-2011::12:57:53 ===
     Supervisor: {local,odbc_sup}
     Context:    child_terminated
     Reason:     {port_exit,could_not_access_column_count}
     Offender:   [{pid,<0.344.0>},
                  {name,[]},
                  {mfa,{odbc,start_link_sup,[[{client,<0.279.0>}]]}},
                  {restart_type,temporary},
                  {shutdown,7000},
                  {child_type,worker}]

=ERROR REPORT==== 2011-01-21 12:57:53 ===
** Generic server <0.344.0> terminating
** Last message in was {#Port<0.498>,{exit_status,19}}
** When Server state == {state,#Port<0.498>,
                               {<0.279.0>,#Ref<0.0.0.49756>},
                               <0.279.0>,undefined,on,false,false,off,
                               connected,undefined,0,
                               [#Port<0.495>,#Port<0.496>],
                               #Port<0.502>,#Port<0.505>}
** Reason for termination ==
** {port_exit,could_not_access_column_count}
=ERROR REPORT==== 2011-01-21 12:57:53 ===
E(<0.279.0>:ejabberd_odbc:395) : SQL transaction restarts exceeded
** Restarts: 10
** Last abort reason: connection_closed
** Stacktrace: [{ejabberd_odbc,sql_query_t,1},
                {mod_roster_odbc,'-process_subscription/6-fun-0-',8},
                {ejabberd_odbc,outer_transaction,3},
                {ejabberd_odbc,run_sql_cmd,4},
                {p1_fsm,handle_msg,10},
                {proc_lib,init_p,5}]
** When State == {state,<0.344.0>,odbc,15000,"jabber.local",
                        1000,
                        {0,{[],[]}}}

partial odbc.ini:

Driver = /usr/lib/odbc/libmyodbc.so
OPTION = 3
SOCKET =
stmt = SET CHARACTER SET utf8
charset = utf8

partial ejabberd.cfg:

{odbc_server, "DSN=Myejabberd;UID=ejabberd;PWD=xxxxxxxxxxxxxxxx"}.
{odbc_pool_size, 20}.
{odbc_keepalive_interval, 300}.
{odbc_start_interval, 15}.

ODBC modules in use: mod_last_odbc, mod_offline_odbc, mod_privacy_odbc, mod_private_odbc, mod_roster_odbc, mod_vcard_odbc

MySQL server is on same LAN segment and it is used also from other apps (running on same server as ejabberd) and these apps do not experience any problems with MySQL connections.

I really appreciate any ideas or hints. Thank You

Searching for:

Searching for: {port_exit,could_not_access_column_count}
does not show results related to ejabberd.

I found some interesting threads:
1. Report a similar error: http://www.erlang.org/cgi-bin/ezmlm-cgi?4:mss:38250:npaakhedblldlnhejnah
2. Provides a patch: http://www.erlang.org/cgi-bin/ezmlm-cgi?3:mss:492:200910:nfngkejnpnegicn...
3. I think this is when the patch was included in erlang: http://www.erlang.org/download/otp_src_R13B03.readme

--- odbc-2.10.6 ---------------------------------------------------------

...

    OTP-8291  Applied a patch from Andrew Thompson, which fixes some error
	      cases.

Maybe it's a bug in older Erlang/OTP releases, which was fixed in R13B03.

badlop thank You for

badlop thank You for response. Squeeze will be released soon and hopefully it will solve this issue. When not I can try release from here.

Syndicate content