DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
728 stars 72 forks source link

Calibredb won't import files #1541

Closed BinsonBuzz closed 6 years ago

BinsonBuzz commented 6 years ago

LazyLibrarian version number ecb451aa65f6c6982bbc03f6337574c7fcdcc0a7

Operating system used unRAID 6.5.2

Interface in use (default, bookstrap) bookstrap

Which api (Goodreads, GoogleBooks, both) GoodRe

Source of your LazyLibrarian installation (git, zip file, 3rd party package) thraxis docker

Relevant debug log with api keys and any passwords redacted pasted

I'm using the thraxis docker and the Calibre-RDP docker on unRAID. I've read your FAQ, but I can't setup LL to tell Calibre to import new books.

At first I just setup /library as the book library location in both LL and Calibre, but Calibre would only see new files if I restarted it. I then read the FAQ so I setup Calibre-server with a username/password, but I'm still having no joy.

Help please

Debug logs showing failed imports and my config: https://pastebin.com/wKm9KLi6

philborman commented 6 years ago

It looks like a permissions issue, in your log you have calibredb res 10[Forbidden ]

Seems you are talking to calibredb ok, and calibredb is talking to the server, but the server says no. Are you sure the user/pass are ok for the server, and the server was started with --enable-auth or it's enabled in calibre config?

There is a "test calibredb" button in lazylibrarian config, does that give any useful info, might show which part is failing, usually you can read without auth being correct, but not write

BinsonBuzz commented 6 years ago

Thanks for the quick response.

Do I add --enable-auth to the calibre docker's extra containers? I just tried that and the docker wouldn't start

philborman commented 6 years ago

I don't use that docker myself, but another user reported that you need to set EDGE=1 as that particular docker is shipped with an older version of calibre.

I think the --enable-auth needs to be a calibre startup command. Not sure how you would add it into the docker if it's not already there, and it doesn/t seem to be, but you can get the same effect by defining a user and password inside calibre itself. Calibre->Preferences->Sharing over the net On the "Main" tab tick "require user name and password to access the content server" On the "User Accounts" tab set up the same user/pass as you gave lazylibrarian

BinsonBuzz commented 6 years ago

sorry, was so excited was getting help I didn't answer the 2nd part of your response.

With use calibre content server not ticked I get:

calibredb ok, version 3.29
Database READ ok
Database WRITE ok

With content server ticked

calibredb ok, version 3.29
Database READ Failed
Database READ Failed or database is empty

With it not ticked files get added to the db, but calibre doesn't see them until I restart it

Am I supposed to be using the content server? I tried adding --enable-auth to the docker extra parameters, but the docker wouldn't start.

Another problem is LL is importing duplicates of the same book into different folders which is annoying.

BinsonBuzz commented 6 years ago

I think the dupes are because extra copies of the import folder were being created with .fail at the end and then these were being imported.

https://pastebin.com/fJNYecg8

Here's a log of a successful import into calibredb that I can't see in calibre until I reboot. I'm 'happy' as I have a working solution as I only open calibre to tidy up metadata and covers once in a while, so I'll just remember to restart it each time I do.

philborman commented 6 years ago

Using the content server is better, as the content server will tell calibre about the new books, otherwise it doesn't know (as you have found). The older v2.x calibredb used to do it automatically, the new one in v3.x doesn't.

Looking at the logs I think the problem might be the library name? The non-content-server option talks to the database found in the shared /library folder. The content server needs to be told which library to talk to unless there is a configured default. I'm guessing the docker hasn't configured a default? There are a couple of things you can try... If you haven't changed the docker settings the library is probably just called "Calibre Library" so try changing your calibre content server setting in lazylibrarian to "http://192.168.50.50:8081/#Calibre Library"
If that doesn't work, try calibredb from a command line to query the database names (see the library-path entry in https://manual.calibre-ebook.com/generated/en/calibredb.html), or maybe there is some info in the calibre server log (calibre "sharing over the net" page has a logs button)

BinsonBuzz commented 6 years ago

Thanks for bearing with me - it's working now. I don't think I changed any of the settings - stopping and restarting the calibre server seems to have done the trick.

I'm still getting duplicates imported, so I'm running dupeguru offline to remove before finishing my import.