View Full Version : How to fix this error? " the id in the spine does not match any item in the manifest"


krausj
04-28-2013, 04:50 PM
I'm trying to convert my epub to the kindle format using Kindle Preview. I've triple checked the manifest and everything matches up. any idea what might be happening?

JSWolf
04-28-2013, 06:25 PM
Please post your OPF file so someone can have a look at it.

DiapDealer
04-28-2013, 07:03 PM
Quite simply: one of the itemrefs in the spine section of your opf file has an idref attribute that doesn't match the id attribute of any of the items in the manifest section. Flightcrew or epubcheck might give you a better hint about where, exactly, the problem area is, if you're having trouble spotting it.

krausj
04-29-2013, 09:29 AM
here is the opf. still can't find any disagreeing info

<?xml version="1.0" encoding="UTF-8"?>
<package xmlns:xx="http://saxon.sf.net/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/metadata/dublin_core" unique-identifier="book-id" version="2.0">

<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">

<meta name="fixed-layout" content="true"/>
<meta name="orientation-lock" content="landscape"/>
<meta name="RegionMagnification" content="true"/>
<meta name="original-resolution" content="600x1024"/>
<meta name="zero-gutter" content="true"/>
<meta name="zero-margin" content="true"/>

<!-- meta name="book-type" content="children" -->
<!-- meta name="book-type" content="comic" -->

<!-- see my blog for notes on the book-type entries -->

<dc-metadata xmlns:dc="http://purl.org/metadata/dublin_core" xmlns:oebpackage="http://openbook.org/namespaces/oeb-package/1.0/">

<dc:title>Theo Battles the Stair Monster</dc:title>

<dc:creator id="creator_aut" opf:file-as="Kraus, Josh" opf:role="aut">Josh Kraus</dc:creator>
<dc:creator opf:role="ill">Daryl Alexy</dc:creator>
<dc:identifier id="BookId">096f01f8-90d3-48cb-a706-1ee65e7b767a</dc:identifier>
<dc:identifier id="PrimaryID" opf:scheme="ISBN">ISBN</dc:identifier>
<dc:publisher>PUBLISHER NAME</dc:publisher>
<dc:date id="date_1" opf:event="creation">####-##-##</dc:date>
<dc:date id="date_2" opf:event="publication">####-##-##</dc:date>
<dc:rights>Copyright 2013 - All Rights Reserved</dc:rights>
<dc:language>EN-US</dc:language>
<dc:type>FICTION/Children's/humor/illustrated.</dc:type>
<dc:subject>ENTER LIBRARY OF CONGRESS HEADINGS HERE</dc:subject>
<dc:description>ENTER BOOK BLURB HERE</dc:description>

<meta name="cover" content="cover" />
</dc-metadata>

<x-metadata>
<EmbeddedCover>images/cover.jpg</EmbeddedCover>
</x-metadata>

</metadata>

<manifest>

<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>

<!-- css -->
<item id="covercss" href="css/cover.css" media-type="text/css">
<item id="css1" href="css/page1.css" media-type="text/css">
<item id="css2" href="css/page2.css" media-type="text/css">
<item id="css3" href="css/page3.css" media-type="text/css">

<!-- html -->
<item id="cover" href="html/cover.html" media-type="application/xhtml+xml"/>
<item id="page1" href="html/page1.html" media-type="application/xhtml+xml"/>
<item id="page2" href="html/page2.html" media-type="application/xhtml+xml"/>
<item id="page3" href="html/page3.html" media-type="application/xhtml+xml"/>

<!-- fonts -->
<item id="font1" href="fonts/Booter_5-0.ttf" media-type="application/x-font-otf"/>

<!-- images -->
<item id="coverimg" href="images/cover.jpg" media-type="image/jpeg"/>
<item id="page1img" href="images/page1.jpg" media-type="image/jpeg"/>
<item id="page2img" href="images/page2.jpg" media-type="image/jpeg"/>
<item id="page3img" href="images/page3.jpg" media-type="image/jpeg"/>


</manifest>

<!-- The spine determines the order pages are presented -->

<spine toc="ncx">
<itemref idref="cover"/>
<itemref idref="page1"/>
<itemref idref="page2"/>
<itemref idref="page3"/>
</spine>

<!-- The guide points to two specific Kindle menu links -->
<!--(the "cover" menu link is generated by the entry in the metadata section above)-->

<guide>
<reference type="toc" title="Cover" href="html/cover.html"></reference>
<reference type="text" title="Go To Beginning" href="html/page1.html"></reference>
</guide>

</package>

AlPe
04-29-2013, 12:19 PM
Your CSS items are not closed:


<item id="covercss" href="css/cover.css" media-type="text/css">
<item id="css1" href="css/page1.css" media-type="text/css">
<item id="css2" href="css/page2.css" media-type="text/css">
<item id="css3" href="css/page3.css" media-type="text/css">


they should be:


<item id="covercss" href="css/cover.css" media-type="text/css"/>
<item id="css1" href="css/page1.css" media-type="text/css"/>
<item id="css2" href="css/page2.css" media-type="text/css"/>
<item id="css3" href="css/page3.css" media-type="text/css"/>


This might cause the failure in looking up for ids in manifest from idrefs in spine.

AlPe
04-29-2013, 01:06 PM
I confirm, open <item>'s reproduce exactly "Error(opfparser):E20004: the id in the spine does not match any item in the manifest" error.

BTW, before running kindlegen, validate your EPUB file with EpubCheck and/or FlightCrew (if EPUB 2).

krausj
04-29-2013, 05:03 PM
Thanks so much! I can't believe I missed that. I changed it, and tried again to convert it, but this time I got different errors which I can't make sense of. I pasted the errors below. It seems like something is searching for my files in a completely wrong folder?


Info(prcgen):I1047: Added metadata dc:Creator "Daryl Alexy"

Info(prcgen):I1047: Added metadata dc:Publisher "PUBLISHER NAME"

Info(prcgen):I1047: Added metadata fixed-layout "true"

Info(prcgen):I1047: Added metadata orientation-lock "landscape"

Info(prcgen):I1047: Added metadata original-resolution "600x1024"

Info(prcgen):I1047: Added metadata zero-gutter "true"

Info(prcgen):I1047: Added metadata zero-margin "true"

Info(prcgen):I1047: Added metadata dc:Subject "ENTER LIBRARY OF CONGRESS HEADINGS HERE"

Info(prcgen):I1047: Added metadata dc:Rights "Copyright 2013 - All Rights Reserved"

Info(prcgen):I1047: Added metadata dc:Type "FICTION/Children's/humor/illustrated."

Info(prcgen):I1047: Added metadata dc:Description "ENTER BOOK BLURB HERE"

Info(prcgen):I1002: Parsing files 0000004

Info(prcgen):I1003: Parsing file URL: cover.html

Warning(prcgen):W14010: media file not found C:\Users\STUMPY~1\AppData\Local\Temp\mbp_7DD_4_1D_ 15_3A_2F_174_DC4_165C_1\html\images\cover.jpg

Info(cssparser):I10005: CSS file not found "C:\Users\STUMPY~1\AppData\Local\Temp\mbp_7DD_4_1D_ 15_3A_2F_174_DC4_165C_1\html\css\cover.css"

Info(prcgen):I1003: Parsing file URL: page1.html

Info(cssparser):I10005: CSS file not found "C:\Users\STUMPY~1\AppData\Local\Temp\mbp_7DD_4_1D_ 15_3A_2F_174_DC4_165C_1\html\css\page1.css"

Info(prcgen):I1003: Parsing file URL: page2.html

Info(cssparser):I10005: CSS file not found "C:\Users\STUMPY~1\AppData\Local\Temp\mbp_7DD_4_1D_ 15_3A_2F_174_DC4_165C_1\html\css\page2.css"

Info(prcgen):I1003: Parsing file URL: page3.html

Warning(prcgen):W14010: media file not found C:\Users\STUMPY~1\AppData\Local\Temp\mbp_7DD_4_1D_ 15_3A_2F_174_DC4_165C_1\html\images\page3.jpg

Info(cssparser):I10005: CSS file not found "C:\Users\STUMPY~1\AppData\Local\Temp\mbp_7DD_4_1D_ 15_3A_2F_174_DC4_165C_1\html\css\page3.css"

Info(prcgen):I1016: Building enhanced PRC file

Info(prcgen):I1015: Building PRC file

Info(prcgen):I1049: Building table of content URL: C:\Users\STUMPY~1\AppData\Local\Temp\mbp_7DD_4_1D_ 15_3A_2F_174_DC4_165C_1\toc.ncx

Error(prcgen):E24010: Hyperlink not resolved in toc (One possible reason can be that the link points to a tag with style display:none):C:\Users\STUMPY~1\AppData\Local\Temp \mbp_7DD_4_1D_15_3A_2F_174_DC4_165C_1\html\page01. html#

Error(prcgen):E24001: The table of content could not be built.

DiapDealer
04-29-2013, 05:26 PM
Sounds like a structural issue. All those hrefs in the OPF file need to be relative to the OPF file in the epub's directory structure. And the file/folder names are case-sensitive. Make sure your folders are names 'html', 'css', images', etc. and not 'Html', 'Css' and 'Images'.

According to your OPF, your epub is constructed as follows (strictly from the perspective of the OPF file):
css/
cover.css
page1.css
page2.css
page3.css
html/
cover.html
page1.html
page2.html
page3.css
images/
cover.jpg
page1.jpg
page2.jpg
page3.jpg
fonts/
Booter_5-0.ttf
toc.ncx
content.opf

You really should consider using an ePub validator before tossing one into Kindle Previewer.

AlPe
04-30-2013, 06:59 AM
I agree with DiapDealer.

1) You need to check your ebook directory hierarchy, and make sure that the references to resources (like images referenced by XHTML pages) are relative;

2) Before attempting converting to Kindle format, use an EPUB validator, which --- in case --- will give you better error/warning messages than kindlegen/Kindle Preview.