<p></p>
<h3>Description</h3>
<h3>Troubleshooting</h3>
<p>By executing an external script using exec_cmd function I'm getting the following error:<br>
<code>failed. exit_status=13, errno=11: Resource temporarily unavailable</code></p>
<p>This is happening intermittently, sometimes it's working fine, but sometimes I see this error in the log file. After looking in the debug log file I found that for some reason the exit code for the executed command is not 0 (ki_exec_cmd(): execution return code: 1), that's why this function is complaining (I guess).</p>
<p>What is weird that this is not happening permanently, it's about 2 cases from 5, and by running the same command manually - every time I'm getting success, all the time exit code is 0. (I'm running the same command with the same user like kamailio is running)</p>
<p>Replacing exec_cmd with exec_avp - I didn't notice this issue.</p>
<h4>Debugging Data</h4>
<pre><code>2376cc5b10f549@192.168.0.1:5060} exec [exec_mod.c:278]: ki_exec_cmd(): executing [nice -20 /usr/local/bin/cmd arg1 arg2
2376cc5b10f549@192.168.0.1:5060} dialog [dlg_hash.c:1069]: dlg_unref_helper(): unref dlg 0x7fd643b32398 with 1 -> 4
376cc5b10f549@192.168.0.1:5060} <script>: [From=sip:+123456789@company.net, To Domain=company.net, R-URI=sip:+987654321@192.168.0.1:5060]
2376cc5b10f549@192.168.0.1:5060} <core> [main.c:905]: sig_usr(): SIGCHLD received: we do not worry about grand-children
2376cc5b10f549@192.168.0.1:5060} exec [exec_mod.c:282]: ki_exec_cmd(): execution return code: 1
2376cc5b10f549@192.168.0.1:5060} <core> [core/action.c:1598]: run_actions(): alert - action [corefunc (16)] cfg [/etc/kamailio-dev/conf.d/routes.cfg:1567] took too long [780373 us]
2376cc5b10f549@192.168.0.1:5060} dialog [dlg_hash.c:877]: internal_get_dlg(): ref dlg 0x7fd643b32398 with 1 -> 5
</code></pre>
<h3>Possible Solutions</h3>
<p>Use exec_avp instead</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.4.1 (x86_64/linux) a6cb74
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>CentOS 7 x64
Linux k3-core1.nuacom.eqx 3.10.0-1127.8.2.el7.x86_64 #1 SMP Tue May 12 16:57:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2538">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZLXWD6HRFHZE5UZU5DSNF7LPANCNFSM4TD3ER3A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZKYXPX3XCP42NB22MLSNF7LPA5CNFSM4TD3ER3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4K5HMSGA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2538",
"url": "https://github.com/kamailio/kamailio/issues/2538",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>