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-15-2014, 01:58 PM   #1
smei
Junior Member
smei began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2014
Device: Nook HD
Permission denied error when adding book to library

Hey, I hope this is the correct place to post this.

Have:
Mac OS X Lion 10.7.5
Calibre 2.3

Issue:
I was cleaning up my files/library and now I'm trying to add books into Calibre from my computer files but I keep getting error messages. These are books that at one time existed in Calibre, and currently still exist on my nook. This is only happening with about 6 books, other books have added to Calibre just fine.

I have already repaired disk permissions, checked the sharing & permission settings on the file and directory it resides in, I am not using a networked drive/NAS, and I am the only user on my laptop.

I have even re-downloaded the book from a website and I get the same error message when I try to add it from my Downloads.

Error Message
calibre, version 2.3.0
ERROR: Unhandled exception: <b>OSError</b>:[Errno 13] Permission denied: '/Users/thebestdog/Documents/Books/My Library/Buroker, Lindsay/Blood and Betrayal (696)'

calibre 2.3 isfrozen: True is64bit: True
Darwin-11.4.2-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '11.4.2', 'Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64')
Python 2.7.8
OSX: ('10.7.5', ('', '', ''), 'x86_64')
Successfully initialized third party plugins: DeDRM && Find Duplicates && Goodreads
Traceback (most recent call last):
File "site-packages/calibre/gui2/add.py", line 42, in add_one
File "site-packages/calibre/db/legacy.py", line 211, in create_book_entry
File "site-packages/calibre/db/cache.py", line 57, in call_func_with_lock
File "site-packages/calibre/db/cache.py", line 1474, in create_book_entry
File "site-packages/calibre/db/cache.py", line 1218, in set_metadata
File "site-packages/calibre/db/cache.py", line 1045, in update_path
File "site-packages/calibre/db/backend.py", line 1471, in update_path
File "lib/python2.7/os.py", line 157, in makedirs
OSError: [Errno 13] Permission denied: '/Users/thebestdog/Documents/Books/My Library/Buroker, Lindsay/Blood and Betrayal (696)'


Also I am trying to load the book from a different location than what is being "denied." The book is really located at /Users/thebestdog/Documents/Calibre Library/Buroker, Lindsay/Blood and Betrayal (8)

(And yes, Calibre is pointed at a directory called "My Library" not "Calibre Library")

What am I missing?? I have googled the shit out of this and tried a lot of things other people did on here with no success.
smei is offline   Reply With Quote
Old 09-15-2014, 02:16 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,772
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@smei - Have you run Library Maintenance->Check Database and cleared up any anomalies? Have you run Library Maintenance->Restore Database?

If not then before doing them I would recommend you take a static backup of your library as it stands now. And if relevant, turn off Time Machine for the library until its 'fixed'

BR
BetterRed is offline   Reply With Quote
Advert
Old 09-15-2014, 03:27 PM   #3
smei
Junior Member
smei began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2014
Device: Nook HD
When I "check database" I get the "Found no errors...want to check if the files in your library match the information in the database" box. Hit Yes.

Invalid Titles - all of my author's names appear
Extra Titles - A good chunk if not all of my book titles show up
Invalid Authors - just .DS_Store
Extra Authors - There are maybe 30 authors names
Missing Book Formats - Two duplicate book titles
Unknown Files in Books - Two books listed

...I'm assuming this isn't normal or good?
smei is offline   Reply With Quote
Old 09-15-2014, 04:38 PM   #4
smei
Junior Member
smei began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2014
Device: Nook HD
I know I did something in the last couple of days that is the cause of this. I, idiotically, went through and renamed and deleted a bunch of files in the directory of my library which I have since found out is a terrible thing to do.

So at various points I did a Restore Database and used Time Machine to go back a few days neither of which left me with my complete library. I thought "gee let's just start from scratch!" and I created a new library and went one by one and added books from anywhere and everywhere they were stored on my laptop then I went through and cleaned up all the metadata...and now I have some .epubs that simply will not load back to calibre and give me error messages (as I posted above). I can open them with my Nook for Mac app just fine though.

I'm kicking myself for meddling with the original files. At this point what would you say the best thing to do is?

Thanks to anyone who has any advice!
smei is offline   Reply With Quote
Old 09-15-2014, 06:55 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,772
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@smei for recognising this was caused by something you did, you'd be amazed how many folks swear black-'n'-blue they didn't do nuffin', and insist that calibre ate their library.

I'll assume the path to your broken library is /Users/thebestdog/Documents/Calibre Library/

Try this -
  1. start calibre with that broken library,
  2. create an empty library see first attachment
  3. close calibre
  4. open the broken library folder in Finder
  5. delete the metadata.db file and and any other FILES, leave the folders as they are
  6. using Finder copy the metadata.db from that empty library folder (/Users/thebestdog/Documents/_NewLibrary) into the the broken library folder (/Users/thebestdog/Documents/Calibre Library/)
  7. start calibre (and go into the broken library) - it will be empty
  8. run the Library Maintenance->Library Restore function - now you should have a lot of your library back
  9. run the Library Maintenance->Check Library - clear up all anomalies.
    • hit the button that copies the 'report' into the clipboard, and paste that into a text editor, so you can see it
    • close calibre
    • then use the list to carefully move dodgy author and book folders and any dodgy files out of the library folder to a scratch area
  10. start calibre and rerun the Check Library - hopefully it will now be error free.
  11. now you can deal what you copied to the scratch area by adding anything that's worthwhile to your library
  12. you can trash that _NewLibrary from calibre's view via Library->Remove library and then deleting the folder in Finder.
If that doesn't fix it then hmmm - what happened?

I do not have a MAC, but if I did then I probably would not run calibre and Time Machine concurrently. I would try to achieve that via an Automaton that suspended Time Machine's monitoring of my ebook library folders before it starting calibre and resuming Time Machine's monitoring of them when calibre terminated. I have no idea if that's actually possible.

BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	341
Size:	30.5 KB
ID:	128399  

Last edited by BetterRed; 09-15-2014 at 07:07 PM.
BetterRed is offline   Reply With Quote
Advert
Old 09-15-2014, 11:54 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,151
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need to make sure that all files and folders in the directory have correct permissions and owners. The easiest way to do that is run the following commands

chmod -R a+rw /path/to/calibre\ library
chown -R thebestdog:staff /path/to/calibre\ library
chmod a+x /path/to/calibre\ library/* /path/to/calibre\ library/*/*
chmod a-x /path/to/calibre\ library/metadata.db
kovidgoyal is offline   Reply With Quote
Old 09-16-2014, 12:15 PM   #7
smei
Junior Member
smei began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2014
Device: Nook HD
BetterRed thank you so much for that process! I followed the steps up until step 9 and all of a sudden a ton of books duplicated with their original add date and file formats. I have a bit of cleaning up to do and metadata edits to make, but now I can at least add books to Calibre again!
smei is offline   Reply With Quote
Old 09-16-2014, 04:43 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,772
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by smei View Post
BetterRed thank you so much for that process! I followed the steps up until step 9 and all of a sudden a ton of books duplicated with their original add date and file formats. I have a bit of cleaning up to do and metadata edits to make, but now I can at least add books to Calibre again!
@smei - yeah, I wondered if you might have duplicates, but I didn't want to complicate the process any more than it already was.

This plug-in should enable you clean up the duplicates ==>> [GUI Plugin] Find Duplicates If you have any questions or issues with it then it's preferable to post them in its thread.

Simple rule with the library folders - Look but Don't Touch.

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre 0.9.24 [64-bit] Permission Denied Error edwdecarlo Devices 6 03-23-2013 01:22 PM
permission denied rodolfo Calibre 5 10-16-2010 11:58 PM
permission denied in calibre longhair75 Calibre 0 08-13-2010 01:09 PM
Sigil error - Cannot read file / Permission denied dgraygrayco Sigil 4 01-13-2010 05:15 PM
Permission denied? desertgrandma Kindle Formats 16 01-26-2009 06:06 AM


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


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