Hi ,
Sorry for opening an old issue but I can not find a solution.
At every http request mochiweb yields the following crash:
=CRASH REPORT==== 30-Oct-2014::12:47:08 ===
crasher:
initial call: mochiweb_acceptor:init/3
pid: <0.151.0>
registered_name: []
exception error: no match of right hand side value {error,einval}
in function mochiweb_http:request/2 (src/mochiweb_http.erl, line 63)
ancestors: [mwagl_http_inet,<0.142.0>,<0.126.0>]
messages: []
links: [<0.143.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 376
stack_size: 27
reductions: 2212
neighbours:
I modified the file src/mochiweb_http.erl in order to print some values:
loop(Socket, Body) ->
R1 = mochiweb_socket:setopts(Socket, [{packet, http}]),
R2 = inet:getstat(Socket),
R3 = inet:sockname(Socket),
error_logger:info_msg("[LOOP]:~nSOCKET=~p~nSETOPTS=~p~nGETSTAT=~p~nSOCKNAME=~p~n", [Socket, R1, R2, R3]),
request(Socket, Body).
request(Socket, Body) ->
R1 = mochiweb_socket:setopts(Socket, [{active, once}]),
R2 = inet:getstat(Socket),
R3 = inet:sockname(Socket),
error_logger:info_msg("[REQUEST]:~nSOCKET=~p~nSETOPTS=~p~nGETSTAT=~p~nSOCKNAME=~p~n", [Socket, R1, R2, R3]),
receive
..........
[LOOP]:
SOCKET=#Port<0.5049>
SETOPTS=ok
GETSTAT={ok,[{recv_oct,0},
{recv_cnt,0},
{recv_max,0},
{recv_avg,0},
{recv_dvi,0},
{send_oct,0},
{send_cnt,0},
{send_max,0},
{send_avg,0},
{send_pend,0}]}
SOCKNAME={ok,{{10,10,11,66},8010}}
=INFO REPORT==== 30-Oct-2014::12:55:45 ===
[REQUEST]:
SOCKET=#Port<0.5049>
SETOPTS=ok
GETSTAT={ok,[{recv_oct,77},
{recv_cnt,1},
{recv_max,77},
{recv_avg,77},
{recv_dvi,0},
{send_oct,0},
{send_cnt,0},
{send_max,0},
{send_avg,0},
{send_pend,0}]}
SOCKNAME={ok,{{10,10,11,66},8010}}
=INFO REPORT==== 30-Oct-2014::12:55:45 ===
[<0.222.0>]:REQ={'GET',"/get_cookie_m?list=sfgdfgdfgdf"}
=INFO REPORT==== 30-Oct-2014::12:55:45 ===
[LOOP]:
SOCKET=#Port<0.5701>
SETOPTS=ok
GETSTAT={ok,[{recv_oct,0},
{recv_cnt,0},
{recv_max,0},
{recv_avg,0},
{recv_dvi,0},
{send_oct,0},
{send_cnt,0},
{send_max,0},
{send_avg,0},
{send_pend,0}]}
SOCKNAME={ok,{{10,10,11,66},8010}}
=INFO REPORT==== 30-Oct-2014::12:55:45 ===
[REQUEST]:
SOCKET=#Port<0.5701>
SETOPTS=ok
GETSTAT={ok,[{recv_oct,86},
{recv_cnt,1},
{recv_max,86},
{recv_avg,86},
{recv_dvi,0},
{send_oct,0},
{send_cnt,0},
{send_max,0},
{send_avg,0},
{send_pend,0}]}
SOCKNAME={ok,{{10,10,11,66},8010}}
=INFO REPORT==== 30-Oct-2014::12:55:45 ===
[<0.227.0>]:REQ={'POST',"/update_session_cn?cookie_val=46d35f1fab2c8051c2a219c62c148be48a35f50e"}
=INFO REPORT==== 30-Oct-2014::12:55:45 ===
[LOOP]:
SOCKET=#Port<0.5701>
SETOPTS={error,einval}
GETSTAT={error,einval}
SOCKNAME={error,einval}
=INFO REPORT==== 30-Oct-2014::12:55:45 ===
[REQUEST]:
SOCKET=#Port<0.5701>
SETOPTS={error,einval}
GETSTAT={error,einval}
SOCKNAME={error,einval}
The line number 63 may not be relevenat any more
I seems that the socket is valid - exists in the system and when a POST
is sent to the server einval appears.
It looks like it tries to use for POST request the same socket for the previous
GET request.
Don't know why this happens.
Please shed some light on this issue as I am stuck and I have to migrate my application servers on otp 17
Thank you,
Bogdan