Service Virtualization

 View Only
  • 1.  Timeout in sh file : Cannot run program "sh"

    Posted Jul 16, 2020 10:54 AM
    Hello everyone.
    I have a problem in the context of my environment.
    The responses of the virtual services I use are located in a git repository, to customize the responses that will be returned. I cloned the remote repository on the VSE server and used a sh file, called gitupdate.sh, to do the "git pull" command and update the local repository.
    When performing mass tests (sending several requests to the service) the service starts sending a timeout error. Analyzing the inspection view I get the following error:

    | Message: Cannot run program "sh" (in directory "/ opt / CA / ServicosVirtuais-Git"): error = 24, Too many open files
    -------------------------------------------------- --------------------------
    | Trapped Exception: Cannot run program "sh" (in directory "/ opt / CA / ServicosVirtuais-Git"): error = 24, Too many open files
    | Trapped Message: java.io.IOException: Cannot run program "sh" (in directory "/ opt / CA / ServicosVirtuais-Git"): error = 24, Too many open files

    StackTrace shows me the following:

    java.io.IOException: Cannot run program "sh" (in directory "/ opt / CA / ServicosVirtuais-Git"): error = 24, Too many open files
    at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)
    at java.lang.Runtime.exec (Runtime.java:620)
    at com.itko.lisa.utils.CommandLineExecNode.executeCmdLine (CommandLineExecNode.java/1640)
    at com.itko.lisa.utils.CommandLineExecNode.executeCmdLine (CommandLineExecNode.java:452)
    at com.itko.lisa.utils.CommandLineExecNode.executeCmdLine (CommandLineExecNode.java:419)
    at com.itko.lisa.utils.CommandLineExecNode.execute (CommandLineExecNode.java:326)
    at com.itko.lisa.test.TestNode.executeNode (TestNode.java:995)
    at com.itko.lisa.test.TestCase.execute (TestCase.java:1297)
    at com.itko.lisa.test.TestCase.execute (TestCase.java:1198)
    at com.itko.lisa.test.TestCase.executeNextNode (TestCase.java:1183)
    at com.itko.lisa.test.TestCase.executeTest (TestCase.java:1124)
    at com.itko.lisa.coordinator.Instance.run (Instance.java:208)
    Caused by: java.io.IOException: error = 24, Too many open files
    at java.lang.UNIXProcess.forkAndExec (Native Method)
    at java.lang.UNIXProcess. <init> (UNIXProcess.java:247)
    at java.lang.ProcessImpl.start (ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start (ProcessBuilder.java:1029)
    ... 11 more
    ================================================== ==========================

    Any idea how to solve this problem? Thank you all.

    ------------------------------
    Matheus Souza
    Capgemini-BR
    ------------------------------


  • 2.  RE: Timeout in sh file : Cannot run program "sh"
    Best Answer

    Posted Jul 16, 2020 01:33 PM
    Hi Matheus,

    It could be because of multiple resources trying to access same file/directory. In your file, try inducing some wait time this may help. If you are writing any files try avoiding writing in single file.

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------