Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-22-2015, 10:04 PM   #1
Fiat_Lux
Addict
Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.
 
Fiat_Lux's Avatar
 
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 windows box.
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
Fiat_Lux is offline   Reply With Quote
Old 09-22-2015, 10:41 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
theducks is offline   Reply With Quote
Advert
Old 09-24-2015, 05:15 AM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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
eschwartz is offline   Reply With Quote
Old 09-25-2015, 05:17 PM   #4
Fiat_Lux
Addict
Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.
 
Fiat_Lux's Avatar
 
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
Quote:
Originally Posted by eschwartz View Post
Code:
calibredb restore_database --with-library /path/to-library
That failed, with a "database not found" error message.

The library permissions are 755.
The temp folder permissions are 700.

Amber
Fiat_Lux is offline   Reply With Quote
Old 09-25-2015, 05:49 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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'
The answer to that is to `touch` the metadata.db first, since the file must exist even if it is completely scribbled over.


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.
eschwartz is offline   Reply With Quote
Advert
Old 09-25-2015, 06:20 PM   #6
Fiat_Lux
Addict
Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.
 
Fiat_Lux's Avatar
 
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
Quote:
Originally Posted by eschwartz View Post
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()
...
Rerunning it, the error message is:
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:
The answer to that is to `touch` the metadata.db first, since the file must exist even if it is completely scribbled over.
Using ls -al *.db , I get:
Code:
182223872 Sep 17 14:48 metadata.db
Leaving out the section with the owner, user, and permissions.
I'm the owner, user, and permissions are "-rw------- 1"

Amber
Fiat_Lux is offline   Reply With Quote
Old 09-25-2015, 06:35 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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
I have no idea why calibre doesn't see your library.
eschwartz is offline   Reply With Quote
Old 09-25-2015, 07:16 PM   #8
Fiat_Lux
Addict
Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.
 
Fiat_Lux's Avatar
 
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
Quote:
Originally Posted by eschwartz View Post
Very interesting, no idea why that is happening.
I'm just going to import everything into a new library.
Hopefully, I won't lose the meta-data.

Amber
Fiat_Lux is offline   Reply With Quote
Old 09-26-2015, 09:40 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
Add books from directories, including sub-directories (One book per directory, assumes every ebook file is the same book in a different format)

It will import metadata from the metadata.opf
eschwartz is offline   Reply With Quote
Old 09-27-2015, 03:33 PM   #10
Fiat_Lux
Addict
Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.Fiat_Lux ought to be getting tired of karma fortunes by now.
 
Fiat_Lux's Avatar
 
Posts: 393
Karma: 6700000
Join Date: Jan 2012
Location: Gimel
Device: tablets
Quote:
Originally Posted by eschwartz View Post
Make sure to use the second Add books option:




It will import metadata from the metadata.opf
In my limited testing, the meta-data in the user-category columns has not been imported. I use those columns for Dublin Core & CCIP/PCIP metadata. I don't look forward to manually adding that data. If I knew how to write an extension that would automatically add that data, I'd do so.

«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
Fiat_Lux is offline   Reply With Quote
Old 09-27-2015, 03:36 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Reply

Tags
can't open error, linux


Forum Jump

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


All times are GMT -4. The time now is 01:11 AM.


MobileRead.com is a privately owned, operated and funded community.