Mobileread
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:
Code
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:

Quote
Traceback (most recent call last):
File "site.py", line 77, in main
File "site-packages/calibre/db/cli/main.py", line 257, in main
File "site-packages/calibre/db/cli/main.py", line 54, in run_cmd
File "site-packages/calibre/db/cli/cmd_add.py", line 383, in main
File "site-packages/calibre/db/cli/cmd_add.py", line 192, in do_add
File "site-packages/calibre/db/cli/main.py", line 190, in run
File "site-packages/calibre/db/cli/main.py", line 212, in remote_run
File "site-packages/mechanize/_mechanize.py", line 238, in open_novisit
File "site-packages/mechanize/_mechanize.py", line 283, in _mech_open
File "site-packages/mechanize/_opener.py", line 193, in open
File "site-packages/mechanize/_urllib2_fork.py", line 375, in _open
File "site-packages/mechanize/_urllib2_fork.py", line 363, in _call_chain
File "site-packages/mechanize/_urllib2_fork.py", line 1200, in http_open
File "site-packages/mechanize/_urllib2_fork.py", line 1182, in do_open
URLError: <urlopen error [Errno 32] Broken pipe>
I looked in that function on _urlib2_fork.py, and the only point I can see this sort of error creeping up is on a
Code
try
except
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.
Reply 

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

#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
Code
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!
Reply 

#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?
Reply 

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