Module: kamailio Branch: master Commit: a8de371e90ddc8a6921b5bf7464961865804cc06 URL: https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf746496186...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2018-12-26T12:04:59+01:00
auth_db: print db table name when version check fails
---
Modified: src/modules/auth_db/auth_db_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf746496186... Patch: https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf746496186...
---
diff --git a/src/modules/auth_db/auth_db_mod.c b/src/modules/auth_db/auth_db_mod.c index 13fa154804..cd1ebaf8ba 100644 --- a/src/modules/auth_db/auth_db_mod.c +++ b/src/modules/auth_db/auth_db_mod.c @@ -303,7 +303,8 @@ static int auth_fixup(void** param, int param_no) if(version_table_check!=0 && db_check_table_version(&auth_dbf, dbh, &name, TABLE_VERSION) < 0) { - LM_ERR("error during table version check.\n"); + LM_ERR("error during version check for db table: %.*s.\n", + name.len, name.s); auth_dbf.close(dbh); return -1; }
Am Mittwoch, 26. Dezember 2018, 12:05:41 CET schrieb Daniel-Constantin Mierla:
Module: kamailio Branch: master Commit: a8de371e90ddc8a6921b5bf7464961865804cc06 URL: https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf74649618 65804cc06
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2018-12-26T12:04:59+01:00
auth_db: print db table name when version check fails
Hello,
the table name and expected versions are already logged in the db_check_table_version() inside DB1 API, e.g:
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.
I checked quickly other modules, at the moment this is not done consistently. Some modules just log an error, some give more detailed log message.
It probably would make sense to unify it, any comments on this?
Best regards,
Henning
Hello,
I am fine to try to make them coherent, if you think of some solution, propose it here and we can discuss and eventually improve, should someone else have other ideas.
Cheers, Daniel
On 26.12.18 13:37, Henning Westerholt wrote:
Am Mittwoch, 26. Dezember 2018, 12:05:41 CET schrieb Daniel-Constantin Mierla:
Module: kamailio Branch: master Commit: a8de371e90ddc8a6921b5bf7464961865804cc06 URL: https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf74649618 65804cc06
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2018-12-26T12:04:59+01:00
auth_db: print db table name when version check fails
Hello,
the table name and expected versions are already logged in the db_check_table_version() inside DB1 API, e.g:
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.
I checked quickly other modules, at the moment this is not done consistently. Some modules just log an error, some give more detailed log message.
It probably would make sense to unify it, any comments on this?
Best regards,
Henning
Am Freitag, 28. Dezember 2018, 16:23:49 CET schrieb Daniel-Constantin Mierla:
I am fine to try to make them coherent, if you think of some solution, propose it here and we can discuss and eventually improve, should someone else have other ideas.
Hi Daniel,
the table name and version information are already logged in the core helper function. To log more information in the module context, my suggestion would be to add a macro to the DB1 API, like this:
DB_TABLE_VERSION_ERROR(l, m) LM_ERR("Error during version check for db table: %.*s, check database structure.\n", l, m)
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.
Then we could convert all the DB modules to use this macro and can easily change it in the future, if we need more information.
Best regards,
Henning