Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-08-2013, 06:58 AM   #1
darklajid
Junior Member
darklajid began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2013
Device: none
Headless content server confusion

Hey there.

I recently installed calibre (1.13) as a headless content server: Just moved my library to a machine that's always on, installed it completely standalone using

Code:
sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main()"
This worked for a time. Now I'm in the weird situation that it works _sometimes_. Most of the time starting calibre-server leads to these lines and the process dieing:

Code:
Dec 08 12:35:57 bitdump calibre-server[1243]: Traceback (most recent call last):
Dec 08 12:35:57 bitdump calibre-server[1243]: File "site-packages/calibre/library/server/base.py", line 272, in start
Dec 08 12:35:57 bitdump calibre-server[1243]: File "site-packages/calibre/library/server/base.py", line 265, in start_cherrypy
Dec 08 12:35:57 bitdump calibre-server[1243]: File "site-packages/cherrypy/process/wspbus.py", line 250, in start
Dec 08 12:35:57 bitdump calibre-server[1243]: ChannelFailures: IOError(2, 'No such file or directory')
There's nothing special about the way I launch the thing:

Code:
/usr/bin/calibre-server --max-cover=600x800 --max-opds-items=30 --max-opds-ungrouped-items=100 --username=calibre --port=8888 --pidfile=/var/run/calibre/calibre-server.pid --with-library=/tank/books
The thing is: Sometimes .. it works/stays up. I tried following the stack trace, but I don't see anything special in there, certainly nothing about potential files/directories. I'd be glad if someone could help me fix this situation.

Minor sidenote, added but low priority issue: I cannot use --daemonize with calibre-server, which is the reason why that option is absent from my line above. I'd prefer to use that, but ..

[bitdump dar]# /usr/bin/calibre-server --max-cover=600x800 --max-opds-items=30 --max-opds-ungrouped-items=100 --username=calibre --port=8888 --pidfile=/var/run/calibre/calibre-server.pid --with-library=/tank/books --daemonize
Aborted (core dumped)

Last edited by darklajid; 12-08-2013 at 07:02 AM. Reason: Minor addition
darklajid is offline   Reply With Quote
Old 12-08-2013, 07:11 AM   #2
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: 43,862
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Most likely that's because something in your environment is different each time. Check the environment variables, check that the directory containing the pid file exists and so on. And if --daemonize is causing a core dump on your server, it points to something fairly serious being messed up, as all --daemonize does is this,

Code:
def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
    try:
        pid = os.fork()
        if pid > 0:
            # exit first parent
            sys.exit(0)
    except OSError as e:
        print >>sys.stderr, "fork #1 failed: %d (%s)" % (e.errno, e.strerror)
        sys.exit(1)

    # decouple from parent environment
    os.chdir("/")
    os.setsid()
    os.umask(0)

    # do second fork
    try:
        pid = os.fork()
        if pid > 0:
            # exit from second parent
            sys.exit(0)
    except OSError as e:
        print >>sys.stderr, "fork #2 failed: %d (%s)" % (e.errno, e.strerror)
        sys.exit(1)

    # Redirect standard file descriptors.
    si = file(stdin, 'r')
    so = file(stdout, 'a+')
    se = file(stderr, 'a+', 0)
    os.dup2(si.fileno(), sys.stdin.fileno())
    os.dup2(so.fileno(), sys.stdout.fileno())
    os.dup2(se.fileno(), sys.stderr.fileno())
where i dont see any potential for SIGABRT unless some system call is failing.
kovidgoyal is online now   Reply With Quote
Advert
Old 12-08-2013, 07:19 AM   #3
darklajid
Junior Member
darklajid began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2013
Device: none
Hey.

First of all: Thanks for the feedback and your great work on calibre in general.
Two things: I guess you helped me track down the startup issue - it's probably (still investigating) related to /var/run being cleaned after a reboot. So .. thanks and sorry for the noise..

Regarding the core dump: The machine works fine. The only thing I can think of as worth mentioning is that this is a Arch Linux box, running python3 by default (not sure if that might cause trouble). As far as I understood the installation procedure though everything related to calibre should be below /opt now, independent of my system's state of affair?

The coredump/backtrace is probably useless?

Code:
(gdb) bt
#0  0x00007f329afa83d9 in raise () from /usr/lib/libc.so.6
#1  0x00007f329afa97d8 in abort () from /usr/lib/libc.so.6
#2  0x00007f32996cb3d3 in ffi_closure_free () from /opt/calibre/lib/libffi.so.4
#3  0x00007f32998df99f in ?? () from /opt/calibre/lib/python2.7/lib-dynload/_ctypes.so
#4  0x00007f329ac36ddb in ?? () from /opt/calibre/lib/libpython2.7.so.1.0
#5  0x00007f32998d88b7 in ?? () from /opt/calibre/lib/python2.7/lib-dynload/_ctypes.so
#6  0x00007f32998d8aa9 in ?? () from /opt/calibre/lib/python2.7/lib-dynload/_ctypes.so
#7  0x00007f329ac5997d in ?? () from /opt/calibre/lib/libpython2.7.so.1.0
#8  0x00007f329ac35183 in ?? () from /opt/calibre/lib/libpython2.7.so.1.0
#9  0x00007f329ac37b30 in ?? () from /opt/calibre/lib/libpython2.7.so.1.0
#10 0x00007f329ac3aaad in _PyModule_Clear () from /opt/calibre/lib/libpython2.7.so.1.0
#11 0x00007f329acadbf1 in PyImport_Cleanup () from /opt/calibre/lib/libpython2.7.so.1.0
#12 0x00007f329acb73db in Py_Finalize () from /opt/calibre/lib/libpython2.7.so.1.0
#13 0x00007f329b3203f5 in execute_python_entrypoint ()
   from /opt/calibre/lib/libcalibre-launcher.so
#14 0x00000000004006ff in main ()
darklajid is offline   Reply With Quote
Old 12-08-2013, 07:30 AM   #4
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: 43,862
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes the binary calibre install does not depend on the system python in anyway.
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Headless Calibre Server greene48 Library Management 17 10-28-2013 01:09 AM
Excited! But errors for headless server. apiontek Devices 3 08-25-2013 04:07 PM
Calibre server on (headless no X) sheevaplug junke1990 Related Tools 6 07-13-2013 08:04 AM
Calibre Headless Server dearleuk Library Management 2 12-02-2012 04:04 AM
Headless Calibre Server Setup godzilla8nj Related Tools 4 03-10-2010 01:39 PM


All times are GMT -4. The time now is 12:14 AM.


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