EBook Publishing Issue
  • I have successfully installed Booktype on my local machine.  I am having an issue when I publish an ebook.  Every link offered on http://objavi.booki.cc/books/... does not work (404 not found).  I am unsure where to troubleshoot.  Installing a local version of Objavi seems unnecessary if I can used the shared public server. 

    Please help.
  • 61 Comments sorted by
  • hi,

    Can you email me privately your installation url? I can have a look. If you do so I will create an account and a book and check things. Then tell you how to delete the account and book.

    adam.hyde@sourcefabric.org

    If this isnt ok (and I totally understand if it isnt) then please tell me the name of the book and I will look at the Objavi server.


    adam
  • ah sorry...I see you have it installed on a local machine so it wont be possible to access. Send me the objavi URLs that are being returned


    adam
  • Hi there, I'm having the same problem. An epub and odt version worked but not the screen HTML or the book format which are the ones I really need. Any idea why this is happening? Any help appreciated! (I'm using the web-based version on booki.cc)


  • I meant screen PDF, not HTML. Sorry. 
  • Hi Ernestopriego

    Can you post the url of the book? I can try some tests.

    adam
  • Hi adam,

    I don't want this to be public yet as it's just a test (need to add covers and final proofs)

    Thank you! The initial epub test worked fine by the way. 
    Post edited by ernestopriego at 2012-02-20 03:10:22
  • Sorry, I mean the url to the book page in www.booki.cc

    Also, can you give admin rights to user 'booki' (in book settings tab in the edit page) as i think the book is currently hidden right?

    adam

  • to add 'booki' to admin goto the books _edit page, click 'settings', click 'manage roles' and in the dialog choose 'Administrator' and enter 'booki'. Click 'add' and then 'close'

    When I have checked the book you can remove me from the admin rights.

    adam
    Post edited by adam at 2012-02-19 10:48:18
  • Thanks. I have emailed you. Cheers. 
  • Thanks. I think I see the problem. Each chapter should have just one h1. At the moment your chapters have two - the headline and the credit directly under it. I am going through from the top and replacing the second line (credit) as a h2. Then I will test.

    Some book my the way, looks fantastic.
  • ernst - looks like it is the images as i see they are not local. off to bed will change them in the morning

    adam
  • Found the issue. All books need at least one image uploaded to the booktype server. Its a bug...i will investigate the issue and get it fixed.

    Your pdf should generate fine now

    adam
  • Hi !
    I'm experiencing the same kind of problem...
    I've installed booktype on a virtual server, and looks like it's working fine.
    But I'm not able to publish it in any format...
    It says that : Your book has been generated at this url: http://objavi.booki.cc/books/analisiprogettonagios-en-2012.02.23-11.55.34.pdf

    But i get a 404 Not Found error....

    Any idea ?

  • You need to register your booktype url with the objavi (rendering) server. you can use ours if you like, send me your install url and i will add it.

    adam.hyde@sourcefabric.org

    adam
    Post edited by adam at 2012-02-23 08:42:12
  • At this point, I guess I have another problem... (my fault, I'm not so good in configuring Apache).

    I have two websites under the same directory:

    /var/www/wgwiki (an internal wiki)
    /var/www/booktype

    I access them from outside with http://xxx.yyy.it/wgwiki or http://xxx.yyy.it/booktype

    If in apache2 config I put :

    WSGIScriptAlias /booktype /var/www/booktype/booki.wsgi

    everything works fine, but objavi cannot contact my webserver...

    If I change it in :

    WSGIScriptAlias / /var/www/booktype/booki.wsgi

    Locally nothing works (when I poinjt to wgwiki it says that it's not abook...), but objavi can retrieve the list of my books.

    I'm stuck....





  • Hey,

    Can you register fi.flossmanuals.net/kirjoita as well on Objavi, it is still pointing at fi-new.flossmanuals.net/kirjoita, which seems to work, but might be causing some trouble at some point... ;)

    Regards
    Tomi
  • Reply to @adam:

    Is there a way to have a local objavi server?  My machines are all inside a private network and there is no way to expose the URL to the public network.
  • hi Gary

    The sources are here:

    We are currently upgrading them...you may wish to wait 3 weeks fo rthe new version as it will be easy to install

    adan
  • I've tried this, but I seem to still have some setup issues.  My client (BookType) sends a request and I can see it get started, but the request info seems off.  I've attached my error log from the Objavi server.

    Any ideas what I'm missing?

    n.b. is there any other support vehicle than this forum as using it doesn't really fit my work flow.  A mailing list or direct contact would be much preferable.  Thanks

  • hi Gary

    Can you email me:
    * the url of your objavi server
    * the url of your booktype server

    and I will look at it

    adam.hyde@sourcefabric.org
  • I might suggest adding Objavi as a prerequisite in the install doc since it's easy to misunderstand that you wouldn't need to rely on someone elses rendering server. 
  • Hello,

    I installed booktype and objavi. booktype is working well however I can't publish.
    I added objavi but I can't access it as I have internal error.

    So I looked into the error log and found this : "No module named booki.bookizip"
    If it is because I have to edit objavi/config.py, I'd like to know what are variables to edit ?

    I can see there is : BOOKI_BOOK_DIR, BOOKI_BOOK_URL, 
    BOOKI_SHARED_DIRECTORY, BOOKI_SHARED_LONELY_USER_PREFIX (what are those two?),

    Do I have to also edit ZIP_URLS ?

    Or do I have to edit these one : DEFAULT_SERVER, DEFAULT_BOOKI_SERVER ?

    Regards, 
    Vibol

  • I'm publishing my notes when I successfully installed Objavi on my server. Not sure if it will help, but so you'll at least  see the roadmap. I've installed Objavi on separate server than Booktype (both on my servers):

    You have to have booktype installed (python setup.py install)
    check INSTALL from the Objavi (create dirs /books,tmp,cache/ in htdocs directory) (dir booki-books??) 
    1. directory higher than htdocs touch log/objavi.log

    don't use wkhtmltopdf from apt-get since it's unpatched

    1. git clone objavi.git
    2. sudo cp apache-config-objavi2 -> /etc/apache2/sites-available/myobjavi
    3. cd /etc/apache2/sites-available
    4. edit myobjavi
    5. Add ServerName
    6. correct DocumentRoot in Directory, to link to cloned objavi 
    7. go to ../sites-enabled
    8. ln -s ../sites-available/myobjavi .
    9. sudo cp apache-config-example-publish-domain /etc/apache2/sites-available/myobjavi_publish
    10. edit myobjavi_publish
    11. Add ServerName and correct DocumentRoot and Directory (different server name) and directory in Alias line
    12. cd ../sites-enabled
    13. ln -s ../sites-enabled/myobjavi_publish
    ---
    correct URLs in settings.py for OBJAVI_URL, ESPRI_URL and TWIKI_GATEWAY_URL

    ---
    objavi/config.py <- correct links to link to your server

  • Reply to @Vibol+Seng:
    Objavi needs to access bookizip.py which is inside of Booktype source. So, in your case you need to have source of Booktype somewhere in PYTHONPATH to make this error go away. We are doing some structural changes in Objavi and this "feature" will go away, but for now you must have Booktype source as well.

  • thanks for the reply,

    I did your roadmap but right now I'm stuck at objavi/config.py 
    I don't know what I should edit to make it right.
    I still have my error as it there is no module booki.bookizip

    complete log here  (objavi-error.log) :
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] Traceback (most recent call last):
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45]   File "/var/www/Objavi/htdocs/objavi.cgi", line 32, in <module>
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45]
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] from objavi.fmbook import Book, HTTP_HOST, find_archive_urls
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45]   File "/var/www/Objavi/objavi/fmbook.py", line 45, in <module>
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45]
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] from objavi import config, epub_utils
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45]   File "/var/www/Objavi/objavi/epub_utils.py", line 16, in <module>
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45]
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] from booki.bookizip import get_metadata, MEDIATYPES
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] ImportError
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] :
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] No module named booki.bookizip
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45]
    [Tue Jul 03 15:06:09 2012] [error] [client 163.9.2.45] Premature end of script headers: objavi.cgi



    Reply to @Vibol+Seng:

    Objavi needs to access bookizip.py which is inside of Booktype source. So, in your case you need to have source of Booktype somewhere in PYTHONPATH to make this error go away. We are doing some structural changes in Objavi and this "feature" will go away, but for now you must have Booktype source as well.


    OH I see, I already have Booktype source, so where do I need to add this path ?
    Post edited by Vibol Seng at 2012-07-03 09:22:02
  • I've edited:

    DEFAULT_SERVER = 'server URL'
    DEFAULT_BOOKI_SERVER = 'the same URL'

    I have also edited some SERVER_DEFAULTS where URL points to objavi.cc and I've added my server URL.

    Hope that helps.
  • I'm stuck now at the same problem my error log shows:

    [Tue Jul 03 20:59:05 2012] [notice] caught SIGTERM, shutting down
    [Tue Jul 03 20:59:06 2012] [warn] mod_wsgi: Compiled for Python/2.7.2+.

    [Tue Jul 03 20:59:06 2012] [warn] mod_wsgi: Runtime using Python/2.7.3.
    [Tue Jul 03 20:59:06 2012] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations

    [Tue Jul 03 20:59:16 2012] [error] [client 111.222.333.444] Directory
    index forbidden by Options directive:
    /home/rdv/objavi2/htdocs/shared/
    [Tue Jul 03 20:59:16 2012] [error] [client 111.222.333.444] File does not exist: /home/rdv/objavi2/htdocs/shared/favicon.ico

    [Tue Jul 03 20:59:17 2012] [error] [client 111.222.333.444] File does not exist: /home/rdv/objavi2/htdocs/shared/favicon.ico
    [Tue Jul 03 20:59:17 2012] [error] [client 111.222.333.444] File does not exist: /home/rdv/objavi2/htdocs/shared/favicon.ico

    Traceback (most recent call last):
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 32, in <module>
        from objavi.fmbook import Book, HTTP_HOST, find_archive_urls
      File "/home/rdv/objavi2/objavi/fmbook.py", line 44, in <module>

        from objavi import config, epub_utils
      File "/home/rdv/objavi2/objavi/epub_utils.py", line 14, in <module>
        from booki.bookizip import get_metadata
    ImportError: No module named booki.bookizip

    Traceback (most recent call last):
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 32, in <module>
        from objavi.fmbook import Book, HTTP_HOST, find_archive_urls
      File "/home/rdv/objavi2/objavi/fmbook.py", line 44, in <module>

        from objavi import config, epub_utils
      File "/home/rdv/objavi2/objavi/epub_utils.py", line 14, in <module>
        from booki.bookizip import get_metadata
    ImportError: No module named booki.bookizip

    I changed a lot of stuff in config.py but I'm not getting it to work.

    Post edited by Ruud de Vries at 2012-07-03 16:07:22
  • Well I managed to solve this error, it was easy.
    My Booki source is found here:
    /home/rdv/Booki
    Objavi2 here:
    /home/rdv/objavi2

    What I did to solve the "ImportError: No module named booki.bookizip" problem is:
    ln -s /home/rdv/Booki/lib/booki /home/rdv/objavi2

    now I got a new problem:
    cat /var/log/apache2/error.log
    [Tue Jul 03 22:30:33 2012] [warn] mod_wsgi: Compiled for Python/2.7.2+.
    [Tue Jul 03 22:30:33 2012] [warn] mod_wsgi: Runtime using Python/2.7.3.
    [Tue Jul 03 22:30:33 2012] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
    Traceback (most recent call last):
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 32, in <module>
        from objavi.fmbook import Book, HTTP_HOST, find_archive_urls
      File "/home/rdv/objavi2/objavi/fmbook.py", line 52, in <module>
        from iarchive import epub as ia_epub
    ImportError: No module named iarchive

  • And that was solved with (found the the fix in google cache):

    cd /home/rdv/objavi2/

    git clone git://github.com/douglasbagnall/epub.git iarchive

    And again a new problem:
    cat log/objavi.log
    Traceback (most recent call last):
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 453, in <module>
        main()
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 446, in main
        output_function(args)
      File "/home/rdv/objavi2/objavi/cgi_utils.py", line 219, in output
        content = f(*args, **kwargs)
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 147, in mode_form
        f = open(config.FONT_LIST_INCLUDE)
    IOError: [Errno 2] No such file or directory: 'cache/font-list.inc'

    So I simply did this:
    touch cache/font-list.inc
    chmod 777 cache/font-list.inc

    But still a internal server error when I want to visit objavi2 in the browser and in the log:
    cat log/objavi.log
    getting booklist: http://booki.test.nl/bin/view/TWiki/WebLeftBarWebsList?skin=text
    Traceback (most recent call last):
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 453, in <module>
        main()
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 446, in main
        output_function(args)
      File "/home/rdv/objavi2/objavi/cgi_utils.py", line 219, in output
        content = f(*args, **kwargs)
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 156, in mode_form
        'book_options': optionise(twiki_wrapper.get_book_list(server), default=book),
      File "/home/rdv/objavi2/objavi/twiki_wrapper.py", line 50, in get_book_list
        f = urlopen(url)
      File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
        return _opener.open(url, data, timeout)
      File "/usr/lib/python2.7/urllib2.py", line 406, in open
        response = meth(req, response)
      File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
        'http', request, response, code, msg, hdrs)
      File "/usr/lib/python2.7/urllib2.py", line 444, in error
        return self._call_chain(*args)
      File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
        result = func(*args)
      File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
        raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    urllib2.HTTPError: HTTP Error 404: NOT FOUND

    cache/font-list.inc is empty...

    But... there is something going on when I want to publish a book:

    cat log/objavi.log
    argument 'rotate' is not valid ('off')
    argument 'grey_scale' is not valid ('off')
    templates/nowhere.txt
    text/plain; charset=utf-8
    nowhere
    sync
    in get_watchers. method 'sync', callback None, destination 'nowhere'
    watchers are set([<bound method Context.log_notifier of <__main__.Context object at 0x2a33190>>])
    *** Starting new book test-en-2012.07.03-23.57.42.pdf ***
    notify_watcher called with 'start'
    ******* got message "start"
    fetching zip from http://booki.test.nl/export/test/export
    notify_watcher called with 'fetch_zip'
    ******* got message "fetch_zip"
    {u'http://booki.cc/': {u'dir': {u'': [u'LTR']}},
     u'http://purl.org/dc/elements/1.1/': {u'creator': {u'': [u'The Contributors']},
                                           u'date': {u'last-modified': [u'2012.06.25-00.00'],
                                                     u'published': [u'2012.07.03-23.57'],
                                                     u'start': [u'2012.06.25-18.03']},
                                           u'identifier': {u'booki.cc': [u'http://booki.test.nl/test/2012.07.03-23.57']},
                                           u'language': {u'': [u'en']},
                                           u'publisher': {u'': [u'Unknown']},
                                           u'title': {u'': [u'test']}}}
    notify_watcher called with '__init__'
    ******* got message "__init__"
    xauth:  file /home/rdv/objavi2/htdocs/tmp/test-en-2012.07.03-23.57.42.pdfqX4COL/Xauthority does not exist
    notify_watcher called with 'FINISHED'
    ******* got message "FINISHED"
    NOT removing '/home/rdv/objavi2/htdocs/tmp/test-en-2012.07.03-23.57.42.pdfqX4COL', containing the following files:
    Xauthority
    notify_watcher called with 'cleanup'
    ******* got message "cleanup"
    Traceback (most recent call last):
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 453, in <module>
        main()
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 446, in main
        output_function(args)
      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 355, in mode_book
        book.spawn_x()
      File "/home/rdv/objavi2/objavi/fmbook.py", line 1105, in spawn_x
        '-nolisten', 'tcp',
      File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
        errread, errwrite)
      File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
        raise child_exception
    OSError: [Errno 2] No such file or directory

    Well I'm stuck for now, help would be appriciated!


  • Looks to me like url here:

      File "/home/rdv/objavi2/htdocs/objavi.cgi", line 156, in mode_form 
        'book_options': optionise(twiki_wrapper.get_book_list(server), default=book), 
      File "/home/rdv/objavi2/objavi/twiki_wrapper.py", line 50, in get_book_list 
        f = urlopen(url) 

    Doesn't have proper value. Can you check if there is any link still pointing to www.booki.cc?


  • I don not exactly know which links you refer to, but this is the diff of my config.py versus the orignal:
    diff config.py config.py.orig
    36c36
    < TMPDIR = 'tmp'
    ---
    > TMPDIR = 'htdocs/tmp'
    51c51
    < WKHTMLTOPDF = '/bin/wkhtmltopdf'
    ---
    > WKHTMLTOPDF = '/usr/local/bin/wkhtmltopdf-static'
    107c107
    < DEFAULT_SERVER = 'booki.test.nl'
    ---
    > DEFAULT_SERVER = 'en.flossmanuals.net'
    146,157d145
    <     'booki.test.nl': {
    <         'css-book': '/static/en.flossmanuals.net.css',
    <         'css-web': '/static/en.flossmanuals.net-web.css',
    <         'css-newspaper': '/static/en.flossmanuals.net-newspaper.css',
    <         'css-openoffice': '/static/en.flossmanuals.net-openoffice.css',
    <         'lang': 'en',
    <         'dir': 'LTR',
    <         'toc-encoding': None,
    <         'display': False,
    <         'interface': 'Booki',
    <         'toc_header': 'Table of Contents',
    <         },
    297,298c285,286
    < if 'booki.test.nl' in SERVER_DEFAULTS:
    <     SERVER_DEFAULTS['booki.test.nl'] = SERVER_DEFAULTS['booki.test.nl']
    ---
    > if 'booki.cc' in SERVER_DEFAULTS:
    >     SERVER_DEFAULTS['www.booki.cc'] = SERVER_DEFAULTS['booki.cc']

  • Here is the diff of settings.py from Booktype:
    diff settings.py /home/rdv/Booki/lib/booki/settings.py.original
    8c8,9
    < ADMINS = (('Admin', 'admin@test.nl'),
    ---
    > ADMINS = (
    >     # ('Your Name', 'your_email@domain.com'),
    18,22c19,24
    < BOOKI_NAME = 'Test Booki site'
    < THIS_BOOKI_SERVER ="booki.test.nl"
    < BOOKI_ROOT = '/var/www/mybooki'  # edit this
    < BOOKI_URL="http://booki.test.nl"
    < #BOOKI_URL = ''
    ---
    > BOOKI_NAME = '##BOOKI_NAME##'
    > THIS_BOOKI_SERVER = '' # the name of the booki server (comment out to use os.environ['HTTP_HOST'])
    >
    > BOOKI_ROOT = '##BOOKI_ROOT##'  # edit this
    > BOOKI_URL = ''
    > #BOOKI_URL = 'http://%s' % THIS_BOOKI_SERVER
    25c27
    < REPORT_EMAIL_USER = 'admin@test.nl'
    ---
    > REPORT_EMAIL_USER = 'booki@booki.cc'
    62,64c64,66
    < OBJAVI_URL = "http://objavi2.test.nl/objavi.cgi"
    < ESPRI_URL = "http://objavi2.test.nl/espri.cgi"
    < TWIKI_GATEWAY_URL = "http://objavi2.test.nl/booki-twiki-gateway.cgi"
    ---
    > OBJAVI_URL = "http://objavi.booki.cc/objavi.cgi"
    > ESPRI_URL = "http://objavi.booki.cc/espri.cgi"
    > TWIKI_GATEWAY_URL = "http://objavi.booki.cc/booki-twiki-gateway.cgi"
    75,78c77,80
    < DATABASE_ENGINE = 'django.db.backends.postgresql_psycopg2'##DATABASE_ENGINE##'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
    < DATABASE_NAME = 'booki'##DATABASE_NAME##'             # Or path to database file if using sqlite3.
    < DATABASE_USER = 'rdv'             # Not used with sqlite3.
    < DATABASE_PASSWORD = '12345678'         # Not used with sqlite3.
    ---
    > DATABASE_ENGINE = '##DATABASE_ENGINE##'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
    > DATABASE_NAME = '##DATABASE_NAME##'             # Or path to database file if using sqlite3.
    > DATABASE_USER = ''             # Not used with sqlite3.
    > DATABASE_PASSWORD = ''         # Not used with sqlite3.
    94c96
    < LANGUAGE_CODE = 'nl-NL'
    ---
    > LANGUAGE_CODE = 'en-us'
    Post edited by Ruud de Vries at 2012-07-03 18:28:05
  • Well I feel a bit stupid... forgot to install this, that's what you get for working this late ;)



    easy_install lxml

    apt-get install pdfedit xvfb pdftk psutils poppler-utils msttcorefonts



    So, I'm able to publish to PDF, but the contents of the pdf file is a page with this:


    Not Found

    The requested URL /missing_path was not found on this server.

    Apache/2.2.22 (Ubuntu) Server at objavi2.test.nl Port 80



    The objavi.log is attached.
    Post edited by Ruud de Vries at 2012-07-03 19:25:06
  • I thought I sent the answer, but I can't find it so .. here we go again.
    I've checked your objavi.log and this one doesn't look correct:

    /bin/wkhtmltopdf -q --page-width 210.0 --page-height 297.0 -T 16.1611111111 -R 19.9619444444 -B 18.1013888889 -L 19.9619444444 -d 100 --outline --outline-depth 2 --dump-outline /home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/outline.txt http://objavi2.test.nl/missing_path?/home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/body.html /home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/body.pdf
    The url is saying: http://objavi2.test.nl/missing_path?
  • Well I managed to solve this error, it was easy.
    My Booki source is found here:
    /home/rdv/Booki
    Objavi2 here:
    /home/rdv/objavi2

    What I did to solve the "ImportError: No module named booki.bookizip" problem is:
    ln -s /home/rdv/Booki/lib/booki /home/rdv/objavi2



    Works for me thanks !

    Now my problem is that objavi.cgi isn't working for me in booktype, 

    Now, I get this (objavi-error.log) :

    Premature end of script headers: objavi.cgi

    And on Booktype I get : 

    Unknown error while trying to publish this book.

    My variables value in settings.py seem correct since I can get to my objavi platform in http://mydomain/objavi.cgi and those are :

    OBJAVI_URL = "http://mydomain/objavi.cgi"
    ESPRI_URL = "http://mydomain/cespri.cgi"
    TWIKI_GATEWAY_URL = "http://mydomain/booki-twiki-gateway.cgi"





    Post edited by Vibol Seng at 2012-07-04 04:36:45
  • @Ruud:

    Can you post your apache conf for objavi. I think there is a problem with DocumentRoot.


    Can you post excerpt from the log of book.log (it's in log directory).
  • Nothing when I try publishing on booktype for : booki/logs/booki.log

    Same for : /var/log/apache2/booktype-error.log 

       

    Ah and it looks like pics aren't showing. 
    looking at the html source code I have this for cover book 

    <img src="cover.jpg">

    I'm using the wsgi.apache that I put in http.conf
    Post edited by Vibol Seng at 2012-07-04 05:19:39
  • Not sure, but the directory name should be log not logs.
  • well there is something written in it but there is no history of error when I try publishing (whatever type of document I'm trying to publish).
  • Vibol Seng 
    There should be a log in objavi2/log/objavi.log
    Config attached.
  • When something like that happened to me, the log showed that I missed one url change in setting objavi.
    And the other error was using non patched wkhtmltopdf (or better yet, non patched qt for wkhtmltopdf).
  • @Ruud 

    Looks ok. Damn. I was sure there is some error.
    I'm leaving now so I'll be able to check it later in the evening or tomorrow.
    Maybe Aleksandar has an answer and will be able to do it in the meantime :)
  • I got this on objavi/log/objavi.log

    Traceback (most recent call last):
      File "/var/www/Objavi/htdocs/objavi.cgi", line 485, in <module>
        main()
      File "/var/www/Objavi/htdocs/objavi.cgi", line 478, in main
        output_function(args)
      File "/var/www/Objavi/htdocs/objavi.cgi", line 416, in mode_epub
        context = Context(args)
      File "/var/www/Objavi/htdocs/objavi.cgi", line 187, in __init__
        self.bookname = make_book_name(self.bookid, self.server, extension)
      File "/var/www/Objavi/objavi/book_utils.py", line 84, in make_book_name
        lang = guess_lang(server, book)
      File "/var/www/Objavi/objavi/book_utils.py", line 95, in guess_lang
        lang = config.SERVER_DEFAULTS[server].get('lang')
    KeyError: 'mybooktypeIP:8000'

    The error on the ip is corrected though.
    My ip was corrected (it was a typo) but I still have the same error but with correct IP

    I was using IP instead of ServerName, I changed it and looks like it works better now. 
    Maybe the app doesn't like working on different port. One was on 80 and other on 8000.

    I can finally publish from booktype ;)
    Thanks for the help :)

    Post edited by Vibol Seng at 2012-07-04 10:56:08
  • Nice that you got it working. I still have the missing_path problem.

    I also see this in the log:
    ******* got message "wait_for_xvfb"
    /bin/wkhtmltopdf -q --page-width 210.0 --page-height 297.0 -T 16.1611111111 -R 19.9619444444 -B 18.1013888889 -L 19.9619444444 -d 100 --outline --outline-depth 2 --dump-outline /home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/outline.txt http://objavi2.test.nl/missing_path?/home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/body.html /home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/body.pdf
    /bin/wkhtmltopdf -q --page-width 210.0 --page-height 297.0 -T 16.1611111111 -R 19.9619444444 -B 18.1013888889 -L 19.9619444444 -d 100 --outline --outline-depth 2 --dump-outline /home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/outline.txt http://objavi2.test.nl/missing_path?/home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/body.html /home/rdv/objavi2/tmp/test-en-2012.07.04-01.03.20.pdf3YzUtI/body.pdf
    /bin/wkhtmltopdf returned 2 and produced
    stdout:
    stderr:QSslSocket: cannot resolve SSLv2_client_method
    QSslSocket: cannot resolve SSLv2_server_method
    Exit with code 2 due to http error: 404 Page not found

    Maybe this is part of the problem?

    I also see these errors:
    Other error that I see in the log:
    stderr:QSettings: error creating /.qt
    QSettings: error creating /.qt

    ...

    pdftk returned 0 and produced
    stdout:
    stderr:
    notify_watcher called with 'concatenated_pdfs'


    Post edited by Ruud de Vries at 2012-07-05 07:33:15
  • I see that this part of code in objavi/cgi_utils.py produces the "missing_path":
    _htdocs = os.path.abspath(config.HTDOCS)
    def path2url(path, default='/missing_path?%(path)s', full=False):
        """convert local file paths to htdocs-relative addresses.  If the
        file is not in the web tree, return default"""
        if path.startswith('file:///'):
            path = path[7:]
        path = os.path.abspath(path)
        if path.startswith(_htdocs):
            path = path[len(_htdocs):]
        else:
            path = default % {'path': urllib.quote(path)}
        if full:
            return 'http://%s%s' % (SERVER_NAME, path)
        return path

  • Can somebody post the log of a working objavi installation? I would like to know what the log shows where

    /bin/wkhtmltopdf 

    Is used and where I'm getting the "missing_path".

  • Can you check your objavi/config.py and TMPDIR variable. Is it TMPDIR = 'htdocs/tmp' ? The problem you have is before starting wkhtmltopdf Objavi will check if paths to temporarily created files are where Objavi is installed. If it is not, then it will add this this missing_file url. 

    Can you send me your config.py to aleksandar.erkalovic@sourcefabric.org email so i can see what have you changed?
  • I found the solution!
    I changed in objavi/config.py

    KEEP_TEMP_FILES = True
    TMPDIR = 'tmp'

    to

    KEEP_TEMP_FILES = True
    TMPDIR = 'htdocs/tmp'

    and then:

    mv tmp htdocs/
  • Beer for me! :)

    Yes.. seems like TMPDIR variable must start with content of HTDOCS variable. The problem is this makes tmp directory public and open to the world, but you can configure apache to make it not accessible.
  • BTW, which git repository did you use to download your copy of Objavi?