Gateway log: Error executing query against logs database

Hi
Today I ran into this error in gateway log list. It seems internal Sqlite is crash.
The list is full with 260k log entries and log list flashing between empty list and following image every 10 sec.
Is there any way to limit log entries or delete it?
I use v8.0.6.

The details of that error would be helpful; if you can’t get them from the gateway UI you can always go to the wrapper.log on the gateway’s filesystem.

If the logging database is somehow corrupted, you can just delete the system_logs.idb file (it lives right next to the wrapper.log) and restart your gateway.

Hi Paul

Here is one of log file:
https://drive.google.com/file/d/1MAFREf34kK2WDMH1DaTJq9cnKocvEI8r/view?usp=drivesdk


When I delete all of files inLogs folder it will automatically create by system with the same size after each reset.
Is there any way to delete the all old logs file?

INFO   | jvm 1    | 2020/04/08 03:23:36 | Caused by: org.sqlite.SQLiteException: [SQLITE_BUSY]  The database file is locked (database is locked)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.core.DB.newSQLException(DB.java:941)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.core.DB.newSQLException(DB.java:953)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.core.DB.throwex(DB.java:918)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.core.NativeDB.prepare(NativeDB.java:134)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.core.DB.prepare(DB.java:257)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:47)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.jdbc3.JDBC3PreparedStatement.<init>(JDBC3PreparedStatement.java:30)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.jdbc4.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:19)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:35)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:241)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:205)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	at com.inductiveautomation.ignition.gateway.logging.SQLiteAppenderReader.buildPrepStatement(SQLiteAppenderReader.java:109)
INFO   | jvm 1    | 2020/04/08 03:23:36 | 	... 42 common frames omitted

SQLite (most of the time) only allows one connection, because it’s just a DB file and has to maintain locking guarantees. Are you doing anything in scripting that might be interacting with the logging database? Running any other program on your computer that might be connecting to these files?

I’m not sure what ‘system’ means in this case; Ignition, or your actual OS? The OS definitely shouldn’t be recreating these files, although I notice your screenshot is Raspbian or similar; did the log files somehow make it into a disk image or backup that’s being restored? If you shut down the gateway, delete /usr/local/ignition/logs/, and then restart the gateway, you should only get the system_logs.idb and a single wrapper.log file until it rolls over due to the settings in ignition.conf. If you’re getting other behavior (such as the files being recreated without the gateway running), it’s something else on your system.

No not all, I even don’t write any debug information in log file in gateway scripting.
It is a rpi 4.
By system I mean ignition. It recreate the files after each reset with the old data in it.
Does logging system has any purge system to limit the size?
If I shutdown gateway and delete files they recreate by ignition.
The only way I can solve it to uninstall and reinstall gateway.

Any chance you turned on the overlay file system in the raspberry pi config? I’m not super familiar with the exact effects of that setting, but I believe it changes at least some of the SD card to read-only, with changes being held only in RAM. It might explain the log files coming back after a reboot.

2 Likes

There’s zero code in Ignition that would restore old log files. Either they’re not actually getting deleted, or something else about the OS is restoring them. The logging infrastructure around the wrapper.log files isn’t even part of Ignition; it’s part of the Tanuki service wrapper.

You can try changing the logging settings used by adjusting ignition.conf; see this page for reference, but again, I’m very skeptical this has anything to do with Ignition.

1 Like

Not at all.
I install ignition with any changing in my rpi 4 is.
Every things is default.