<p></p>

<h3>Description</h3>
<p>db_redis connection broken after idle several minutes if redis server with timeout setting</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<ol>
<li>configure Redis server with timeout 600. (10 minutes)</li>
<li>configure Kamailio with db_redis module and usrloc module<br>
modparam("usrloc", "db_url", "REDIS_CONNECT")</li>
<li>at client side, try to register, then close client tool.</li>
<li>after idle for 10+ minutes, no any registion, reopen client tool and try to register, <- register failed.</li>
</ol>
<h4>Debugging Data</h4>

<pre><code>(paste your debugging data here)
</code></pre>
<h4>Log Messages</h4>

<p>db_redis [redis_dbase.c:2504]: db_redis_insert(): Failed to fetch type entry: Broken pipe<br>
db_redis [redis_dbase.c:2568]: db_redis_insert(): failed to do the insert<br>
usrloc [ucontact.c:687]: db_insert_ucontact(): inserting contact in db failed 1001 (uloc-60b45e88-1c5d-d)<br>
usrloc [urecord.c:601]: insert_ucontact(): failed to insert in database<br>
registrar [save.c:537]: insert_contacts(): failed to insert contact<br>
sl [sl_funcs.c:414]: sl_reply_error(): stateless error reply used: I'm terribly sorry, server error occurred (1/SL)</p>
<h4>SIP Traffic</h4>

<pre><code>(paste your sip traffic here)
</code></pre>
<h3>Possible Solutions</h3>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<p>version: kamailio 5.5.0 (x86_64/linux)<br>
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED<br>
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled with gcc 8.3.0<br>
PS: 5.4.5 has the same issue.</p>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<p>Debian 10.9<br>
Linux test1 4.19.0-16-cloud-amd64 <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="31891578" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/1" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/1/hovercard" href="https://github.com/kamailio/kamailio/issues/1">#1</a> SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux</p>

<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/2764">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOSRQ5X2QFQFDZKKQLTRJCAJANCNFSM46EWPXNQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZPONDZB64HJKVHOTFTTRJCAJA5CNFSM46EWPXN2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4NTA5UGQ.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/2764",
"url": "https://github.com/kamailio/kamailio/issues/2764",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>