1

A Tsung 1.5.1 load testing script that works on a different system crashes as soon as I start it, with the following cryptic Erlang error. What could be the cause?

$ tsung -f test1.xml -l ~/Desktop start
Starting Tsung
"Log directory is: /home/username/Desktop/20150302-1606"
Config Error, aborting ! {{badmatch,{error,enoent}},
                  [{ts_config_http,parse_config,2,
                       [{file,
                            "src/tsung_controller/ts_config_http.erl"},
                        {line,63}]},
                   {lists,foldl,3,[{file,"lists.erl"},{line,1261}]},
                   {ts_config,parse,2,
                       [{file,"src/tsung_controller/ts_config.erl"},
                        {line,437}]},
                   {lists,foldl,3,[{file,"lists.erl"},{line,1261}]},
                   {ts_config,handle_read,3,
                       [{file,"src/tsung_controller/ts_config.erl"},
                        {line,85}]},
                   {ts_config,read,2,
                       [{file,"src/tsung_controller/ts_config.erl"},
                        {line,70}]},
                   {ts_config_server,handle_call,3,
                       [{file,
                            "src/tsung_controller/ts_config_server.erl"},
                        {line,206}]},
                   {gen_server,try_handle_call,4,
                       [{file,"gen_server.erl"},{line,607}]}]}

There's nothing in the test log (tsung.log is a zero-byte file). The tsung_controller@*.log file contains the same error with the following additional information:

=ERROR REPORT==== 2-Mar-2015::16:06:51 ===
** Generic server ts_config_server terminating 
** Last message in was {get_monitor_hosts}
** When Server state == {state,undefined,
                           "/home/username/Desktop/20150302-1606",0,0,0,
                           undefined,1,undefined,hostname,0,0,undefined,
                           undefined}
** Reason for termination == 
** {{badrecord,config},
    [{ts_config_server,handle_call,3,
                   [{file,"src/tsung_controller/ts_config_server.erl"},
                    {line,335}]},
     {gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]},
     {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,639}]},
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}

I've installed Tsung from the Fedora package repository, and even tried removing the package and installing from source. The simple example scripts included with Tsung work without problem. The DTDs references at the top of the configuration file are valid and present.

1

The problem turned out to be that the Tsung script included a file that was not present on the local file system. My experience suggests that if Erlang gives an enoent badmatch error, it can't find a file.

Here's the culprit. In a <request> tag, the contents_from_file setting points to a non-existent file:

<http url="/path?param1=%%_parameter1value_%%"
    content_type='text/plain' method="POST" version="1.1" 
    contents_from_file="folder/post_content.txt">
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.