[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread Henning Westerholt
Great, thanks for reporting back to the list.

Regarding the other problem, maybe list them again quickly in another e-mail, 
or summarize them in the old thread.

Cheers,

Henning

-- 
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com

> -Original Message-
> From: b...@ednt.de 
> Sent: Dienstag, 18. Juli 2023 15:19
> To: sr-users@lists.kamailio.org
> Subject: [SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1
> 
> Ok,
> 
> the write bug is fixed:
> 
> it is not enough tat the file is writable for sqlite.
> Also the directory needs write rights for the user.
> 
> So I did:
> 
> chgrp kamailio /etc/kamailio
> chmod 775 /etc/kamailio
> 
> So ... one step further, but not reached the target.
> 
> Bernd
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send
> an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread bkk
A short tip to show the sqlite table at cmd:

sudo -u kamailio sqlite3 htable.sqlite -cmd "select * from userpush;" .quit

I added also the expires field and enabled it with modparams.
So I can save now the htables manually.
And they are reloaded at start.

But that's not the goal:

Store the values automatically at shutdown.

Bernd
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread bkk
Ok,

the write bug is fixed:

it is not enough tat the file is writable for sqlite.
Also the directory needs write rights for the user.

So I did:

chgrp kamailio /etc/kamailio
chmod 775 /etc/kamailio

So ... one step further, but not reached the target.

Bernd
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread bkk
It is strange:

root@x:/etc/kamailio# ls -al htable.sqlite 
-rw-rw-rw- 1 kamailio root 16384 Jul 18 13:28 htable.sqlite

root@x:/etc/kamailio# sudo -u kamailio sqlite3 htable.sqlite 
SQLite version 3.40.1 2022-12-28 14:03:47
Enter ".help" for usage hints.
sqlite> .table
account   callpush  userpush
sqlite> insert into userpush ('key_name') values ('test');
Runtime error: attempt to write a readonly database (8)

I try to solve this.
The file was created with dbeaver on macOS. I will do it now directly in 
sqlite3 on the debian system.

But still: my main problem is not solved (the store at shutdown is never 
reached, else I would also see the messages)
And kamcmd with htable.store returns a wrong success

Best regards,

Bernd
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread Ovidiu Sas
Try to change the ownership of the SQLite file and match it to the user
running kamailio.

On Tue, Jul 18, 2023 at 14:45 Bernd Krüger Knauber  wrote:

> Hi,
>
> it is not a problem of the sqlite file:
>
> sqlite> .schema userpush
> CREATE TABLE userpush (
> key_name TEXT,
> "key_type" INTEGER,
> value_type INTEGER,
> key_value TEXT
> );
> sqlite> insert into userpush ('key_name') values ('test');
> sqlite> select * from userpush;
> test|||
> sqlite>
>
> And the file itself has 666 as rights, so everyone is allowed to write to
> it. (at the moment)
>
>
> --
> *Von: *"Henning Westerholt" 
> *An: *"Kamailio" 
> *CC: *"Bernd Krueger-Knauber" 
> *Gesendet: *Dienstag, 18. Juli 2023 11:30:43
> *Betreff: *RE: [SR-Users] Kamailio 5.6.4 and htable dbmode=1
>
> Hello,
>
>
>
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
> ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize
> failed: attempt to write a readonly database
> ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db
> records in [userpush]
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
>
> This looks that the error is not on the Kamailio side, but your database
> is somehow not working correctly.
>
>
>
> Have you tried to open the database with the sqlite command line shell and
> execute an INSERT or similar? If it also fails, there must be something
> wrong on the DB side.
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* Bernd Krueger-Knauber 
> *Sent:* Montag, 17. Juli 2023 12:42
> *To:* sr-users@lists.kamailio.org
> *Subject:* [SR-Users] Kamailio 5.6.4 and htable dbmode=1
>
>
>
> Hi Daniel,
>
> thank you for your response.
> As you can see in the provided debug output:
>
>
> kamailio[]: DEBUG: htable [ht_api.c:1046]: ht_table_spec(): htable
>
> [callpush] - dbmode [1]
>
> kamailio[]: DEBUG: htable [ht_api.c:1027]: ht_table_spec(): htable
>
> [callpush] - dbtable [userpush]
>
> kamailio[]: DEBUG: htable [ht_api.c:1036]: ht_table_spec(): htable
>
> [callpush] - expire [86400]
>
> kamailio[]: DEBUG: htable [ht_api.c:1041]: ht_table_spec(): htable
>
> [callpush] - size [10]
>
>
>
> dbmode is set to 1 in the config:
>
>
>
> modparam("htable", "db_url", "sqlite:etc/kamailio/htable.sqlite")
>
> ...
>
> modparam("htable", "htable", 
> "userpush=>size=3;autoexpire=600;dbtable=userpush;dbmode=1")
>
>
>
>
>
> If I execute
>
> kamcmd htable.store userpush
>
> I get
> Ok. Htable successfully stored to DB.
>
> But the table is still empty!!!
>
> In the log I found:
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
> ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize
> failed: attempt to write a readonly database
> ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db
> records in [userpush]
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
>
> Ok.
> But I can not see this entries if I shutdown kamailio.
>
> And:
> -rw-rw-rw-  1 kamailio root 16384 Jul 13 16:14 htable.sqlite
>
>
> I never used:
>
> modparam("db_sqlite","db_set_readonly" ...
>
>
> I also restarted kamailio. no difference.
>
> Now more errors then before:
> It is not written at shutdown. (no messages)
> It is not written (live) (with error messages, but why it is readonly?)
> The message of kamcmd is wrong (says Ok but it failed)
>
> Best regards,
>
> Bernd
>
>
>
> Am 17.07.2023 um 08:48 schrieb Daniel-Constantin Mierla:
>
> Hello,
>
>
>
> is dbmode=1 in htable definition?
>
>
>
> If you run rpc command htable.store for the htable, are the records
>
> saved to database?
>
>
>
> Cheers,
>
> Daniel
>
>
>
> On 13.07.23 17:45, Bernd Krueger-Knauber wrote:
>
> Hi,
>
>
>
> I just tried to use sqlite and htable to load and save the values.
>
> At start I can see in the log, that all parameters are correct and
>
> that htable want to load the values from the table.
>
> No errors.
>
>
>
> But if I stop kamailio, nothing is wr

[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread David Villasmil
This can’t be more clear:

ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
attempt to write a readonly database

Kamailio can’t write to it.

On Tue, 18 Jul 2023 at 13:55, Bernd Krüger Knauber  wrote:

> Hi,
>
> it is not a problem of the sqlite file:
>
> sqlite> .schema userpush
> CREATE TABLE userpush (
> key_name TEXT,
> "key_type" INTEGER,
> value_type INTEGER,
> key_value TEXT
> );
> sqlite> insert into userpush ('key_name') values ('test');
> sqlite> select * from userpush;
> test|||
> sqlite>
>
> And the file itself has 666 as rights, so everyone is allowed to write to
> it. (at the moment)
>
>
> --
> *Von: *"Henning Westerholt" 
> *An: *"Kamailio" 
> *CC: *"Bernd Krueger-Knauber" 
> *Gesendet: *Dienstag, 18. Juli 2023 11:30:43
> *Betreff: *RE: [SR-Users] Kamailio 5.6.4 and htable dbmode=1
>
> Hello,
>
>
>
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
> ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize
> failed: attempt to write a readonly database
> ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db
> records in [userpush]
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
>
> This looks that the error is not on the Kamailio side, but your database
> is somehow not working correctly.
>
>
>
> Have you tried to open the database with the sqlite command line shell and
> execute an INSERT or similar? If it also fails, there must be something
> wrong on the DB side.
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* Bernd Krueger-Knauber 
> *Sent:* Montag, 17. Juli 2023 12:42
> *To:* sr-users@lists.kamailio.org
> *Subject:* [SR-Users] Kamailio 5.6.4 and htable dbmode=1
>
>
>
> Hi Daniel,
>
> thank you for your response.
> As you can see in the provided debug output:
>
>
> kamailio[]: DEBUG: htable [ht_api.c:1046]: ht_table_spec(): htable
>
> [callpush] - dbmode [1]
>
> kamailio[]: DEBUG: htable [ht_api.c:1027]: ht_table_spec(): htable
>
> [callpush] - dbtable [userpush]
>
> kamailio[]: DEBUG: htable [ht_api.c:1036]: ht_table_spec(): htable
>
> [callpush] - expire [86400]
>
> kamailio[]: DEBUG: htable [ht_api.c:1041]: ht_table_spec(): htable
>
> [callpush] - size [10]
>
>
>
> dbmode is set to 1 in the config:
>
>
>
> modparam("htable", "db_url", "sqlite:etc/kamailio/htable.sqlite")
>
> ...
>
> modparam("htable", "htable", 
> "userpush=>size=3;autoexpire=600;dbtable=userpush;dbmode=1")
>
>
>
>
>
> If I execute
>
> kamcmd htable.store userpush
>
> I get
> Ok. Htable successfully stored to DB.
>
> But the table is still empty!!!
>
> In the log I found:
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
> ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize
> failed: attempt to write a readonly database
> ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db
> records in [userpush]
> ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed:
> attempt to write a readonly database
>
> Ok.
> But I can not see this entries if I shutdown kamailio.
>
> And:
> -rw-rw-rw-  1 kamailio root 16384 Jul 13 16:14 htable.sqlite
>
>
> I never used:
>
> modparam("db_sqlite","db_set_readonly" ...
>
>
> I also restarted kamailio. no difference.
>
> Now more errors then before:
> It is not written at shutdown. (no messages)
> It is not written (live) (with error messages, but why it is readonly?)
> The message of kamcmd is wrong (says Ok but it failed)
>
> Best regards,
>
> Bernd
>
>
>
> Am 17.07.2023 um 08:48 schrieb Daniel-Constantin Mierla:
>
> Hello,
>
>
>
> is dbmode=1 in htable definition?
>
>
>
> If you run rpc command htable.store for the htable, are the records
>
> saved to database?
>
>
>
> Cheers,
>
> Daniel
>
>
>
> On 13.07.23 17:45, Bernd Krueger-Knauber wrote:
>
> Hi,
>
>
>
> I just tried to use sqlite and htable to load and save the values.
>
> At start I can see in the log, that all parameters are correct and
>
> that htable want to load the values from the tabl

[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread Bernd Krüger Knauber
Hi, 

it is not a problem of the sqlite file: 

sqlite> .schema userpush 
CREATE TABLE userpush ( 
key_name TEXT, 
"key_type" INTEGER, 
value_type INTEGER, 
key_value TEXT 
); 
sqlite> insert into userpush ('key_name') values ('test'); 
sqlite> select * from userpush; 
test||| 
sqlite> 

And the file itself has 666 as rights, so everyone is allowed to write to it. 
(at the moment) 



Von: "Henning Westerholt"  
An: "Kamailio"  
CC: "Bernd Krueger-Knauber"  
Gesendet: Dienstag, 18. Juli 2023 11:30:43 
Betreff: RE: [SR-Users] Kamailio 5.6.4 and htable dbmode=1 



Hello, 



ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database 
ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize failed: 
attempt to write a readonly database 
ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db 
records in [userpush] 
ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database 



This looks that the error is not on the Kamailio side, but your database is 
somehow not working correctly. 



Have you tried to open the database with the sqlite command line shell and 
execute an INSERT or similar? If it also fails, there must be something wrong 
on the DB side. 



Cheers, 



Henning 




-- 

Henning Westerholt – [ https://skalatan.de/blog/ | https://skalatan.de/blog/ ] 

Kamailio services – [ https://gilawa.com/ | https://gilawa.com ] 





From: Bernd Krueger-Knauber  
Sent: Montag, 17. Juli 2023 12:42 
To: sr-users@lists.kamailio.org 
Subject: [SR-Users] Kamailio 5.6.4 and htable dbmode=1 





Hi Daniel, 

thank you for your response. 
As you can see in the provided debug output: 


kamailio[]: DEBUG: htable [ht_api.c:1046]: ht_table_spec(): htable 
[callpush] - dbmode [1] 
kamailio[]: DEBUG: htable [ht_api.c:1027]: ht_table_spec(): htable 
[callpush] - dbtable [userpush] 
kamailio[]: DEBUG: htable [ht_api.c:1036]: ht_table_spec(): htable 
[callpush] - expire [86400] 
kamailio[]: DEBUG: htable [ht_api.c:1041]: ht_table_spec(): htable 
[callpush] - size [10] 
dbmode is set to 1 in the config: 
modparam("htable", "db_url", "sqlite:etc/kamailio/htable.sqlite") 
... 
modparam("htable", "htable", 
"userpush=>size=3;autoexpire=600;dbtable=userpush;dbmode=1") 
If I execute 


kamcmd htable.store userpush 

I get 
Ok. Htable successfully stored to DB. 

But the table is still empty!!! 

In the log I found: 
ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database 
ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize failed: 
attempt to write a readonly database 
ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db 
records in [userpush] 
ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database 

Ok. 
But I can not see this entries if I shutdown kamailio. 

And: 
-rw-rw-rw- 1 kamailio root 16384 Jul 13 16:14 htable.sqlite 


I never used: 
modparam("db_sqlite","db_set_readonly" ... 



I also restarted kamailio. no difference. 

Now more errors then before: 
It is not written at shutdown. (no messages) 
It is not written (live) (with error messages, but why it is readonly?) 
The message of kamcmd is wrong (says Ok but it failed) 

Best regards, 

Bernd 



Am 17.07.2023 um 08:48 schrieb Daniel-Constantin Mierla: 



Hello, 
is dbmode=1 in htable definition? 
If you run rpc command htable.store for the htable, are the records 
saved to database? 
Cheers, 
Daniel 
On 13.07.23 17:45, Bernd Krueger-Knauber wrote: 

BQ_BEGIN

Hi, 
I just tried to use sqlite and htable to load and save the values. 
At start I can see in the log, that all parameters are correct and 
that htable want to load the values from the table. 
No errors. 
But if I stop kamailio, nothing is written to the tables. 
At start I can see: 
kamailio[]: DEBUG:  [core/modparam.c:112]: 
set_mod_param_regex(): 'htable' matches module 'htable' 
kamailio[]: DEBUG:  [core/sr_module.c:814]: find_param_export(): 
found  in module htable 
[/usr/lib/x86_64-linux-gnu/kamailio/modules/htable.so] 
kamailio[]: DEBUG:  [core/modparam.c:128]: 
set_mod_param_regex(): found  in module htable 
[/usr/lib/x86_64-linux-gnu/kamailio/modules/htable.so] 
kamailio[]: DEBUG: htable [ht_api.c:1046]: ht_table_spec(): htable 
[callpush] - dbmode [1] 
kamailio[]: DEBUG: htable [ht_api.c:1027]: ht_table_spec(): htable 
[callpush] - dbtable [userpush] 
kamailio[]: DEBUG: htable [ht_api.c:1036]: ht_table_spec(): htable 
[callpush] - expire [86400] 
kamailio[]: DEBUG: htable [ht_api.c:1041]: ht_table_spec(): htable 
[callpush] - size [10] 
kamailio[]: DEBUG: htable [ht_api.c:1084]: ht_db_load_tables(): 
loading db table [userpush] in ht [userpush] 
kamailio[]: DEBUG: htable [

[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-18 Thread Henning Westerholt
Hello,

ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database
ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize failed: 
attempt to write a readonly database
ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db 
records in [userpush]
ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database

This looks that the error is not on the Kamailio side, but your database is 
somehow not working correctly.

Have you tried to open the database with the sqlite command line shell and 
execute an INSERT or similar? If it also fails, there must be something wrong 
on the DB side.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Bernd Krueger-Knauber 
Sent: Montag, 17. Juli 2023 12:42
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Kamailio 5.6.4 and htable dbmode=1

Hi Daniel,

thank you for your response.
As you can see in the provided debug output:



kamailio[]: DEBUG: htable [ht_api.c:1046]: ht_table_spec(): htable

[callpush] - dbmode [1]

kamailio[]: DEBUG: htable [ht_api.c:1027]: ht_table_spec(): htable

[callpush] - dbtable [userpush]

kamailio[]: DEBUG: htable [ht_api.c:1036]: ht_table_spec(): htable

[callpush] - expire [86400]

kamailio[]: DEBUG: htable [ht_api.c:1041]: ht_table_spec(): htable

[callpush] - size [10]



dbmode is set to 1 in the config:



modparam("htable", "db_url", "sqlite:etc/kamailio/htable.sqlite")

...

modparam("htable", "htable", 
"userpush=>size=3;autoexpire=600;dbtable=userpush;dbmode=1")





If I execute
kamcmd htable.store userpush

I get
Ok. Htable successfully stored to DB.

But the table is still empty!!!

In the log I found:
ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database
ERROR: db_sqlite [dbase.c:177]: db_sqlite_cleanup_query(): finalize failed: 
attempt to write a readonly database
ERROR: htable [ht_db.c:668]: ht_db_delete_records(): failed to delete db 
records in [userpush]
ERROR: db_sqlite [dbase.c:528]: db_sqlite_commit(): sqlite commit failed: 
attempt to write a readonly database

Ok.
But I can not see this entries if I shutdown kamailio.

And:
-rw-rw-rw-  1 kamailio root 16384 Jul 13 16:14 htable.sqlite


I never used:

modparam("db_sqlite","db_set_readonly" ...

I also restarted kamailio. no difference.

Now more errors then before:
It is not written at shutdown. (no messages)
It is not written (live) (with error messages, but why it is readonly?)
The message of kamcmd is wrong (says Ok but it failed)

Best regards,

Bernd



Am 17.07.2023 um 08:48 schrieb Daniel-Constantin Mierla:

Hello,



is dbmode=1 in htable definition?



If you run rpc command htable.store for the htable, are the records

saved to database?



Cheers,

Daniel



On 13.07.23 17:45, Bernd Krueger-Knauber wrote:

Hi,



I just tried to use sqlite and htable to load and save the values.

At start I can see in the log, that all parameters are correct and

that htable want to load the values from the table.

No errors.



But if I stop kamailio, nothing is written to the tables.



At start I can see:



kamailio[]: DEBUG:  [core/modparam.c:112]:

set_mod_param_regex(): 'htable' matches module 'htable'

kamailio[]: DEBUG:  [core/sr_module.c:814]: find_param_export():

found  in module htable

[/usr/lib/x86_64-linux-gnu/kamailio/modules/htable.so]

kamailio[]: DEBUG:  [core/modparam.c:128]:

set_mod_param_regex(): found  in module htable

[/usr/lib/x86_64-linux-gnu/kamailio/modules/htable.so]

kamailio[]: DEBUG: htable [ht_api.c:1046]: ht_table_spec(): htable

[callpush] - dbmode [1]

kamailio[]: DEBUG: htable [ht_api.c:1027]: ht_table_spec(): htable

[callpush] - dbtable [userpush]

kamailio[]: DEBUG: htable [ht_api.c:1036]: ht_table_spec(): htable

[callpush] - expire [86400]

kamailio[]: DEBUG: htable [ht_api.c:1041]: ht_table_spec(): htable

[callpush] - size [10]







kamailio[]: DEBUG: htable [ht_api.c:1084]: ht_db_load_tables():

loading db table [userpush] in ht [userpush]

kamailio[]: DEBUG: htable [ht_db.c:232]: ht_db_load_table():

=== loading hash table [userpush] from database [userpush]

kamailio[]: DEBUG: db_sqlite [dbase.c:223]: db_sqlite_submit_query():

submit_query: select key_name,key_type,value_type,key_value from

userpush  order by key_name

kamailio[]: DEBUG:  [db_query.c:72]: db_do_submit_query():

submitted query: select key_name,key_type,value_type,key_value from

userpush  order by key_name, result 0

kamailio[]: DEBUG:  [db_res.c:119]: db_new_result(): allocate 56

bytes for result set at 0x7f4882107938

kamailio[]: DEBUG:  [db_res.c:79]: db_free_columns(): freeing 0

columns

kamailio[]: DEBUG:  [db_res.c:138]: db_free_result(): freeing

result set at 0x7f4882107938



Ok, the file is empty, but it tries to load the data from the table.



The table 

[SR-Users] Re: Kamailio 5.6.4 and htable dbmode=1

2023-07-17 Thread Daniel-Constantin Mierla
Hello,

is dbmode=1 in htable definition?

If you run rpc command htable.store for the htable, are the records
saved to database?

Cheers,
Daniel

On 13.07.23 17:45, Bernd Krueger-Knauber wrote:
> Hi,
>
> I just tried to use sqlite and htable to load and save the values.
> At start I can see in the log, that all parameters are correct and
> that htable want to load the values from the table.
> No errors.
>
> But if I stop kamailio, nothing is written to the tables.
>
> At start I can see:
>
> kamailio[]: DEBUG:  [core/modparam.c:112]:
> set_mod_param_regex(): 'htable' matches module 'htable'
> kamailio[]: DEBUG:  [core/sr_module.c:814]: find_param_export():
> found  in module htable
> [/usr/lib/x86_64-linux-gnu/kamailio/modules/htable.so]
> kamailio[]: DEBUG:  [core/modparam.c:128]:
> set_mod_param_regex(): found  in module htable
> [/usr/lib/x86_64-linux-gnu/kamailio/modules/htable.so]
> kamailio[]: DEBUG: htable [ht_api.c:1046]: ht_table_spec(): htable
> [callpush] - dbmode [1]
> kamailio[]: DEBUG: htable [ht_api.c:1027]: ht_table_spec(): htable
> [callpush] - dbtable [userpush]
> kamailio[]: DEBUG: htable [ht_api.c:1036]: ht_table_spec(): htable
> [callpush] - expire [86400]
> kamailio[]: DEBUG: htable [ht_api.c:1041]: ht_table_spec(): htable
> [callpush] - size [10]
>
>
>
> kamailio[]: DEBUG: htable [ht_api.c:1084]: ht_db_load_tables():
> loading db table [userpush] in ht [userpush]
> kamailio[]: DEBUG: htable [ht_db.c:232]: ht_db_load_table():
> === loading hash table [userpush] from database [userpush]
> kamailio[]: DEBUG: db_sqlite [dbase.c:223]: db_sqlite_submit_query():
> submit_query: select key_name,key_type,value_type,key_value from
> userpush  order by key_name
> kamailio[]: DEBUG:  [db_query.c:72]: db_do_submit_query():
> submitted query: select key_name,key_type,value_type,key_value from
> userpush  order by key_name, result 0
> kamailio[]: DEBUG:  [db_res.c:119]: db_new_result(): allocate 56
> bytes for result set at 0x7f4882107938
> kamailio[]: DEBUG:  [db_res.c:79]: db_free_columns(): freeing 0
> columns
> kamailio[]: DEBUG:  [db_res.c:138]: db_free_result(): freeing
> result set at 0x7f4882107938
>
> Ok, the file is empty, but it tries to load the data from the table.
>
> The table looks like:
>
> sqlite> .schema userpush
> CREATE TABLE userpush (
>     key_name TEXT,
>     "key_type" INTEGER,
>     value_type INTEGER,
>     key_value TEXT
> );
>
>
> I checked the source code and I saw that destroy() should be called.
> Inside is ht_db_open_con() called before ht_db_sync_tables(), were it
> happens.
> But I can even not see the debug message from ht_db_open_con() :
>
> LM_DBG("database connection opened successfully\n")
> and also not
> LM_ERR("failed to connect to the database\n");
>
> For me it looks like, that the destroy() function is not called.
>
> Even with debug=3, I can only see:
>
>
> systemd[]: Stopping kamailio.service - Kamailio - the Open Source SIP
> Server...
> kamailio[]: INFO:  [main.c:854]: sig_usr(): signal 15 received
> systemd[]: kamailio.service: Deactivated successfully.
> systemd[]: Stopped kamailio.service - Kamailio - the Open Source SIP
> Server.
>
> I stopped kamailio with
>
> systemctl stop kamailio
>
> I'm sure that something was inside the htable before I stoped kamailio:
>
> {
>     entry: 0
>     size: 1
>     slot: {
>     {
>     name:
> 07db580a6c13e798a5acc0d123d6e957897c8650b43f99d6d5cb9c2cb5ba4fa4
>     value:
> 3a28dcb73eb65722df5a261983b7692cecdca482bf8725032e46a0c6b89fb355
>     type: str
>     }
>     }
> }
>
> Any further ideas?
>
> Best regards,
>
> Bernd
>
>
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only
> to the sender!
> Edit mailing list options or unsubscribe:

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - www.kamailioworld.com

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe: