Borg suddenly fails to start
Closed this issue · 4 comments
Borg Calendar is set as a start up program on my PC and has been running smoothly for years. Just now, shortly after starting I got this error message:
"org.h2.jdbc.JdbcSQLException: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197]
Your database dir is set to:jdbc:h2:file:/home/doug/.borg_db/borgdb;USER=sa
If a bad database dir is causing the error, please click OK to change it."
What do I do? I don't know where to begin.
Your database file has been corrupted. Usual causes are running out of disk space, improper machine shutdown due to power failure or crash, disk drive failure, running the database on an NFS shared drive.
Your options are to either try to run the H2 recover tool and see what is restored, restore from your latest BORG backup, or restore a good copy of the .borg_db folder if you are backup up your disk.
To restore from either type of backup, first move the database folder to somewhere safe - i.e. mv /home/doug/.borg_db /home/doug/borg_save.
To restore from a disk backup (if you have one), just restore the .borg_db folder from your backup.
To restore from a BORG backup (a backup zip file created by BORG), start BORG, which creates a new, empty db. then use the Import option in BORG to import your latest backup zip file.
I'll continue in a new post....
To attempt using the H2 recover tool you have to run a java program. I'm on windows now. For the actual command lines on Linux, I'd have to switch over to Linux.
In general, you run a program that tries to extract whatever it can from the borgdb.mv.db file into an SQL file. Then you run a second program to recreate the db file from the SQL file. This may be able to recover the entire DB or maybe nothing. It depends what the failure was.
If you need me to get on linux to get the actual commands, let me know. You'd have to have Java installed on your linux machine.
Good to hear.