Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-05-2011, 07:40 PM   #1
december
Nameless Being
 
"MemoryError" during file conversion

I've run quite a lot of .epub-to-.mobi conversions (hooray Calibre!), but this is my first time running into this particular problem - below is the text of the error log right before the process terminates.

I think it's trying to tell me the computer is running out of memory while running the conversion... but is there any workaround?

Thanks in advance for all your help!

-----

Quote:
calibre, version 0.7.53
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1
[...]

Cleaning up manifest...
Trimming unused files from manifest...
Creating MOBI Output...
Applying case-transforming CSS...
Parsing manglecase.css ...
Python function terminated unexpectedly
(Error Code: 1)
Traceback (most recent call last):
File "site.py", line 103, in main
File "site.py", line 85, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 119, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 31, in gui_convert_override
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 1035, in run
File "site-packages\calibre\ebooks\mobi\output.py", line 173, in convert
File "site-packages\calibre\ebooks\oeb\transforms\manglecase. py", line 38, in __call__
File "site-packages\calibre\ebooks\oeb\transforms\manglecase. py", line 48, in mangle_spine
File "site-packages\calibre\ebooks\oeb\stylizer.py", line 199, in __init__
File "site-packages\calibre\ebooks\oeb\stylizer.py", line 99, in __init__
File "site-packages\lxml\cssselect.py", line 523, in css_to_xpath
File "site-packages\lxml\cssselect.py", line 648, in parse
File "site-packages\lxml\cssselect.py", line 663, in parse_selector_group
File "site-packages\lxml\cssselect.py", line 685, in parse_selector
File "site-packages\lxml\cssselect.py", line 697, in parse_simple_selector
File "site-packages\lxml\cssselect.py", line 969, in next
MemoryError
  Reply With Quote
Old 04-05-2011, 08:51 PM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by december View Post
I've run quite a lot of .epub-to-.mobi conversions (hooray Calibre!), but this is my first time running into this particular problem - below is the text of the error log right before the process terminates.

Quote:
calibre, version 0.7.53
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1
[...]
I don't know what exactly is going wrong, but it helps me if you include the whole log and not replace a bunch with [...]. This lets us know exactly what options you have selected and where in the processing it stopped.

If you wrap it in spoiler tags (the eye with the red X through it) the thread will still be manageable to view as we progress. Even if you wrap all of the [...] area in a spoiler tag and leave the error in the clear it would help us be able to examine the log closer.

Quote:
Originally Posted by december View Post
I think it's trying to tell me the computer is running out of memory while running the conversion... but is there any workaround?
This could be the case. What OS are you using? Have you tried converting this file to any other format (rtf or markdown text)?
DoctorOhh is offline   Reply With Quote
Advert
Old 04-05-2011, 09:35 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,020
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by december View Post
I've run quite a lot of .epub-to-.mobi conversions (hooray Calibre!), but this is my first time running into this particular problem - below is the text of the error log right before the process terminates.

I think it's trying to tell me the computer is running out of memory while running the conversion... but is there any workaround?

Thanks in advance for all your help!

-----
You could have RAM that is failing under heavy load. Download Memtest86+ (also part of the Ubuntu Live CD boot menu choices) and give it a run.
You could have limited (set too small or no more room on the drive) or a bad block in 'Virtual Memory' (your Hard disk).
theducks is offline   Reply With Quote
Old 04-05-2011, 11:03 PM   #4
december
Nameless Being
 
Oh, thank you for the heads-up about the spoiler tags - it's been a while since I was last here and I couldn't remember how to do that, so I was worried about spamming the board with the gigantic error log. Sorry! Here it is, this time in full.

Spoiler:
calibre, version 0.7.53
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1 (BookTitle)

Convert book 1 of 1 (BookTitle)
Resolved conversion options
calibre version: 0.7.53
{'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(., 'chapter|book|section|part\\s+', 'i')) or @class = 'chapter']",
'chapter_mark': u'pagebreak',
'comments': None,
'cover': 'c:\\users\\username\\appdata\\local\\temp\\calibr e_0.7.53_tmp_ujlnzk\\calibre_0.7.53_lminnd.jpeg',
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_compress': False,
'enable_heuristics': False,
'extra_css': None,
'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 0x05932870>,
'insert_blank_line': False,
'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_ignore_margins': False,
'no_chapters_in_toc': False,
'no_inline_navbars': True,
'no_inline_toc': True,
'output_profile': <calibre.customize.profiles.KindleOutput object at 0x05932B90>,
'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': 'c:\\users\\username\\appdata\\local\\temp\\calibr e_0.7.53_tmp_ujlnzk\\calibre_0.7.53_gmidri.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'',
'rescale_images': False,
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: EPUB Input running
on C:\Users\username\Documents\E-Book Library\Calibre Archive\Author\BookTitle (160)\BookTitle - Author.epub
Parsing all content...
Parsing OEBPS/Text/Chap47.xhtml ...
Parsing OEBPS/Text/Chap17.xhtml ...
Parsing OEBPS/Text/Chap32.xhtml ...
Parsing OEBPS/Text/Chap18.xhtml ...
Parsing OEBPS/Text/Chap19.xhtml ...
Parsing OEBPS/Text/Chap43.xhtml ...
Parsing OEBPS/Text/Chap20.xhtml ...
Parsing OEBPS/Text/Chap21.xhtml ...
Parsing OEBPS/Text/Chap38.xhtml ...
Parsing OEBPS/Text/Chap22.xhtml ...
Parsing OEBPS/Text/Chap46b.xhtml ...
Parsing OEBPS/Text/Chap23.xhtml ...
Parsing OEBPS/Text/Chap33.xhtml ...
Parsing OEBPS/Text/Chap24.xhtml ...
Parsing OEBPS/Text/Chap25.xhtml ...
Parsing OEBPS/Text/Chap39.xhtml ...
Parsing OEBPS/Text/Chap44.xhtml ...
Parsing OEBPS/Text/Summary.xhtml ...
Parsing OEBPS/Text/Chap26.xhtml ...
Parsing OEBPS/Text/Chap27.xhtml ...
Parsing OEBPS/Text/AboutAuthor.xhtml ...
Parsing OEBPS/Text/Part05.xhtml ...
Parsing OEBPS/Text/Chap28.xhtml ...
Parsing OEBPS/Text/Chap29.xhtml ...
Parsing OEBPS/Text/Chap34.xhtml ...
Parsing OEBPS/Text/Part04.xhtml ...
Parsing OEBPS/Styles/StyleNovel.css ...
Parsing OEBPS/Text/Chap31.xhtml ...
Parsing OEBPS/Text/Chap45.xhtml ...
Parsing OEBPS/Text/Part03.xhtml ...
Parsing OEBPS/Text/Chap01.xhtml ...
Parsing OEBPS/Text/Chap02.xhtml ...
Parsing OEBPS/Text/Chap40.xhtml ...
Parsing OEBPS/Text/Part02.xhtml ...
Parsing OEBPS/Text/Chap03.xhtml ...
Parsing OEBPS/Text/Chap04.xhtml ...
Parsing OEBPS/Text/Chap35.xhtml ...
Parsing OEBPS/Text/Part01.xhtml ...
Parsing OEBPS/Text/Chap05.xhtml ...
Parsing OEBPS/Text/Chap06.xhtml ...
Parsing OEBPS/Text/Chap30.xhtml ...
Parsing OEBPS/Text/Glossary.xhtml ...
Parsing OEBPS/Text/Chap07.xhtml ...
Parsing OEBPS/Text/TOC.xhtml ...
Parsing OEBPS/Text/Chap08.xhtml ...
Parsing OEBPS/Text/Chap41.xhtml ...
Parsing OEBPS/Text/Chap09.xhtml ...
Parsing OEBPS/Text/Chap10.xhtml ...
Parsing OEBPS/Text/Chap36.xhtml ...
Parsing OEBPS/Text/Chap11.xhtml ...
Parsing OEBPS/Text/Chap12.xhtml ...
Parsing OEBPS/Text/Chap46.xhtml ...
Parsing OEBPS/Text/Chap13.xhtml ...
Parsing OEBPS/Text/Chap14.xhtml ...
Parsing OEBPS/Text/Chap42.xhtml ...
Parsing OEBPS/Text/Chap15.xhtml ...
Parsing OEBPS/Text/Chap16.xhtml ...
Parsing OEBPS/Text/Chap37.xhtml ...
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Detected chapter: Part I
Detected chapter: Part II
Detected chapter: Part III
Detected chapter: Part IV
Detected chapter: Part V
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Parsing stylesheet.css ...
Found 321 items of level: div_1
Found 2 items of level: p_2
Found 4354 items of level: p_1
Ignoring level p_2
div_1 left margin stats: Counter()
div_1 right margin stats: Counter()
p_1 left margin stats: Counter({u'0': 4354})
p_1 right margin stats: Counter({u'0': 4354})
Cleaning up manifest...
Trimming unused files from manifest...
Creating MOBI Output...
Applying case-transforming CSS...
Parsing manglecase.css ...
Python function terminated unexpectedly
(Error Code: 1)
Traceback (most recent call last):
File "site.py", line 103, in main
File "site.py", line 85, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 119, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 31, in gui_convert_override
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 1035, in run
File "site-packages\calibre\ebooks\mobi\output.py", line 173, in convert
File "site-packages\calibre\ebooks\oeb\transforms\manglecase. py", line 38, in __call__
File "site-packages\calibre\ebooks\oeb\transforms\manglecase. py", line 48, in mangle_spine
File "site-packages\calibre\ebooks\oeb\stylizer.py", line 199, in __init__
File "site-packages\calibre\ebooks\oeb\stylizer.py", line 99, in __init__
File "site-packages\lxml\cssselect.py", line 523, in css_to_xpath
File "site-packages\lxml\cssselect.py", line 648, in parse
File "site-packages\lxml\cssselect.py", line 663, in parse_selector_group
File "site-packages\lxml\cssselect.py", line 685, in parse_selector
File "site-packages\lxml\cssselect.py", line 697, in parse_simple_selector
File "site-packages\lxml\cssselect.py", line 969, in next
MemoryError


I definitely have enough room on my hard drive, so that's not the issue here. I have not run Memtest, but (in case it is relevant at all) my physical memory usage does not climb beyond 76% during conversion before the process cuts out.

OS-wise, this computer is nothing very unusual: Windows 7 (64-bit version) with Service Pack 1.

Edited to add: At your suggestion, I've just tried the conversion from .epub to .rtf format - still no luck. I get the same error dialogue after the "Python function terminated unexpectedly" line.

Last edited by december; 04-05-2011 at 11:13 PM.
  Reply With Quote
Old 04-05-2011, 11:15 PM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Because it hasn't been said yet, have you rebooted your computer and tried again?

I'd suggest submitting a bug report with the epub attached. Find out how to submit a report here.

If the ePub is copyright mark the ticket as Private. After creating a bug ticket you can mark the ticket as private by clicking on the Yellow icon with the exclamation point in it following the "This report is public" in the top right hand side of the ticket.

Last edited by DoctorOhh; 04-05-2011 at 11:18 PM.
DoctorOhh is offline   Reply With Quote
Advert
Old 04-05-2011, 11:16 PM   #6
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: 45,317
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There are two possibilities here

1) Either your computer simply doesn't have enough RAM+Vmem to run this conversion

2) Something in your input document is malformed causing runaway memory consumption

IMO the latter is more likely, though to be able to say for sure we'd need access to the input document.
kovidgoyal is online now   Reply With Quote
Old 04-12-2011, 06:56 PM   #7
altsalt
Linux Grue
altsalt began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Kindle 3g
Hello, I have a new Kindle and have been going through organizing my library in .mobi files. I recently came to a similar problem and signed-up to post my log. So here's hi from lurk land.

Shall I post the log here or on launchpad?
altsalt is offline   Reply With Quote
Old 04-12-2011, 07:33 PM   #8
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: 45,317
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The log is useless, we need the file.
kovidgoyal is online now   Reply With Quote
Old 04-12-2011, 08:00 PM   #9
altsalt
Linux Grue
altsalt began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Kindle 3g
Bug submitted: https://bugs.launchpad.net/calibre/+bug/759313
altsalt is offline   Reply With Quote
Old 03-20-2023, 11:34 PM   #10
123iamking
Junior Member
123iamking began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Sep 2020
Device: Kindle Paperwhite (2nd gen)
I had this problem and I managed to solve it, so I want to share the solution here for future reference.

Solution: Use Calibre 64-bit version.

I see that when I use Calibre 32-bit (which is the portable verison), I got the error "Memory Error" when Memory hits about (if I remember correctly) 2GB - Task Manager showed that my Memory hits about 50% at that time - so I know that it's limitation of the 32-bit verison, not the limitation of my RAM. So I switch to Calibre 64-bit (which required installing) and it won't have that Memory Error anymore.
123iamking is offline   Reply With Quote
Old 03-21-2023, 12:48 AM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,706
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Moderator Notice
FTR: As of version 6 there is no 32bit, including Portable.

And please stop posting to ancient threads.

BR

Last edited by BetterRed; 03-21-2023 at 12:53 AM.
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF to WORD/HTML conversion, "special characters and marks" errors chengyibo PDF 3 11-06-2010 12:43 AM
Character conversion: "—" --> "—" Ivo Sigil 21 07-08-2010 04:38 PM
Conversion error: CHM to PDF or "anything else" conversions FAIL. Help. mm07 Calibre 3 05-16-2010 09:41 AM
File names with "(" and ")" can cause screen freezes greenapple Ectaco jetBook 5 02-04-2010 08:25 PM
Help! the "Make Sony Reader File" under "Options" is different Dr. Drib Sony Reader 6 04-23-2007 02:56 AM


All times are GMT -4. The time now is 09:59 AM.


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