This happens on Lenses 5.x and before when H2 database is used to store the Lenses state. To recover from this corruption follow these steps:
- bash into the machine running Lenses
- stop lenses
supervisorctl stop lenses
-
Download the H2 1.4.200 from Maven and store it to /tmp.
-
Run this command
java -cp /tmp/h2-1.4.200.jar \
org.h2.tools.Recover \
-dir /data/lenses \
-db lensesdb
- The previous command creates some files with the data to restore
java -cp /opt/lenses/lib/h2-1.4.199.jar \
org.h2.tools.RunScript \
-url jdbc:h2:/data/lenses/lenses_new \
-script /data/lenses/lensesdb.h2.sql
- Replace the old file
rm /data/lenses/lenses.mv.db \
mv /data/lenses/lenses_new.mv.db /data/lenses/lensesdb.mv.db
- Restart lenses
supervisorctl start lenses