09-22-2015, 10:04 PM | #1 |
Addict
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
|
Can't Open Error
A couple of days ago my system crashed. Calibre didn't start normally, so I uninstalled it, deleted the crud it left behind, and then re-installed it.
When I try saving metadata, I get a "CantOpenError:CantOpen Error: Unable to open database file" error message. Code:
calibre, version 2.38.0 ERROR: Unhandled exception: <b>CantOpenError</b>:CantOpenError: unable to open database file calibre 2.38 isfrozen: True is64bit: True Linux-3.13.0-63-generic-x86_64-with-debian-jessie-sid Linux ('64bit', 'ELF') ('Linux', '3.13.0-63-generic', '#103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015') Python 2.7.9 Linux: ('debian', 'jessie/sid', '') Successfully initialized third party plugins: Find Duplicates && MultiColumnSearch && Recipe Reader && Fantastic Fiction && Goodreads && Generate Cover && Medical Reader && all recipes Recipe Reader && FanFicFare && Read MP3 AudioBook metadata && FictionDB && Diaps Editing Toolbag && Reading List && English Noun Frequency && Import List && Author Book Count Hierarchy && View Manager && Copy Cover To Device && Quality Check && Manage Series && Count Pages && Save To Format && food network Recipe Reader && Extract ISBN && User Category && Fantastic Fiction Adults && Resize Cover && Ex Libris && iOS reader applications && APNX Generator && EpubSplit && Clean Metadata && Beam Ebooks && Hymn Reader && Modify ePub && Annotations && Similar Stories && Skoob && Barnes & Noble && Unplugged && SmartEject && Author Book Count && Wiki Reader && KoboBooks && EpubMerge && Anobii Fetcher && BigOven Recipe Reader Traceback (most recent call last): File "site-packages/calibre/gui2/metadata/single.py", line 568, in accept File "site-packages/calibre/gui2/metadata/single.py", line 543, in apply_changes File "site-packages/calibre/gui2/metadata/basic_widgets.py", line 213, in commit File "site-packages/calibre/db/legacy.py", line 817, in func File "site-packages/calibre/db/cache.py", line 57, in call_func_with_lock File "site-packages/calibre/db/cache.py", line 1043, in set_field File "site-packages/calibre/db/write.py", line 513, in set_books File "site-packages/calibre/db/write.py", line 187, in set_title File "site-packages/calibre/db/write.py", line 178, in one_one_in_books File "site-packages/calibre/db/backend.py", line 818, in executemany File "src/cursor.c", line 231, in resetcursor CantOpenError: CantOpenError: unable to open database file This is not a networked drive. Any pointers on what to do fix it? Or is it simpler/faster/easier to simply import into a new library? If the latter, what are the settings so that the data in the existing opf files is used, instead of the data in the ebook files, or the file & directory names? Amber |
09-22-2015, 10:41 PM | #2 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I will assume the DB is present, or we should have had a 'Lost the Library' type message
Check your permissions on the Library folder (rwx) (and all containing files and folders) check your temp folder for permissions |
Advert | |
|
09-24-2015, 05:15 AM | #3 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Worst comes to worst - do a database restore:
Code:
calibredb restore_database --with-library /path/to-library |
09-25-2015, 05:17 PM | #4 |
Addict
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
|
|
09-25-2015, 05:49 PM | #5 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Exact error messages are actually important.
Do you by any chance mean something like this?: Code:
Restoring database failed with error: Traceback (most recent call last): File "/home/eschwartz/git/calibre/src/calibre/db/restore.py", line 125, in run self.replace_db() File "/home/eschwartz/git/calibre/src/calibre/db/restore.py", line 276, in replace_db shutil.copyfile(dbpath, save_path) File "/usr/lib/python2.7/shutil.py", line 82, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: u'/tmp/fake-library/metadata.db' But if the file doesn't exist, then what was the first error message? calibre should never have opened, or should have recreated the database as empty. Last edited by eschwartz; 09-25-2015 at 05:52 PM. |
Advert | |
|
09-25-2015, 06:20 PM | #6 | ||
Addict
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
|
Quote:
Code:
WARNING: Failed to set default libc locale, using en_US.UTF-8 Starting restoring preferences and column metadata ... 0% Cannot restore preferences. Backup file not found. ... 100% Restoring database failed with error: Traceback (most recent call last): File "site-packages/calibre/db/restore.py", line 125, in run File "site-packages/calibre/db/restore.py", line 276, in replace_db File "shutil.py", line 82, in copyfile IOError: [Errno 2] No such file or directory: u'/media/HITACHI/A/hitachi_library/metadata.db' Quote:
Code:
182223872 Sep 17 14:48 metadata.db I'm the owner, user, and permissions are "-rw------- 1" Amber |
||
09-25-2015, 06:35 PM | #7 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Very interesting, no idea why that is happening. I cannot replicate it:
Code:
[eschwartz@arch ~]$ mkdir /tmp/fake-library [eschwartz@arch ~]$ cd /tmp/fake-library [eschwartz@arch /tmp/fake-library]$ touch metadata.db [eschwartz@arch /tmp/fake-library]$ chmod 600 metadata.db [eschwartz@arch /tmp/fake-library]$ calibredb restore_database --with-library ./ --really-do-it Starting restoring preferences and column metadata ... 0% Cannot restore preferences. Backup file not found. ... 100% Restoring database succeeded old database saved as /tmp/aurvote-eschwartz/metadata_pre_restore.db |
09-25-2015, 07:16 PM | #8 |
Addict
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
|
|
09-26-2015, 09:40 PM | #9 | |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Make sure to use the second Add books option:
Quote:
It will import metadata from the metadata.opf |
|
09-27-2015, 03:33 PM | #10 | |
Addict
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
|
Quote:
«Rant Mode On» CCIP/PCIP has a formally defined format that specifies exactly where each space, carriage return, line return, and tab is supposed to be. If the publisher doesn't adhere to it, they will incur the wrath of librarians. Why on Earth are publishers unable to adhere to those specifications in their ebooks. Doing so would make it much easier to automate the cataloging. «Rant Mode Off» Amber |
|
09-27-2015, 03:36 PM | #11 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Make sure the custom column already exists -- then they will be imported.
Add books doesnt create non-existent custom columns in order to preserve the data, but it should link to already-set-up custom columns. |
Tags |
can't open error, linux |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
open with plugin error | french imp | Plugins | 1 | 07-19-2012 05:23 PM |
E-Book Open Error | musesinspire | Calibre | 4 | 05-29-2012 04:32 PM |
ERROR: Could not open ebook: [Error 123] | kappsta | Calibre | 6 | 03-11-2012 02:13 PM |
Trying to Open Calibre and Getting Error Message | Loosheesh | Calibre | 12 | 03-02-2011 10:03 PM |