tsung_ws icon indicating copy to clipboard operation
tsung_ws copied to clipboard

"Module could not be loaded" in a Docker-container.

Open nautics889 opened this issue 5 years ago • 1 comments

I have Tsung v1.7.0 in my local machine and i try to run websocket tests. Everything goes well. I created a Dockerfile with Erlang 18 (the same as I have installed on my OS) and the same version of Tsung. Checked that for several times, everything corresponds itself in my local environment. But inside a Docker-container i get the following logs:

=ERROR REPORT==== 7-Sep-2019::17:40:10 ===
** State machine <0.128.0> terminating 
** Last message in was {timeout,#Ref<0.0.4.473>,end_thinktime}
** When State == think
**      Data  == {state_rcv,none,
                     {{0,0,0,0},"cport-a3374cc8cad8"},
                     undefined,0,10000,"<my_ip>",8990,ts_tcp,
                     {proto_opts,negotiate,negotiate,"/http-bind/",false,
                         false,false,"/","binary",[],10,3,600000,infinity,
                         infinity,32768,32768,32768,32768,[],true,true},
                     true,1,undefined,true,undefined,-576460746583377248,3,3,
                     false,undefined,0,[],<<>>,
                     {websocket_session,undefined,undefined},
                     0,10,524288,524288,
                     [{tsung_userid,10}],
                     ts_websocket,[],undefined,none}
** Reason for termination = 
** {'module could not be loaded',
       [{crypto,strong_rand_bytes,[16],[]},
        {websocket,gen_accept_key,0,
            [{file,"src/lib/websocket.erl"},{line,134}]},
        {websocket,get_handshake,5,[{file,"src/lib/websocket.erl"},{line,41}]},
        {ts_websocket,get_message,2,
            [{file,"src/tsung/ts_websocket.erl"},{line,85}]},
        {ts_client,handle_next_request,2,
            [{file,"src/tsung/ts_client.erl"},{line,816}]},
        {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,518}]},
        {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}

Looks like Tsung can't load certain module in Docker-container, but in works outside. Is there a way to solve this problem?

nautics889 avatar Sep 07 '19 17:09 nautics889

Hey there, Tsung 1.5.0 added built-in websocket support, so there's no need to use this module anymore with later versions.

This extension has been written many years ago and probably won't be compatible with modern Tsung. Can you try using the built-in websocket support?

wulczer avatar Nov 26 '19 08:11 wulczer