FS#63687 - [calibre] conversion to mobi fails

Attached to Project: Community Packages
Opened by leazar (leazar) - Sunday, 08 September 2019, 04:42 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 08 September 2019, 08:32 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

With the latest version 3.47.1-2 from community, here Calibre fails to convert epub to mobi with error message "Failed convert book" (full log included below). No mobi files appear in calibre's library. That's with the arch package. If I revert to 3.46 or use the latest official binary from the author's website it works.

Author says it's not upstream bug: https://www.mobileread.com/forums/showthread.php?p=3887237

Sample log (no errors):

Convert book 1 of 1
Conversion options changed from defaults:
output_profile: u'kindle_pw3'
verbose: 2
cover: u'/tmp/calibre_3.47.1_tmp_Ge9KC_/AL50cP.jpeg'
read_metadata_from_opf: u'/tmp/calibre_3.47.1_tmp_Ge9KC_/zdmIWG.opf'
Resolved conversion options
calibre version: 3.47.1
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': u'original',
'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']",
'chapter_mark': u'pagebreak',
'comments': None,
'cover': u'/tmp/calibre_3.47.1_tmp_Ge9KC_/AL50cP.jpeg',
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_compress': False,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'expand_css': False,
'extra_css': None,
'extract_to': None,
'filter_css': u'',
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x7f017639aa90>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'mobi_file_type': u'old',
'mobi_ignore_margins': False,
'mobi_keep_original_images': False,
'mobi_toc_at_start': False,
'no_chapters_in_toc': False,
'no_inline_navbars': True,
'no_inline_toc': False,
'output_profile': <calibre.customize.profiles.KindlePaperWhite3Output object at 0x7f01763a62d0>,
'page_breaks_before': u'/',
'personal_doc': u'[PDOC]',
'prefer_author_sort': False,
'prefer_metadata_cover': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': u'/tmp/calibre_3.47.1_tmp_Ge9KC_/zdmIWG.opf',
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': u'',
'search_replace': '[]',
'series': None,
'series_index': None,
'share_not_sync': False,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'transform_css_rules': '[]',
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: EPUB Input running
on /tmp/calibre_3.47.1_tmp_Ge9KC_/E8Zpeu.epub
Found HTML cover titlepage.xhtml
Parsing all content...
Parsing titlepage.xhtml ...
Parsing OEBPS/Chapter 33.xhtml ...
Parsing OEBPS/Chapter 20.xhtml ...
Parsing OEBPS/Chapter 39.xhtml ...
Parsing OEBPS/Chapter 21.xhtml ...
Parsing OEBPS/About the Author.xhtml ...
Parsing OEBPS/Chapter 4.xhtml ...
Parsing OEBPS/Chapter 22.xhtml ...
Parsing stylesheet.css ...
Parsing OEBPS/Chapter 26.xhtml ...
Parsing OEBPS/Chapter 23.xhtml ...
Parsing OEBPS/Chapter 8.xhtml ...
Parsing OEBPS/Chapter 40.xhtml ...
Parsing OEBPS/Chapter 34.xhtml ...
Parsing OEBPS/Chapter 27.xhtml ...
Parsing OEBPS/Chapter 24.xhtml ...
Parsing OEBPS/Chapter 9.xhtml ...
Parsing OEBPS/Chapter 28.xhtml ...
Parsing OEBPS/Chapter 25.xhtml ...
Parsing OEBPS/Contents.xhtml ...
Parsing OEBPS/Chapter 29.xhtml ...
Parsing OEBPS/Also by Paul Dowswell.xhtml ...
Parsing OEBPS/Acknowlegements.xhtml ...
Parsing OEBPS/Chapter 30.xhtml ...
Parsing OEBPS/Chapter 10.xhtml ...
Parsing OEBPS/Chapter 1.xhtml ...
Parsing OEBPS/Chapter 38.xhtml ...
Parsing OEBPS/Dedication.xhtml ...
Parsing OEBPS/Chapter 11.xhtml ...
Parsing OEBPS/Chapter 14.xhtml ...
Parsing OEBPS/Chapter 6.xhtml ...
Parsing OEBPS/Chapter 13.xhtml ...
Parsing OEBPS/Imprint.xhtml ...
Parsing OEBPS/Chapter 12.xhtml ...
Parsing OEBPS/Cover.xhtml ...
Parsing OEBPS/Chapter 15.xhtml ...
Parsing OEBPS/Chapter 16.xhtml ...
Parsing OEBPS/Title page.xhtml ...
Parsing OEBPS/Chapter 3.xhtml ...
Parsing OEBPS/Chapter 17.xhtml ...
Parsing OEBPS/Chapter 32.xhtml ...
Parsing OEBPS/Fact and Fiction.xhtml ...
Parsing OEBPS/Chapter 5.xhtml ...
Parsing OEBPS/Chapter 31.xhtml ...
Parsing OEBPS/Chapter 35.xhtml ...
Parsing OEBPS/Chapter 18.xhtml ...
Parsing OEBPS/Chapter 7.xhtml ...
Parsing OEBPS/Chapter 36.xhtml ...
Parsing OEBPS/Chapter 19.xhtml ...
Parsing OEBPS/Chapter 37.xhtml ...
Parsing OEBPS/Chapter 2.xhtml ...
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 49 items of level: div_1
Found 49 items of level: div_2
Found 2003 items of level: p_3
div_1 left margin stats: Counter({u'': 46})
div_1 right margin stats: Counter({u'': 46})
div_2 left margin stats: Counter({u'': 44})
div_2 right margin stats: Counter({u'': 44})
p_3 left margin stats: Counter({u'0': 1982, u'1.89em': 21})
p_3 right margin stats: Counter({u'0': 1982, u'1.89em': 21})
Cleaning up manifest...
Trimming unused files from manifest...
Trimming u'titlepage.xhtml' from manifest
Creating MOBI Output...
Serializing resources...
Creating MOBI 6 output
Generating in-line TOC...
Applying case-transforming CSS...
Parsing manglecase.css ...
Parsing tocstyle.css ...
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 08 September 2019, 08:32 GMT
Reason for closing:  Fixed
Additional comments about closing:  calibre 3.47.1-3
Comment by Eli Schwartz (eschwartz) - Sunday, 08 September 2019, 04:52 GMT
Conversion works for me on my test book, so I'd need more data on how you are getting this failure in order to reproduce it. e.g. does this happen consistently for various epubs? To isolate the effects of modified conversion defaults, does it still reproduce the error when you use the command line ebook-convert from a newly created user account?
Comment by leazar (leazar) - Sunday, 08 September 2019, 06:04 GMT
Yes, it happens consistently for any epub I've tried.

ebook-convert returns an error about an "headless" Qt plugin after "Running MOBI Output plugin":

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not find the Qt platform plugin "headless" in "/usr/lib/calibre/calibre/plugins"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: headless (from /usr/lib/calibre/calibre/plugins), eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)

(I've also tried using QT_QPA_PLATFORM=wayland before running ebook-convert but nothing changed.)
Comment by leazar (leazar) - Sunday, 08 September 2019, 06:06 GMT
Btw I didn't change any default setting, and have already tried removing the .config/calibre directory in home before reinstalling calibre.
Comment by Eli Schwartz (eschwartz) - Sunday, 08 September 2019, 06:23 GMT
I don't use wayland, so I have no idea if/how that might be involved. Does it work in X11?

Incidentally my reason for suggesting a different user account is because deleting the configuration directory can cause you to lose important settings... renaming it to .config/calibre.bak/ is a much safer alternative.
Comment by leazar (leazar) - Sunday, 08 September 2019, 07:05 GMT
I don't know as I only use Gnome on wayland. However I do know that both 3.46 in community and the official 3.47.1 work fine, but not 3.47.1 in community.
Comment by Eli Schwartz (eschwartz) - Sunday, 08 September 2019, 08:19 GMT
Well, I tried installing and running weston, which is the example compositor for wayland. I can successfully convert books there, too.

Can you link an example epub that definitely demonstrates the problem (i.e. Project Gutenberg has lots of freely distributable ebooks). I need something to work with here.

EDIT: okay, I guess not... I'm using the testing repos and qt5-* 5.13.1 is in [testing], see arojas' comment below.
Comment by Antonio Rojas (arojas) - Sunday, 08 September 2019, 08:31 GMT
Sigh, Qt changed their ABI again in 5.13.1

Loading...