Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-08-2011, 07:53 AM   #1
robertseetzen
Junior Member
robertseetzen began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2011
Device: Android
Unhappy "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
robertseetzen is offline   Reply With Quote
Old 09-08-2011, 11:05 AM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by robertseetzen View Post
Hello,
whenever I try to use a network directory as the Calibre Library Folder, the program reports a database error.
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.
user_none is offline   Reply With Quote
Advert
Old 09-08-2011, 11:10 AM   #3
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: 30,444
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:
Originally Posted by user_none View Post
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.
And "sometimes" is the worst possible case, because "Sometimes" your Library goes bye-bye

Avoid placing your data at peril on "Sometimes it fails" systems. Even if you really-really want to do it that way
theducks is offline   Reply With Quote
Old 09-08-2011, 02:10 PM   #4
ThR
Tatütatuter
ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.ThR could sell banana peel slippers to a Deveel.
 
ThR's Avatar
 
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.
ThR is offline   Reply With Quote
Old 05-30-2013, 03:56 PM   #5
bkqc
Junior Member
bkqc began at the beginning.
 
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...
bkqc is offline   Reply With Quote
Advert
Old 05-30-2013, 05:55 PM   #6
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
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.
Adoby is offline   Reply With Quote
Old 06-02-2013, 03:59 PM   #7
mark1softie
Junior Member
mark1softie began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2013
Device: kobo touch
Question What has changed?

Quote:
Originally Posted by user_none View Post
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.
I have used Calibre to manage my NAS-mounted database for over a year, with no database errors, except in the past two weeks.

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
mark1softie is offline   Reply With Quote
Old 06-02-2013, 04:48 PM   #8
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
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.
itimpi is offline   Reply With Quote
Old 01-18-2017, 04:23 PM   #9
gpm
Member
gpm began at the beginning.
 
gpm's Avatar
 
Posts: 12
Karma: 40
Join Date: Jan 2017
Device: Pocketbook, Tolino, Sony
Thumbs up

Actually, I had the very same problem.

I was able to solve it with the mount option "nobrl"

Quote:
Calibre does not take libraries on network drives. It will throw "Database locked" errors when you try.
But we can avoid this error by mounting the volume with nobrl option.

From the manual:
nobrl -
Do not send byte range lock requests to the server. This is necessary for certain applications that break with cifs style mandatory byte range locks (and most cifs servers do not yet support requesting advisory byte range locks).

So in the /etc/fstab:

Code:
//server/nas /home/nas cifs nobrl,user=uid,password=xxx,uid=1001,gid=1001 0 0
Then you can use the calibre libraries on this volume without errors.
Source: https://coderwall.com/p/zrxobw/calibre-libraries-on-nas

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.
gpm is offline   Reply With Quote
Old 02-19-2017, 12:36 AM   #10
rudyb
Junior Member
rudyb began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2014
Device: Kobo Touch
Quote:
Originally Posted by gpm View Post
Actually, I had the very same problem.

I was able to solve it with the mount option "nobrl"



Source: https://coderwall.com/p/zrxobw/calibre-libraries-on-nas

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.
I did and it solved my problem. Thanks a bunch for posting this solution!
rudyb is offline   Reply With Quote
Old 05-30-2018, 01:30 AM   #11
MrCaringi
Venezuelan
MrCaringi began at the beginning.
 
MrCaringi's Avatar
 
Posts: 52
Karma: 10
Join Date: Jan 2014
Location: now Living in Mexico City
Device: PW2 (B0D4 Series)
Quote:
Originally Posted by gpm View Post
Actually, I had the very same problem.

I was able to solve it with the mount option "nobrl"



Source: https://coderwall.com/p/zrxobw/calibre-libraries-on-nas

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.
thank you very much! it worked!
MrCaringi is offline   Reply With Quote
Old 05-30-2018, 05:12 AM   #12
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
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.
Adoby is offline   Reply With Quote
Old 06-01-2018, 12:34 PM   #13
gpm
Member
gpm began at the beginning.
 
gpm's Avatar
 
Posts: 12
Karma: 40
Join Date: Jan 2017
Device: Pocketbook, Tolino, Sony
Quote:
Originally Posted by Adoby View Post
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. ...
My scenario is calibre server running on a Raspberry Pi which is connected to my router and also used as file server, the database is on an external USB drive (NTFS formatted) connected to the Raspi and mounted there with nobrl option.

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.
gpm is offline   Reply With Quote
Old 11-30-2022, 12:10 PM   #14
bonzi
Enthusiast
bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.bonzi once ate a cherry pie in a record 7 seconds.
 
bonzi's Avatar
 
Posts: 46
Karma: 1530
Join Date: Nov 2011
Location: Zagreb, Croatia
Device: K2i, K3/KK WiFi, Basic (old), 2xFire, 2xPW (old), Voyage, Scribe
Quote:
Originally Posted by gpm View Post
Actually, I had the very same problem.

I was able to solve it with the mount option "nobrl"
Sounds risky (it causes byte range lock requests to simply not be sent), but I will try with due caution.

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!
bonzi is offline   Reply With Quote
Old 11-30-2022, 01:00 PM   #15
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 12,357
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.
Quoth is offline   Reply With Quote
Reply

Tags
database, error, library, linux, network


Forum Jump

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


All times are GMT -4. The time now is 04:43 PM.


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