v191 Putting db txt files in

This commit is contained in:
Hydrus 2016-01-20 18:04:18 -06:00
parent 4e77b5e032
commit 19429129f1
5 changed files with 76 additions and 3 deletions

3
.gitignore vendored
View File

@ -34,8 +34,5 @@ local.properties
*.launch
### Some rules to keep out installation-specific stuff that's generated when Hydrus is run from source
temp/
export/
logs/
crash.log
db/

View File

@ -0,0 +1,62 @@
If you are getting weird but serious-sounding errors like 'database image is malformed', your database may be corrupt!
Nine times out of ten, corrupted databases happen because of hardware failure, usually the hard drive writing bad sectors. This is a serious problem.
first, shut everything down
Close the client immediately.
If you are on Windows, open task manager (Ctrl+Shift+Esc) and wait for client.exe to disappear from the list. If it takes more than a couple of minutes, forcibly close it with task manager.
check integrity
Then check your hard drive's integrity.
On Windows, go Start->Run (Win+R) and type 'cmd'. Type chkdsk into the new window and wait for it to scan your drive.
If you find problems, then your drive has been compromised in some way, and you should view it as unreliable. If it is an old drive, you should think about buying a replacement. The exception to 'buy a new drive' is if the existing one is new, works well, and you can trace the error to a specific event, like you had an unprotected power surge during a storm that violently reset your computer. The other exception is if you cannot afford it. :/
On Windows, tell chkdsk to fix the problems it found by running it again with the /F modifier, like 'chkdsk /F'.
If your hard drive is fine, please send me the details! If it could be my code breaking things, I want to know asap!
now what?
If you have a recent backup of your client, it is probably a good idea just to restore from that. A lot of hard drive errors cannot be recovered from. Just copy your backup client.db on top of your corrupted client.db and you are good to go.
If you do not have a backup, you'll have to try recovering what data you can from the corrupted db.
First of all, make a _new_ backup of the corrupted db, just in case something goes wrong with the recovery and we need to try again. You can just copy the client.db, but having a copy of all your files is a great idea if you have the time and space.
FreeFileSync is great for maintaining regular backups. It only takes a few minutes a week to stay safe.
fix the problem
Then close SQLiteStudio.
Open the SQLite shell, which should be in the db directory, called sqlite3 or sqlite3.exe. Type:
.open client.db
PRAGMA integrity_check;
The integrity check doesn't correct anything, but it lets you know the magnitude of the problem: if only a couple of issues are found, you may be in luck.
If it doesn't look too bad, then go:
.clone client_new.db
And wait a bit. It'll report its progress as it tries to copy your db's info to a new, cleaner db.
.exit
Will close the shell.
If the clone doesn't work, contact me and I'll help you manually extract what you can to a new db.
If the clone does work, rename client.db to client_old.db and client_new.db to client.db. Then, try running the client!
If you still get problems, please contact me. Check help/contact.html for ways to do that.

View File

@ -0,0 +1,8 @@
The databases are sqlite. You can look inside them with many programs. I like to use:
SQLiteStudio from http://sqlitestudio.pl/.
The SQLite command-line shell program from https://www.sqlite.org/download.html.
I include the command-line shell with my normal frozen releases. I used to bundle SQLiteStudio as well, but they rewrote their gui and the program got too large to tuck in.
Feel free to explore how hydrus works, and if you have any questions or comments, don't hesitate to contact me!

View File

@ -0,0 +1,3 @@
If you have plenty of disk space on your hydrus drive but got an 'out of disk space' error, usually during a big job like a vacuum, the problem is probably that you do not have enough space on your system drive.
Sometimes, the db needs to create a journal file in your system temporary folder. Typically, the largest this file can get is about as large as your client.db. So, if you have a 3GB client.db file, make sure you have at least 3GB free on your system drive.

View File

@ -0,0 +1,3 @@
If you do not want to use WAL journalling, you can either use the switch '-no-wal' on either the client or server, or you can just put a file in this directory called 'no-wal'. SQLite will try to use TRUNCATE instead.
This can happen automatically if WAL fails on db creation.