Broken pipe error when doing add --with-library
#1  Corusco 12-04-2019, 03:05 AM
I'm attempting to test the typical command to add in to my crontab to update my library on a headless server:
calibredb add /array/media/books/* --with-library http://localhost:8001/#books --username user --password pass
The command begins to execute, hangs for 8-10 seconds without any console return, and then kicks back with the following trace:

Traceback (most recent call last):
File "", line 77, in main
File "site-packages/calibre/db/cli/", line 257, in main
File "site-packages/calibre/db/cli/", line 54, in run_cmd
File "site-packages/calibre/db/cli/", line 383, in main
File "site-packages/calibre/db/cli/", line 192, in do_add
File "site-packages/calibre/db/cli/", line 190, in run
File "site-packages/calibre/db/cli/", line 212, in remote_run
File "site-packages/mechanize/", line 238, in open_novisit
File "site-packages/mechanize/", line 283, in _mech_open
File "site-packages/mechanize/", line 193, in open
File "site-packages/mechanize/", line 375, in _open
File "site-packages/mechanize/", line 363, in _call_chain
File "site-packages/mechanize/", line 1200, in http_open
File "site-packages/mechanize/", line 1182, in do_open
URLError: <urlopen error [Errno 32] Broken pipe>
I looked in that function on, and the only point I can see this sort of error creeping up is on a
on a host connection toward the bottom of the func.

I do think I have a valid initial connection because I get valid returns from calibre if I form the calibredb command wrong, such as needing user/pass or name the library incorrectly.

I notice the host object has a timeout variable and I can't see where that's getting set. It makes sense that a timeout of some sort would indicate a dead connection if there isn't a return. Scanning the dir does take a bit of time when I've added while Calibre is stopped.

Really, all I'm looking for is the right way to keep my lib updated.

#2  kovidgoyal 12-04-2019, 06:09 AM
Does adding single books work? Are you using the official calibre binaries? what version?

#3  Corusco 12-05-2019, 01:21 AM
Thanks for your prompt reply, Kovid. I really appreciate how much of your time you dedicate to supporting Calibre. Your suggestion about trying a single book gave me a few ideas to try this evening.

I'm using version 4.3, official binary.

I did try a couple of single books. One was a standard .epub file from my collection, another was a file I quickly made with
touch test.epub
Each time, the command exited with "Not Found". Deliberately mistyping the file path exits with printing the entire path with lowercase "not found".

I tried running tail -f on my calibre log file and nothing is being logged to the file when I try - what seems to be - a properly formatted command. When running the calibredb add command with improper login credentials, it does show failed login attempts, so that validates at least my logfile is being written to properly and my host address is right.

Hope this helps in guiding me toward more things to try. Thank you again!

#4  kovidgoyal 12-05-2019, 02:43 AM
First I suggest using --enable-local-write which dispenses with the need for usernames and passwords. And whch log is this the error log or the access log?

Today's Posts | Search this Thread | Login | Register