View Full Version : Can anyone tell me how to fix these validation errors?


grapplegirl
12-14-2010, 11:00 AM
# ERROR: 9780781405058-2.epub: length of first filename in archive must be 8, but was 19
# ERROR: 9780781405058-2.epub: Required META-INF/container.xml resource is missing

I am not even sure where to go to check these. Any help would be appreciated.

DMSmillie
12-14-2010, 11:53 AM
An EPUB file is essentially just a ZIP file, with the file extension .epub rather than .zip. One of the requirements of the EPUB standard is that the first file inside the zip archive is the file "mimetype" (which should also be uncompressed and unencrypted). The first error message you're getting:

# ERROR: 9780781405058-2.epub: length of first filename in archive must be 8, but was 19
- is indicating that the "mimetype" file isn't the first file inside the EPUB. The "mimetype" file is simply a text file, without any file extension, which contains the text:

application/epub+zip

Another requirement of the EPUB standard is that there should be a META-INF directory inside the EPUB file, containing the file "container.xml". That file contains some XML code that points to the location, inside the EPUB file, of the OPF file. The second error you're getting:

# ERROR: 9780781405058-2.epub: Required META-INF/container.xml resource is missing

- indicates either that there isn't a META-INF directory in the EPUB file, or that it doesn't contain the "container.xml" file.

Basically, these errors indicate that the files inside the EPUB file aren't properly structured, and perhaps not all of the required files are present.

If this is an EPUB you created yourself, grapplegirl, if you let us know what method you're using to create the EPUB, I'm sure someone will be able to advise on how to fix these problems.

grapplegirl
12-14-2010, 01:03 PM
An EPUB file is essentially just a ZIP file, with the file extension .epub rather than .zip. One of the requirements of the EPUB standard is that the first file inside the zip archive is the file "mimetype" (which should also be uncompressed and unencrypted). The first error message you're getting:


- is indicating that the "mimetype" file isn't the first file inside the EPUB. The "mimetype" file is simply a text file, without any file extension, which contains the text:

application/epub+zip

Another requirement of the EPUB standard is that there should be a META-INF directory inside the EPUB file, containing the file "container.xml". That file contains some XML code that points to the location, inside the EPUB file, of the OPF file. The second error you're getting:



- indicates either that there isn't a META-INF directory in the EPUB file, or that it doesn't contain the "container.xml" file.

Basically, these errors indicate that the files inside the EPUB file aren't properly structured, and perhaps not all of the required files are present.

If this is an EPUB you created yourself, grapplegirl, if you let us know what method you're using to create the EPUB, I'm sure someone will be able to advise on how to fix these problems.


thanks, Donna,
I am exporting from InDesign. I have never gotten this validation error in the past and would like to fix it prior to exporting.

I do see a container.xml file in the META-IMF folder. so i really don't get that one.

can i change the name of the archive file in the zip folder? If so where do i find it?

DMSmillie
12-14-2010, 02:30 PM
I'm afraid I've never used InDesign, so someone else who is familiar with using it to export to EPUB will hopefully be able to advise in that area.

can i change the name of the archive file in the zip folder? If so where do i find it?

Sorry - when I referred to "zip archive", I just meant zip file ("archive" is another name for files like zip files which are containers for other files).

Best I can suggest for now is to try re-exporting your book to EPUB - it's always possible something went wrong the first time.

You can also look inside the EPUB file you tried to validate, to see what's there - make a copy of the file, then change the file extension of the copy from .epub to .zip. You can then open it up in Winzip (or whatever zip utility you prefer to use), and see what's inside. I'd normally expect to see the mimetype file first, then the META-INF directory (containing the container.xml file, which should point to the location the OPF file), then a directory called OEBPS, which should contain the OPF file plus all of the book content files (XHTML, HTML, CSS, images, etc).

DaleDe
12-15-2010, 04:38 PM
You could download a copy of Sigil and open the epub in Sigil and resave it. Sigil will automatically fix lots of these kinds of errors.

Nelsea
12-18-2010, 08:00 AM
Hi All,

I am trying to validate my epub document as well and receiving below errors? Could someone please help?
1. ERROR: Lola's Guilt 181210 complete.epub/OEBPS/Text/License & Copyright.xhtml(80): attribute "align" not allowed at this point; ignored
2. ERROR: Lola's Guilt 181210 complete.epub/OEBPS/Text/License & Copyright.xhtml(80): attribute "border" not allowed at this point; ignored
3. Check finished with warnings or errors!

Much appreciated.

DMSmillie
12-18-2010, 08:38 AM
There are a couple of invalid attributes ("align" and "border") being used in line 80 of the "License & Copyright.xhtml" file inside your epub, Nelsea. You could try my and DaleDe's suggestions, above, and you might also find it useful to run the epub through FlightCrew (http://www.mobileread.com/forums/showthread.php?t=101016), an Epub validator created by the guy who created Sigil - it gives more easily understandable error messages with more information.

Edit to add: If you're not sure what change(s) to make to that HTML file to fix the error, copy and paste the problem line from that file here, and someone will help you identify what needs to be changed. End of edit

Nelsea
12-18-2010, 08:48 AM
Thanks Donna for your quick response.

Now i have another problem. I tried uploading the file on Lulu.com and they say:
Did not pass epubcheck-1.0.5 validation.
* Contains unmanifested files.
No idea what this means or how to fix this. Any suggestions would be greatly appreciated. Thanks again.

HarryT
12-18-2010, 09:13 AM
It means that there's one or more files in the ZIP archive that doesn't appear in the manifest in the OPF file. The only file that's allowed NOT to appear in the OPF is the OPF file itself.

Jellby
12-18-2010, 10:23 AM
The only file that's allowed NOT to appear in the OPF is the OPF file itself.

and mimetype, and container.xml, and encryption.xml...

Look for possibly hidden files created by your OS, things like "Thumbs.db" or ".DS_Store".