<h3>Description</h3>
<p>i upgrade kamailio 4 to 5 following all the respective guides carefully: <a href="https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0" rel="nofollow">https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0</a> and then from 5.0 to 5.1 and kamailio does not start</p>
<h3>Troubleshooting</h3>
<p>kamailio does not run and got error: <code>db_check_table_version(): invalid version 6 for table sipusers found, expected 7 (check table structure and table "version")</code></p>
<p>the message are very ambigous</p>
<h4>Reproduction</h4>
<ul>
<li>install log time ago kamailio 4.4</li>
<li>apply all steps to upgrade as <a href="https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0" rel="nofollow">https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0</a></li>
<li>apply again aditional steps as <a href="https://www.kamailio.org/wiki/install/upgrade/5.0.x-to-5.1.0" rel="nofollow">https://www.kamailio.org/wiki/install/upgrade/5.0.x-to-5.1.0</a></li>
<li>restar kamailio and does not start due error on table check</li>
</ul>
<h4>Log Messages</h4>
<pre><code>Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: db_mysql [km_my_con.c:148]: db_mysql_new_connection(): server version is 5.5.5-10.0.32-MariaDB-0+deb8u1
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:120]: db_new_result(): allocate 56 bytes for result set at 0x7f395b036b30
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: db_mysql [km_res.c:66]: db_mysql_get_columns(): 1 columns returned from the query
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:158]: db_allocate_columns(): allocate 8 bytes for result names at 0x7f395b044128
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:169]: db_allocate_columns(): allocate 4 bytes for result types at 0x7f395b044198
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: db_mysql [km_res.c:84]: db_mysql_get_columns(): allocate 16 bytes for RES_NAMES[0] at 0x7f395b0b91c8
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: db_mysql [km_res.c:91]: db_mysql_get_columns(): RES_NAMES(0x7f395b0b91c8)[0]=[table_version]
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: db_mysql [km_res.c:99]: db_mysql_get_columns(): use DB1_INT result type
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:188]: db_allocate_rows(): allocate 16 bytes for rows at 0x7f395b0b9240
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 32 bytes for row values at 0x7f395b0b92b8
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_val.c:74]: db_str2val(): converting INT [6]
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:79]: db_free_columns(): freeing 1 columns
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[0] at 0x7f395b0b91c8
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:96]: db_free_columns(): freeing result names at 0x7f395b044128
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:101]: db_free_columns(): freeing result types at 0x7f395b044198
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:52]: db_free_rows(): freeing 1 rows
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7f395b0b92b8
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:60]: db_free_rows(): freeing rows at 0x7f395b0b9240
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_res.c:138]: db_free_result(): freeing result set at 0x7f395b036b30
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) ERROR: <core> [db.c:450]: db_check_table_version(): invalid version 6 for table sipusers found, expected 7 (check table structure and table "version")
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) ERROR: auth_db [auth_db_mod.c:308]: auth_fixup(): error during table version check.
Dec 21 16:34:31 ip-10-101-2-78 kamailio[8501]: 0(8503) DEBUG: <core> [db_pool.c:100]: pool_remove(): removing connection from the pool
</code></pre>
<h3>Possible Solutions</h3>
<p>could the changelog provide the missing tables? or wiki doesn ot point all the respective changes?</p>
<h3>Additional Information</h3>
<pre><code>version: kamailio 5.1.6 (x86_64/linux) 
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled with gcc 4.9.2
</code></pre>
<h3>Operating System:</h3>
<pre><code>Linux ip-10-101-2-78 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) 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/1780">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36Zb5VWcUtawQFFYrrmjwdiBqbW2zxks5u8aqZgaJpZM4Zgzoz">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZQXMuhWVySNZWXrseijFBQrtdU9tks5u8aqZgaJpZM4Zgzoz.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"table check error when upgrade kamailio 4 to 5 (#1780)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1780"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1780",
"url": "https://github.com/kamailio/kamailio/issues/1780",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>