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
|