09-08-2011, 07:53 AM | #1 |
Junior Member
Posts: 1
Karma: 10
Join Date: Sep 2011
Device: Android
|
"Database is locked" - can't use network folders
Hello,
whenever I try to use a network directory as the Calibre Library Folder, the program reports a database error. It doesn't matter if I try to choose the folder when starting Calibre the very first time after a fresh install or after "re-running" the startup wizard from the calibre menu. The network folder is empty, no books were imported. The error messages follow at the end of this post. The background / scenario is: I want to use Calibre on my desktop PC as well as on my Notebook and Netbook - only one at a time, no concurrent access. All machines are running Ubuntu. The eBooks shall reside on a server, which is (no jokes) a windows 7 install, so the network mounts use samba / cifs. Any help would be very appreciated, since I really like Calibre. Robert Seetzen - The error messages: Traceback (most recent call last): File "site-packages/calibre/gui2/main.py", line 215, in initialize_db File "site-packages/calibre/library/database2.py", line 216, in __init__ File "site-packages/calibre/library/database2.py", line 332, in initialize_dynamic File "site-packages/calibre/library/sqlite.py", line 314, in run DatabaseException: database is locked RemoteTraceback (most recent call last): File "site-packages/calibre/library/sqlite.py", line 271, in run OperationalError: database is locked |
09-08-2011, 11:05 AM | #2 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Putting the library on a network share is not supported. Some people have gotten this to work but it's not recommended. The SQLite db does not work well on a network share. I believed NFS doesn't work at all and SMB sometimes works.
|
Advert | |
|
09-08-2011, 11:10 AM | #3 | |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Avoid placing your data at peril on "Sometimes it fails" systems. Even if you really-really want to do it that way |
|
09-08-2011, 02:10 PM | #4 |
Tatütatuter
Posts: 390
Karma: 3148
Join Date: Oct 2008
Location: Germany, Baden, Karlsruhe
Device: Aura H2O, Glo HD, Paperwhite, PRS-950
|
My calibre-database resides on a network share (NAS by Synology, accessing the database with three W7-PCs, no concurrent use, one after another) since I started with calibre. Sometimes I get "database is locked", but only if the laptop has lost its wlan-connection while calibre is running. Stopping and restarting calibre and the problem is gone.
|
05-30-2013, 03:56 PM | #5 |
Junior Member
Posts: 2
Karma: 10
Join Date: May 2013
Device: Galaxy S3
|
But what if I want to keep my book in a safe and accessible place? My MyBook Live NAS is automatically replicated which isn't the case of my local Hard Drive...
|
Advert | |
|
05-30-2013, 05:55 PM | #6 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
I use Linux, Ubuntu. I have my calibre library on a Synology NAS, and I use NFS to mount the NAS folders. Works perfectly. To improve performance I have placed Metadata.db on a local SSD, using a symlink.
I moved metadata.db to a folder on the SSD and created a symlink to metadata.db where metadata.db was originally. Works great. I have changed the script that start calibre so that when calibre is terminated metadata.db is copied to the NAS, so I have a backup. But there are many opportunities for problems, if I had used SMB instead my calibre library would have been corrupted quickly because problems with how the filesystems is or isn't case sensitive. If you feel that you don't know for sure what is safe, keep the calibre library on a local filesystem. Use the NAS as a backup media, and run backup automatically after you quit calibre. Edit the script that launch calibre. But it is possible to mess that up as well, if the case sensitivity of the NAS filesystem is different from the local filesystem. I belive that if you use Windows, then a SMB or CIFS share on the NAS works ok. If you use Linux, then a NFS share works ok. If you run a Mac then I don't know... But no guarantees, test carefully before you trust anyone or anything. |
06-02-2013, 03:59 PM | #7 | |
Junior Member
Posts: 1
Karma: 10
Join Date: Jun 2013
Device: kobo touch
|
What has changed?
Quote:
Still using Ubuntu 12.04 LTS [with all repository package updates applied], with my "~/Documents/eBooks_Calibre" directory on a Netgear ReadyNAS Duo, mounted using NFS. Using sqlite3 (3.7.9-2ubuntu1.1), last updated in August 2012 Using NFS 1.2.5-3ubuntu3.1, last updated September 2012. Have updated Calibre at least twice in the last couple of weeks, now at 0.9.33. Could something in the Calibre Python code have changed, forgetting to unlock the database? Now get a "DatabaseException:database is locked RemoteTraceback (most recent call last): File "site-packages/calibre/library/sqlite.py", line 272, in run OperationalError: database is locked: calibre, version 0.9.33 ERROR: Unhandled exception: <b>DatabaseException</b>:database is locked RemoteTraceback (most recent call last): File "site-packages/calibre/library/sqlite.py", line 272, in run OperationalError: database is locked Traceback (most recent call last): File "site-packages/calibre/gui2/metadata/single.py", line 526, in next_clicked File "site-packages/calibre/gui2/metadata/single.py", line 469, in apply_changes File "site-packages/calibre/gui2/metadata/basic_widgets.py", line 102, in commit File "site-packages/calibre/library/database2.py", line 2550, in set_title File "site-packages/calibre/library/database2.py", line 652, in set_path File "site-packages/calibre/library/database2.py", line 1540, in add_format File "site-packages/calibre/library/sqlite.py", line 315, in run DatabaseException: database is locked RemoteTraceback (most recent call last): File "site-packages/calibre/library/sqlite.py", line 272, in run OperationalError: database is locked |
|
06-02-2013, 04:48 PM | #8 |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Calibre does not officially support library files being on a network drive precisely because of the fact that network drives often have problems with lock handling. Quite why it has been working up to now and has only recently started failing I have no idea.
|
01-18-2017, 04:23 PM | #9 | |
Member
Posts: 12
Karma: 40
Join Date: Jan 2017
Device: Pocketbook, Tolino, Sony
|
Actually, I had the very same problem.
I was able to solve it with the mount option "nobrl" Quote:
I know this is a rather old thread, but I thought I put in the information anyways, as someone might stumble in from the search function. |
|
02-19-2017, 12:36 AM | #10 | |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2014
Device: Kobo Touch
|
Quote:
|
|
05-30-2018, 01:30 AM | #11 | |
Venezuelan
Posts: 52
Karma: 10
Join Date: Jan 2014
Location: now Living in Mexico City
Device: PW2 (B0D4 Series)
|
Quote:
|
|
05-30-2018, 05:12 AM | #12 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
Please also be aware that there are other problems with having calibre on a NAS with a Linux filesystem and accessing the database/books from a windows computer.
One problem that I have personal experience from is different case sensitivity. That means that as you update metadata for books, and the formats are updated on disk, they may become duplicated or lost. And orphan books and folder without entries in the database may appear. Errors seemingly appear randomly over a very long time. Use the NAS as backup media. Or treat the calibre library on the NAS as read only. Or use the same type of filesystem on both NAS and PC. I use linux on my PC and have no problems with my linux based NAS. |
06-01-2018, 12:34 PM | #13 | |
Member
Posts: 12
Karma: 40
Join Date: Jan 2017
Device: Pocketbook, Tolino, Sony
|
Quote:
So the server runs on linux and the database and my PC are on NTFS. I have access to the external drive from my Windows PC and all other devices in my home network. To be cautious I allways stop the calibre server on the Raspi before I work with the database from my PC, i.e. adding/editing/deleting books, and restart calibre server after that, quick and easy with SSH access. No trouble so far. PS: I use a rather old version of calibre server (2.75.1) because there's no newer one in the repositories and didn't want to compile myself. |
|
11-30-2022, 12:10 PM | #14 | |
Enthusiast
Posts: 46
Karma: 1530
Join Date: Nov 2011
Location: Zagreb, Croatia
Device: K2i, K3/KK WiFi, Basic (old), 2xFire, 2xPW (old), Voyage, Scribe
|
Quote:
BTW, my situation is CIFS mount on Ubuntu from Windows 10. Calibre reports "database locked", SQLite command line client reports "not a database or database corrupted", while DBeaver DB dev tool (which uses JDBC) reads the database without problems. Thanks! Off to live dangerously! |
|
11-30-2022, 01:00 PM | #15 |
the rook, bossing Never.
Posts: 12,344
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Only use a database on local drive of same cpu running Calibre. It's SQLite, not MS SQL, MySQL, MariaDB etc.
It's single user local file. |
Tags |
database, error, library, linux, network |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Touch "Updating Reading Life" = "Network error" | m_bisson | Kobo Reader | 5 | 07-15-2011 02:05 AM |
SONY pocket edition: "Device locked" + "charge battery" obstacles? | hermes | Devices | 3 | 06-02-2011 04:32 AM |
"Content locked..." with Kobo books - questions | JVM | Kobo Reader | 4 | 04-18-2011 09:58 AM |
Request Open "Locked" LCD screen when 'reader' function icon pressed. | Eddy R | enTourage Archive | 10 | 12-07-2010 09:09 PM |
"Locked" 505 will not show in eBook Library | SoCal Bob | Sony Reader | 1 | 10-16-2007 01:57 PM |