views:

215

answers:

1

Hi there,

I made a comet chat server with Erlang and Mochiweb. And I run the "./start-dev.sh" to start the server. But after about 1 month I got the following error:

=ERROR REPORT==== 26-Sep-2009::09:21:06 ===
{mochiweb_socket_server,235,
    {child_error,
        {badmatch,
            {error,
                [70,97,105,108,101,100,32,115,101,110,100,105,110,103,32,100,
                 97,116,97,32,111,110,32,115,111,99,107,101,116,32,58,32,
                 "closed"]}}}}
mysql: fetch "SELECT appKey FROM applications WHERE appID = 1" (id p1)

=CRASH REPORT==== 26-Sep-2009::09:21:10 ===
  crasher:
    initial call: mochiweb_socket_server:acceptor_loop/1
    pid: <0.4271.23>
    registered_name: []
    exception error: no match of right hand side value 
                     {error,[70,97,105,108,101,100,32,115,101,110,100,105,110,
                             103,32,100,97,116,97,32,111,110,32,115,111,99,
                             107,101,116,32,58,32,"closed"]}
      in function  moonwalker_web:loop/2
      in call from mochiweb_http:headers/5
    ancestors: [moonwalker_web,moonwalker_sup,<0.52.0>]
    messages: []
    links: [<0.54.0>,#Port<0.792854>]
    dictionary: [{mochiweb_request_body,
                      <<"appID=1&appKey=keyy&userID=8048943&nickName=bill&buddies=N%3B&timestamp=1253928070154">>},
                  {mochiweb_request_recv,true},
                  {mochiweb_request_post,
                      [{"appID","1"},
                       {"appKey","key"},
                       {"userID","8048943"},
                       {"nickName",[143,229,167,144]},
                       {"buddies","N;"},
                       {"timestamp","1253928070154"}]},
                  {mochiweb_request_path,"/online"}]
    trap_exit: false
    status: running
    heap_size: 2584
    stack_size: 24
    reductions: 1368
  neighbours:

=ERROR REPORT==== 26-Sep-2009::09:21:10 ===
{mochiweb_socket_server,235,
    {child_error,
        {badmatch,
            {error,
                [70,97,105,108,101,100,32,115,101,110,100,105,110,103,32,100,
                 97,116,97,32,111,110,32,115,111,99,107,101,116,32,58,32,
                 "closed"]}}}}

And if turn the following numbers into characters

            [70,97,105,108,101,100,32,115,101,110,100,105,110,103,32,100,
             97,116,97,32,111,110,32,115,111,99,107,101,116,32,58,32,
             "closed"]}}}}

they are

Failed sending data on socket :"closed"

Does that mean I have problems with MySQL connection or socket? I don't know if this error has something to do with my "./start-dev.sh" or I just had some wrong settings?

And what else information do I have to provide for diagnosing?

Thanks and looking forward to your reply?

+2  A: 

It looks like somewhere in the loop/2 function you don't handle an {error,Error} return from a function call. This causes the error which crashes the process. Without the code it is difficult to say what caused the error return.

rvirding