Started getting loads of SQL Logger errors

Posted on
Sun Sep 08, 2019 2:10 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Started getting loads of SQL Logger errors

this seems to do the trick: stop indigo (server and client) wait x secs; relaunch indigo server then client


put this into an "action group/ server/ execute script"
Code: Select all
import os
#####
# script to stop and relauch indigo w a wait fo 30 seconds... usefull if you have an postgres resync issue.
# replace your userid home dir and indigo V#  min 7.3
# OSX does not offer to print msecs in bash, set to 000 to keep indigo format
#####
indigoV       = "7.3"
logFile       = "/Library/Application Support/Perceptive Automation/Indigo "+ indigoV +"/Logs/indigo_log.txt"
home          = "/users/karlwachs"
waitBfRelaunch  = "30" # seconds

cmd =  "#!/bin/bash\n"
cmd +=  "export HOME="+home+"\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 =========================================='                    >> '"+logFile+"'\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 stop and relaunch indogo after "+ waitBfRelaunch +" seconds '  >> '"+logFile+"'\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    stop indigo app '                              >> '"+logFile+"'\n"
cmd +=  "/usr/bin/osascript -e 'quit app \"Indigo "+indigoV+"\"'                                     >> '"+logFile+"'\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    sleep 1 '                                      >> '"+logFile+"'\n"
cmd += "/bin/sleep 1\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    stop indogo server'                            >> '"+logFile+"'\n"
cmd += "/usr/local/indigo/indigo-stop                                                                >> '"+logFile+"'\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    sleep "+ waitBfRelaunch +"'                    >> '"+logFile+"'\n"
cmd += "/bin/sleep "+ waitBfRelaunch +"\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    start indigo server'                           >> '"+logFile+"'\n"
cmd += "/usr/local/indigo/indigo-start                                                               >> '"+logFile+"'\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    sleep 3'                                       >> '"+logFile+"'\n"
cmd += "/bin/sleep 3\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    start indigo app'                              >> '"+logFile+"'\n"
cmd += "/usr/bin/open '/Applications/Indigo "+indigoV+".app'                                         >> '"+logFile+"'\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ==relaunch==    done'                                          >> '"+logFile+"'\n"
cmd +=  "date '+%Y-%m-%d %H:%M:%S.000 ========================================='                     >> '"+logFile+"'\n"
f=open("/tmp/restartIndigo.sh","w")
f.write(cmd)
f.close()
indigo.server.log("/tmp/restartIndigo.sh &  --> \n"+cmd )
os.system("chmod +x /tmp/restartIndigo.sh")
os.system("/tmp/restartIndigo.sh &")


Karl

Posted on
Sun Sep 08, 2019 2:48 pm
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Started getting loads of SQL Logger errors

jay (support) wrote:
Busta999 wrote:
I am/was running Postgres :-)


Did you try to repair the Postgres db? I think there are tools out there...


No I did not.

All the historical data I am using is in the CSV files crated by MatPlotLib.

Is there anything else I am missing? Because it is just running fine once I created a new one.

Posted on
Thu Oct 17, 2019 4:18 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Started getting loads of SQL Logger errors

Ok

Following an orderly restart of the Mac mini - the SQL DB was corrupted again.

Incrementing the DB name by 1 forced it all to be recreated.

Despite Indigo not reporting any issues when closing down it appears that shutting down Indigo as part of reboot is causing the SQL DB to corrupt.

Next time I reboot (only a few of times a year) I will ensure that Indigo is shutdown before starting a reboot and see if the issue repeats.

This is the second SQL DB corruption I have encountered in a couple of months - both during an orderly reboot.

Who is online

Users browsing this forum: No registered users and 2 guests