From 19429129f143c9817517f1dbb045d876f4c2d17e Mon Sep 17 00:00:00 2001 From: Hydrus Date: Wed, 20 Jan 2016 18:04:18 -0600 Subject: [PATCH] v191 Putting db txt files in --- .gitignore | 3 - db/help my db is broke.txt | 62 +++++++++++++++++++ db/how to see inside the db.txt | 8 +++ ... full' error, but I have lots of space.txt | 3 + db/to permanently disable wal.txt | 3 + 5 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 db/help my db is broke.txt create mode 100644 db/how to see inside the db.txt create mode 100644 db/i got a 'database or disk is full' error, but I have lots of space.txt create mode 100644 db/to permanently disable wal.txt diff --git a/.gitignore b/.gitignore index 528b377e..c717e9b6 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/db/help my db is broke.txt b/db/help my db is broke.txt new file mode 100644 index 00000000..2e55384a --- /dev/null +++ b/db/help my db is broke.txt @@ -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. \ No newline at end of file diff --git a/db/how to see inside the db.txt b/db/how to see inside the db.txt new file mode 100644 index 00000000..562eaf9c --- /dev/null +++ b/db/how to see inside the db.txt @@ -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! \ No newline at end of file diff --git a/db/i got a 'database or disk is full' error, but I have lots of space.txt b/db/i got a 'database or disk is full' error, but I have lots of space.txt new file mode 100644 index 00000000..b3c5117f --- /dev/null +++ b/db/i got a 'database or disk is full' error, but I have lots of space.txt @@ -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. \ No newline at end of file diff --git a/db/to permanently disable wal.txt b/db/to permanently disable wal.txt new file mode 100644 index 00000000..7e184f18 --- /dev/null +++ b/db/to permanently disable wal.txt @@ -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. \ No newline at end of file