### Description
i upgrade kamailio 4 to 5 following all the respective guides carefully: https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0 and then from 5.0 to 5.1 and kamailio does not start
### Troubleshooting
kamailio does not run and got error: `db_check_table_version(): invalid version 6 for table sipusers found, expected 7 (check table structure and table "version")`
the message are very ambigous
#### Reproduction
* install log time ago kamailio 4.4 * apply all steps to upgrade as https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0 * apply again aditional steps as https://www.kamailio.org/wiki/install/upgrade/5.0.x-to-5.1.0 * restar kamailio and does not start due error on table check
#### Log Messages
``` 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 ```
### Possible Solutions
could the changelog provide the missing tables? or wiki doesn ot point all the respective changes?
### Additional Information
``` 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 ```
### Operating System:
``` 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 ```
Closed #1780.
From https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0
``` --table: subscriber ALTER TABLE subscriber CHANGE COLUMN rpid rpid VARCHAR(128) DEFAULT NULL; -- was varchar(64) DEFAULT NULL ALTER TABLE subscriber CHANGE COLUMN email_address email_address VARCHAR(128) DEFAULT NULL; -- was varchar(64) NOT NULL DEFAULT '' ALTER TABLE subscriber CHANGE COLUMN password password VARCHAR(64) NOT NULL DEFAULT ''; -- was varchar(25) NOT NULL DEFAULT '' ALTER TABLE subscriber CHANGE COLUMN ha1 ha1 VARCHAR(128) NOT NULL DEFAULT ''; -- was varchar(64) NOT NULL DEFAULT '' ALTER TABLE subscriber CHANGE COLUMN ha1b ha1b VARCHAR(128) NOT NULL DEFAULT ''; -- was varchar(64) NOT NULL DEFAULT '' UPDATE version SET table_version=7 WHERE TABLE_NAME="subscriber"; ```
That's the official(**default**) table name.
```ERROR: auth_db [auth_db_mod.c:308]: auth_fixup(): error during table version check.```
Error seems pretty clear to me, the version value is wrong. It has the module name, so you can check [AUTH_DB Module db structure](https://www.kamailio.org/docs/db-tables/kamailio-db-5.2.x.html#idm1021174668) and find out what is missing.
You can imagine We can't support **every** *custom* installation in the world
i already do that what f***g happened! can you understand that i not see the "sipusers" table at my database! i mean "suscriber table are good!!!
seems do you not read the stupid info in the issue!? **I ALREADY HAVE THE SUSCRIBER TABLE IN VERSION 7!!!**
Please remember that this is an open source project, and cursing will not help you to get a faster or better response to your question or issue. I would suggest to discuss this issue further on our sr-users list, all questions related to the usage of Kamailio are welcome there.
hi @henningw thanks for your suggestion but i think its a clear issue due out of sync changelog respect the code change.. currently i try to find in the commits the specific string "sipusers" due i not have that table in the DB so are obvious that @linuxmaniac aswered without take care of the writing
@mckaygerhard There is no table sipusers in Kamailio, therefore there are no changelog or documentation entries for this. I assume that is something from your installation. It could be something related to an asterisk installation on the same machine. If this is true you need to contact the asterisk list. ;-)
umm now that you mention i already do an asterisk integration! .. so then its an issue! rollback to kamailio 4.4.X works! (using an old snapshot of the virtual vmware instance), that confirms its a bug!
can you noted that are not a custom instalation, i already do a fresh install and then integrate with asterisk and that error raised! seems you guys change a lot and do not documented the changes
same here, I have make fresh install and then integrate with asterisk and that error raised!
@nerv55 Can you (and others) then please join the sr-users list and provide more details about the issue? The bug tracker is not appropriate forum to discuss this problems arising from integration to asterisk.
Anyone using again bad words or strong language, will be banned and reported. Even when someone doesn't give expected answer, she/he tries to help, using bad language is a sign that person deserves no assistance.
Integration with asterisk is not a matter of code for Kamailio, but something done in config. So it is not a bug in Kamailio, nor something that developers of Kamailio have to document explicitly. There are tutorials done by various peoples for specific versions of Kamailio and asterisk.
In short, nothing to report here on bug tracker, but eventually to discuss on sr-users mailing list, as already suggested.
Given all these, but to close the discussion, go to database where you have SIP users table and create a table named version with the structure like table version from Kamailio database. Add there a record for table_name to be sipusers, and table_version to be the same value as for subscriber in the version table of Kamailio db.
If you want a different approach, read the readme of auth_db module, there is a parameter to disable dB table version check.
Hope this is closed completely now.
hi @henningw i'm pretty sure it's a bug, some other users in the network got similar problems due not documented changelog.. i'll will help to find (i already doing since yesterday) what commit are related to this problem, mi bad feelings are that the issue was abrudted closed without note the table name that was obviously.. in some coupe of hour i can provide the necesary info.. i researching at the cmmits right now