xatkit-runtime icon indicating copy to clipboard operation
xatkit-runtime copied to clipboard

Analytics.db corruption crashes Xatkit on startup

Open gdaniel opened this issue 5 years ago • 4 comments

Not sure when this happens, in theory the database should be shutdown when the JVM is closed.

Anyway this issue is another reason to move to an external database to store analytics. The data model / database type is yet to be decided.

Console output

[WARN]  13:17:14,608 - Cannot stop the XatkitServer, the server is not started
 Exception in thread "main" org.mapdb.DBException$DataCorruption: Header checksum broken. Store was not closed correctly and might be corrupted. Use `DBMaker.checksumHeaderBypass()` to recover your data. Use clean shutdown or enable transactions to protect the store in the future.
at org.mapdb.StoreDirectAbstract.fileHeaderCheck(StoreDirectAbstract.kt:113)

Reported by @kwisath

gdaniel avatar Aug 16 '19 14:08 gdaniel

I don't think we were able to replicate the problem. And with now having InfluxDB as another alternative, I'd close it for now (at least until the issue reappears and we are able to replicate it)

jcabot avatar Aug 15 '20 10:08 jcabot

Got the error again. It can be fixed by removing the file analytics.db (of course then you lose the data there). It seems the error happens depending on how you stop the bot.

20:30:38.721 [pool-3-thread-1] INFO - Starting intent recognition monitoring 20:30:39.219 [pool-3-thread-1] ERROR - An error occurred when starting the XatkitCore, trying to close started services 20:30:39.219 [pool-3-thread-1] INFO - Stopping XatkitServer 20:30:39.219 [pool-3-thread-1] WARN - Cannot stop the XatkitServer, the server is not started Exception in thread "main" org.mapdb.DBException$DataCorruption: Header checksum broken. Store was not closed correctly and might be corrupted. Use DBMaker.checksumHeaderBypass() to recover your data. Use clean shutdown or enable transactions to protect the store in the future. at org.mapdb.StoreDirectAbstract.fileHeaderCheck(StoreDirectAbstract.kt:113) at org.mapdb.StoreDirect.(StoreDirect.kt:114) at org.mapdb.StoreDirect$Companion.make(StoreDirect.kt:57) at org.mapdb.StoreDirect$Companion.make$default(StoreDirect.kt:56) at org.mapdb.DBMaker$Maker.make(DBMaker.kt:450) at com.xatkit.core.recognition.RecognitionMonitor.(RecognitionMonitor.java:118) at com.xatkit.core.recognition.IntentRecognitionProviderFactory.getRecognitionMonitor(IntentRecognitionProviderFactory.java:128) at com.xatkit.core.recognition.IntentRecognitionProviderFactory.getIntentRecognitionProvider(IntentRecognitionProviderFactory.java:72) at com.xatkit.core.XatkitCore.run(XatkitCore.java:149) at com.xatkit.bot.wordpress.AdminBot.main(AdminBot.java:156)

jcabot avatar Aug 28 '20 18:08 jcabot

You can also tell Xatkit to stop any kind of monitoring with the following line: configuration.addProperty(IntentRecognitionProviderFactoryConfiguration.ENABLE_RECOGNITION_ANALYTICS, false);

gdaniel avatar Oct 28 '20 11:10 gdaniel

I'd just close the issue. Given that we have the influxdb option and the "no monitoring" option (to be added to the wiki page of properties, if not yet there), I'd just close it (or mark it as very low-priority)

jcabot avatar Oct 28 '20 19:10 jcabot