<HTML>
<HEAD>
<TITLE>Re: [Freeswitch-users] sqldb and GREAT SCOTT! errors</TITLE>
</HEAD>
<BODY>
<FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>Why not just mount the freeswitch/db directory as tmp fs<BR>
<BR>
# mount –t tmpfs tmpfs /usr/local/freeswitch/db <BR>
You can also put this in your fstab to make it persistant... The only thing you have to watch out for doing this is the location of your voicemail.db file as you’ll want that to persist over reboots... Everything else in there is fine to lose across reboots<BR>
<BR>
<BR>
On 10/22/14 11:27 AM, "Anthony Minessale" <<a href="anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>I tried to do the same to see what happens and it works for me.<BR>
<BR>
what does ls -ld /run/shm say?<BR>
<BR>
for me it's <BR>
drwxrwxrwt 2 root root 180 Oct 22 11:23 /run/shm<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
On Tue, Oct 21, 2014 at 6:29 PM, Guillermo Ruiz Camauer <<a href="grcamauer@gmail.com">grcamauer@gmail.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>OK, so when I run with -nosql or with <param name="core-db-name" value="/usr/local/freeswitch/db/core.db" /><BR>
I don't get errors. As soon as I run with <param name="core-db-name" value="/dev/shm/core.db" /> I get the errors again.<BR>
<BR>
root@FS2:~# ls -la /dev/shm<BR>
lrwxrwxrwx 1 root root 8 Oct 21 20:02 /dev/shm -> /run/shm<BR>
<BR>
and I can freely copy files to and from /dev/shm.<BR>
<BR>
FS is running as a service with user freeswitch/daemon or starting it by hand as root. Either way produces the same error.<BR>
<FONT COLOR="#888888"><BR>
Guillermo<BR>
<BR>
</FONT><BR>
On Tue, Oct 21, 2014 at 7:55 PM, Anthony Minessale <<a href="anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>I already provided a suggestion.<BR>
<BR>
On Tue, Oct 21, 2014 at 5:47 PM, Guillermo Ruiz Camauer <<a href="grcamauer@gmail.com">grcamauer@gmail.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>If I run FS with -nosql I don't get any errors. What exaclty do I miss out on by doing this?<BR>
<BR>
Guillermo<BR>
<BR>
On Tue, Oct 21, 2014 at 7:46 PM, Guillermo Ruiz Camauer <<a href="grcamauer@gmail.com">grcamauer@gmail.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>All I did was:<BR>
<param name="core-db-name" value="/dev/shm/core.db" /><BR>
I manually copied something to /deb/shm and no problem.<BR>
Any thoughts?<BR>
<FONT COLOR="#888888"><BR>
Guillermo<BR>
<BR>
<BR>
</FONT><BR>
On Tue, Oct 21, 2014 at 7:18 PM, Anthony Minessale <<a href="anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>Maybe start over and use the real dir for db and trace your steps to moving it to memdisk.<BR>
Maybe the memdisk is mounted read only.<BR>
<BR>
<BR>
On Tue, Oct 21, 2014 at 5:12 PM, Guillermo Ruiz Camauer <<a href="grcamauer@gmail.com">grcamauer@gmail.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>I forgot to mention that I stopped FS, deleted core.db and started FS again, but the same errors result.<BR>
<BR>
Guillermo<BR>
<BR>
On Tue, Oct 21, 2014 at 6:58 PM, Anthony Minessale <<a href="anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>> wrote:<BR>
</SPAN></FONT></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>You might want to move them all out of the way and see if it creates new ones that work or open them with sqlite3 util to ensure they work.<BR>
<BR>
<BR>
On Tue, Oct 21, 2014 at 4:43 PM, Guillermo Ruiz Camauer <<a href="grcamauer@gmail.com">grcamauer@gmail.com</a>> wrote:<BR>
I am getting these errors in my FS log:<BR>
<BR>
2014-10-21 18:15:29.297837 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [attempt to write a readonly database]<BR>
delete from sip_registrations where sub_host is null and hostname='FS2' and network_ip like '%' and network_port like '%' and sip_username like '%' and mwi_user like '%' and mwi_host like '%' and orig_server_host like '%' and orig_hostname like '%';delete from sip_registrations where sub_host is null and hostname='FS2' and network_ip like '%' and network_port like '%' and sip_username like '%' and mwi_user like '%' and mwi_host like '%' and orig_server_host like '%' and orig_hostname like '%'<BR>
2014-10-21 18:15:29.297859 [CRIT] sofia_glue.c:2216 GREAT SCOTT!!! Cannot execute batched statements! [attempt to write a readonly database]<BR>
If you are using mysql, make sure you are using MYODBC 3.51.18 or higher and enable FLAG_MULTI_STATEMENTS<BR>
2014-10-21 18:15:29.297876 [CRIT] sofia.c:2750 Cannot Open SQL Database [crossfonetrunk]!<BR>
2014-10-21 18:15:29.301425 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [attempt to write a readonly database]<BR>
delete from sip_registrations where sub_host is null and hostname='FS2' and network_ip like '%' and network_port like '%' and sip_username like '%' and mwi_user like '%' and mwi_host like '%' and orig_server_host like '%' and orig_hostname like '%';delete from sip_registrations where sub_host is null and hostname='FS2' and network_ip like '%' and network_port like '%' and sip_username like '%' and mwi_user like '%' and mwi_host like '%' and orig_server_host like '%' and orig_hostname like '%'<BR>
2014-10-21 18:15:29.301449 [CRIT] sofia_glue.c:2216 GREAT SCOTT!!! Cannot execute batched statements! [attempt to write a readonly database]<BR>
If you are using mysql, make sure you are using MYODBC 3.51.18 or higher and enable FLAG_MULTI_STATEMENTS<BR>
2014-10-21 18:15:29.301465 [CRIT] sofia.c:2750 Cannot Open SQL Database [external]!<BR>
2014-10-21 18:15:29.302165 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [attempt to write a readonly database]<BR>
delete from sip_registrations where sub_host is null and hostname='FS2' and network_ip like '%' and network_port like '%' and sip_username like '%' and mwi_user like '%' and mwi_host like '%' and orig_server_host like '%' and orig_hostname like '%';delete from sip_registrations where sub_host is null and hostname='FS2' and network_ip like '%' and network_port like '%' and sip_username like '%' and mwi_user like '%' and mwi_host like '%' and orig_server_host like '%' and orig_hostname like '%'<BR>
2014-10-21 18:15:29.302190 [CRIT] sofia_glue.c:2216 GREAT SCOTT!!! Cannot execute batched statements! [attempt to write a readonly database]<BR>
If you are using mysql, make sure you are using MYODBC 3.51.18 or higher and enable FLAG_MULTI_STATEMENTS<BR>
2014-10-21 18:15:29.302202 [CRIT] sofia.c:2750 Cannot Open SQL Database [internal]!<BR>
2014-10-21 18:15:29.308285 [ERR] sofia.c:3292 Ignoring invalid name ''<BR>
2014-10-21 18:15:30.799151 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [attempt to write a readonly database]<BR>
delete from limit_data where hostname='FS2';<BR>
2014-10-21 18:15:31.306387 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [attempt to write a readonly database]<BR>
update fifo_outbound set start_time=0,stop_time=0,ring_count=0,use_count=0,outbound_call_count=0,outbound_fail_count=0 where static=0<BR>
2014-10-21 18:15:31.306466 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [attempt to write a readonly database]<BR>
delete from fifo_outbound where static=1 and hostname='FS2'<BR>
<BR>
<BR>
My core.db file is in a ramdisk (/dev/~shm) and has all the right permissions. I did a 'make clean modwipe' followed by a 'make current' and I still get the same errors. I am on STABLE.<BR>
<BR>
How can I get my FS working again?<BR>
<BR>
-- <BR>
Ken<BR>
<FONT COLOR="#0000FF"><U><a href="http://www.FreeSWITCH.org">http://www.FreeSWITCH.org</a><BR>
<a href="http://www.ClueCon.com">http://www.ClueCon.com</a><BR>
<a href="http://www.OSTAG.org">http://www.OSTAG.org</a><BR>
</U></FONT>irc.freenode.net #freeswitch<BR>
Twitter: @FreeSWITCH<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>