I have a .mobi file that converts fine using Calibre GUI on my main computer (OS X) but fails on the command line on a Linux (CentOS) VPS. Here's what I get (as you can see, I've been testing some options...without specifying options the conversion stalls, forever, at removing "fake margins"):
Spoiler:
$ ../calibre-bin/calibre/ebook-convert 0877798222-dt.mobi 0877798222-dt.epub --disable-unwrap-lines --disable-remove-fake-margins --dont-split-on-page-breaks --flow-size=10000 --disable-dehyphenate -v -v -v
Resolved conversion options
calibre version: 2.16.0
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0,
'book_producer': None,
'change_justification': 'original',
'chapter': "//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|pr ologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']",
'chapter_mark': 'pagebreak',
'comments': None,
'cover': None,
'debug_pipeline': None,
'dehyphenate': False,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_split_on_page_breaks': True,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'epub_flatten': False,
'epub_inline_toc': False,
'epub_toc_at_end': False,
'expand_css': False,
'extra_css': None,
'extract_to': None,
'filter_css': None,
'fix_indents': True,
'flow_size': 10000,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x7f156b8c80d0>,
'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,
'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,
'no_chapters_in_toc': False,
'no_default_epub_cover': False,
'no_inline_navbars': False,
'no_svg_cover': False,
'output_profile': <calibre.customize.profiles.OutputProfile object at 0x7f156b8c8490>,
'page_breaks_before': "//*[name()='h1' or name()='h2']",
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'pretty_print': True,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': None,
'remove_fake_margins': False,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': None,
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': '',
'sr1_search': '',
'sr2_replace': '',
'sr2_search': '',
'sr3_replace': '',
'sr3_search': '',
'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,
'unsmarten_punctuation': False,
'unwrap_lines': False,
'use_auto_toc': False,
'verbose': 3}
1% Converting input to HTML...
InputFormatPlugin: MOBI Input running
on /home/fncll/tmp/0877798222-dt.mobi
Extracting text...
Adding anchors...
Extracting images...
Cleaning up HTML...
Parsing HTML...
Converting style information to CSS...
Creating OPF...
Parsing all content...
Parsing styles.css ...
Parsing index.html ...
Forcing index.html into XHTML namespace
Reading TOC from NCX...
34% Running transforms on ebook...
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Cleaning up manifest...
Trimming unused files from manifest...
Trimming u'images/00002.jpg' from manifest
Trimming u'images/00003.jpg' from manifest
Creating EPUB Output...
67% Running EPUB Output plugin
Rescaling image from 1139x1600 to 844x1186 images/00024.jpg
Splitting markup on page breaks and flow limits, if any...
Looking for large trees in index.html...
Found large tree #0
Splitting...
Split point: {http://www.w3.org/1999/xhtml}div /*/*[2]/*[48979]
Killed
I posted a different thread about how I might figure out the difference in the options that the GUI version is using vs the command line, but trying to compare one by one is painful...so, any ideas what to try?