[SR-Users] DB_Cassandra + UserBlacklist = ERROR
SamyGo
govoiper at gmail.com
Thu May 12 18:17:49 CEST 2016
Hi List,
I'm trying to hook up userblacklist module with db_cassandra. I've kamailio
keyspace configured with tables for userblacklist , globalblacklist, and
version are created with some data in there.
Here is setup info:
version: kamailio 4.4.1
*kamailio.cfg*
...
loadmodule "db_cassandra.so"
modparam("db_cassandra", "schema_path","/etc/kamailio/kamailio")
loadmodule "userblacklist.so"
modparam("userblacklist", "db_url", "cassandra://:@127.0.0.1:9160/kamailio")
modparam("userblacklist", "userblacklist_table", "userblacklist")
modparam("userblacklist", "globalblacklist_table", "globalblacklist")
*SCHEMA PATH:*
root at whit-list:/etc/kamailio/kamailio# ls
userblacklist version
root at whit-list:/etc/kamailio/kamailio# cat version/version
table_name(string) table_version(int)
table_name
root at whit-list:/etc/kamailio/kamailio# cat userblacklist/userblacklist
id(int) username(string) domain(string) prefix(string) whitelist(int)
id username
*CASSANDRA DB*
root at whit-list:/etc/kamailio/kamailio# cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.5 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh> use kamailio
... ;
cqlsh:kamailio> describe tables;
globalblacklist version userblacklist
cqlsh:kamailio> select * from version;
table_name | table_version
-----------------+---------------
uacreg | 2
version | 1
globalblacklist | 1
userblacklist | 1
(4 rows)
Every time I start up Kamailio I see the following debug logs:
0(13877) DEBUG: db_cassandra [dbcassa_table.c:572]:
dbcassa_read_table_schemas(): Full name= /etc/kamailio/kamailio/
0(13877) DEBUG: db_cassandra [dbcassa_table.c:589]:
dbcassa_read_table_schemas(): Full dir name= /etc/kamailio/kamailio/version
0(13877) DEBUG: db_cassandra [dbcassa_table.c:609]:
dbcassa_read_table_schemas(): Found database version
0(13877) DEBUG: db_cassandra [dbcassa_table.c:620]:
dbcassa_read_table_schemas(): database table version
0(13877) DEBUG: db_cassandra [dbcassa_table.c:630]:
dbcassa_read_table_schemas(): File path=
/etc/kamailio/kamailio/version/version
0(13877) DEBUG: db_cassandra [dbcassa_table.c:200]: dbcassa_load_file():
loading file [/etc/kamailio/kamailio/version/version]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:122]: dbcassa_table_new():
mtime is 1463068672
0(13877) DEBUG: db_cassandra [dbcassa_table.c:240]: dbcassa_load_file():
new col [table_name]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:253]: dbcassa_load_file():
column[0] is STR!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:283]: dbcassa_load_file():
column[0] is actually STRING!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:240]: dbcassa_load_file():
new col [table_version]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:253]: dbcassa_load_file():
column[1] is STR!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:283]: dbcassa_load_file():
column[1] is actually STRING!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:350]: dbcassa_load_file():
col [table_name] in primary key
0(13877) DEBUG: db_cassandra [dbcassa_table.c:589]:
dbcassa_read_table_schemas(): Full dir name=
/etc/kamailio/kamailio/userblacklist
0(13877) DEBUG: db_cassandra [dbcassa_table.c:609]:
dbcassa_read_table_schemas(): Found database userblacklist
0(13877) DEBUG: db_cassandra [dbcassa_table.c:620]:
dbcassa_read_table_schemas(): database table userblacklist
0(13877) DEBUG: db_cassandra [dbcassa_table.c:630]:
dbcassa_read_table_schemas(): File path=
/etc/kamailio/kamailio/userblacklist/userblacklist
0(13877) DEBUG: db_cassandra [dbcassa_table.c:200]: dbcassa_load_file():
loading file [/etc/kamailio/kamailio/userblacklist/userblacklist]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:122]: dbcassa_table_new():
mtime is 1462985556
0(13877) DEBUG: db_cassandra [dbcassa_table.c:240]: dbcassa_load_file():
new col [id]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:258]: dbcassa_load_file():
column[0] is INT!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:240]: dbcassa_load_file():
new col [username]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:253]: dbcassa_load_file():
column[1] is STR!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:283]: dbcassa_load_file():
column[1] is actually STRING!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:240]: dbcassa_load_file():
new col [domain]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:253]: dbcassa_load_file():
column[2] is STR!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:283]: dbcassa_load_file():
column[2] is actually STRING!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:240]: dbcassa_load_file():
new col [prefix]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:253]: dbcassa_load_file():
column[3] is STR!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:283]: dbcassa_load_file():
column[3] is actually STRING!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:240]: dbcassa_load_file():
new col [whitelist]
0(13877) DEBUG: db_cassandra [dbcassa_table.c:258]: dbcassa_load_file():
column[4] is INT!
0(13877) DEBUG: db_cassandra [dbcassa_table.c:350]: dbcassa_load_file():
col [id] in primary key
0(13877) DEBUG: db_cassandra [dbcassa_table.c:350]: dbcassa_load_file():
col [username] in primary key
.....
0(12780) DEBUG: db_cassandra [dbcassa_base.cpp:149]:
db_cassa_new_connection(): opening connection: cassa://
xxxx:xxxx at 127.0.0.1:9160/kamailio
0(12780) DEBUG: <core> [mem/f_malloc.c:439]: fm_malloc():
fm_malloc(0x7f4e36140010, 48) called from db_cassandra: dbcassa_base.cpp:
db_cassa_new_connection(155)
0(12780) DEBUG: <core> [mem/f_malloc.c:514]: fm_malloc():
fm_malloc(0x7f4e36140010, 48) returns address 0x7f4e361bb5f0
0(12780) DEBUG: db_cassandra [dbcassa_base.cpp:161]:
db_cassa_new_connection(): 0x7f4e361bb5f0=pkg_malloc(48)
0(12780) DEBUG: db_cassandra [dbcassa_base.cpp:117]: dbcassa_open():
Opened connection to Cassandra cluster 127.0.0.1:9160
0(12780) DEBUG: db_cassandra [dbcassa_base.cpp:955]: db_cassa_query(): query
table=version
0(12780) ERROR: db_cassandra [dbcassa_base.cpp:449]: *cassa_translate_query():
table version does not exist!*
0(12780) ERROR: db_cassandra [dbcassa_base.cpp:962]: db_cassa_query(): Failed
to query Cassandra cluster
0(12780) ERROR: <core> [db.c:397]: db_table_version(): error in db_query
0(12780) ERROR: <core> [db.c:436]: db_check_table_version(): querying
version for table userblacklist
0(12780) ERROR: userblacklist [db_userblacklist.c:86]:
userblacklist_db_init(): during table version check.
0(12780) DEBUG: <core> [db_pool.c:100]: pool_remove(): removing connection
from the pool
0(12780) DEBUG: <core> [mem/f_malloc.c:575]: fm_free():
fm_free(0x7f4e36140010, 0x7f4e361bb5f0), called from db_cassandra:
dbcassa_base.cpp: db_cassa_free_connection(203)
0(12780) DEBUG: <core> [mem/f_malloc.c:594]: fm_free(): fm_free: freeing
block alloc'ed from db_cassandra: dbcassa_base.cpp:
db_cassa_new_connection(155)
0(12780) DEBUG: <core> [mem/f_malloc.c:575]: fm_free():
fm_free(0x7f4e36140010, 0x7f4e361bb318), called from core: db.c:
db_do_close(356)
0(12780) DEBUG: <core> [mem/f_malloc.c:594]: fm_free(): fm_free: freeing
block alloc'ed from core: db.c: db_do_init2(298)
0(12780) ERROR: <core> [sr_module.c:968]: init_mod(): Error while
initializing module userblacklist
(/usr/local/lib64/kamailio/modules/userblacklist.so)
ERROR: error while initializing modules
Any help would be highly appreciated.
Regards,
Sammy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160512/15dfc899/attachment.html>
More information about the sr-users
mailing list