Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-19-2024, 02:39 PM   #1
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 92
Karma: 10
Join Date: Jan 2020
Device: kindle
sigil error invalid CEN header (bad signature)

I have suddenly developed this error when checking with epubcheck validator using sigil 2.3

Col: -1: FATAL(PKG-008): Unable to read file ""invalid CEN header (bad signature)"".
increase is offline   Reply With Quote
Old 08-19-2024, 03:00 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by increase View Post
I have suddenly developed this error when checking with epubcheck validator using sigil 2.3

Col: -1: FATAL(PKG-008): Unable to read file ""invalid CEN header (bad signature)"".
What platform? Which epubcheck version? Have you properly installed installed java (via jre or jdk)?
KevinH is offline   Reply With Quote
Advert
Old 08-19-2024, 03:05 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Based on a google search ...

Invalid CEN header usually shows up when you have a corrupted zip/jar file.

So probably you have corrupted the epubcheck java jar file. You might want to try replacing it with a freshly downloaded copy.
KevinH is offline   Reply With Quote
Old 08-19-2024, 03:07 PM   #4
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 92
Karma: 10
Join Date: Jan 2020
Device: kindle
Quote:
Originally Posted by KevinH View Post
What platform? Which epubcheck version? Have you properly installed installed java (via jre or jdk)?
Using windows 10 java installed correctly, using 0.4.6.3 by Doitsu.

Everything was working fine until I made some edits then the error appeared, I have not seen this error before and cannot find any info related to Sigil

I re installed the epubcheck zip and ran the check and it upgraded the epubcheck to 5.1 and re installed the jar file, but the error is still the same message

Last edited by increase; 08-19-2024 at 03:26 PM.
increase is offline   Reply With Quote
Old 08-19-2024, 03:23 PM   #5
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
So probably you have corrupted the epubcheck java jar file.
It's also possible that the epub file (which is a zip file) was corrupted and epubcheck failed to read it. Or are you getting this error message for every epub that you're checking?

What's your operating system?

Last edited by Doitsu; 08-19-2024 at 03:27 PM.
Doitsu is offline   Reply With Quote
Advert
Old 08-19-2024, 03:31 PM   #6
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 92
Karma: 10
Join Date: Jan 2020
Device: kindle
Quote:
Originally Posted by Doitsu View Post
It's also possible that the epub file (which is a zip file) was corrupted and epubcheck failed to read it. Or are you getting this error message for every epub that you're checking?

What's your operating system?
My backup copies of the same epub file are ok no errors, only this one I am on windows 10
increase is offline   Reply With Quote
Old 08-19-2024, 05:21 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
I found the following similar bug report:
Spoiler:

I am generating ePub of size more then 2 GB.

I create zip file first and then rename to .epub

I am using zip64

Python:
zp = zipfile.ZipFile(zipFileName, "w", zipfile.ZIP_DEFLATED, allowZip64=True)

more details: http://stackoverflow.com/questions/3...all-size-files

Then I pass ePub to ePub Checker and this give following exception.

FATAL(PKG-008): ./NOID.epub/NOID.epub(-1,-1): Unable to read file 'invalid CEN header (bad signature)'.

these means that epub can not read by the ePub Checker, so it will not given any error from ePub.

Java Version:

$ java -version
java version "1.7.0_101"
OpenJDK Runtime Environment (rhel-2.6.6.4.el6_8-x86_64 u101-b00)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
ePubcheck Version:
$ /opt/apache-tomcat-8.0.0/webapps/epubcheck4.0.1/epubcheck.jar

If Zip i.e. ePub file size is less than 2 GB then this error is not coming, but Zip i.e. ePub file size is more than 2 GB then this error is coming.


So it appears that some Java Virtual Machines releases do not support unpacking zip files that are greater than 2GB, which is overly massive for a epub.

Would your epub size be greater than 2GB? If so, you probably need a java jdk version that can read and write Zip64 format.

There was a recent regression in released java versions that impacted this as many zip creators set the extra data field to be 0 which also causes an exception to be thrown which ends up with this same error message.

So the java version you have does not like the zip that is created by python3 in the epubcheck python plugin code.

Last edited by KevinH; 08-19-2024 at 05:37 PM.
KevinH is offline   Reply With Quote
Old 08-19-2024, 05:53 PM   #8
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 92
Karma: 10
Join Date: Jan 2020
Device: kindle
Yes my epub is rather large, but I think I have narrowed down the error to an image that I copied and pasted, I am working on that now, thanks for your help
increase is offline   Reply With Quote
Old 08-20-2024, 03:55 AM   #9
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 92
Karma: 10
Join Date: Jan 2020
Device: kindle
still not having any success removing the error, I found this post
Error: Invalid CEN header (bad signature)
Here is the fix, You need to specify your binary media types for your gw api otherwise it will get treated as utf-8 text which in this case manifested itself by losing the signature data.

binaryMediaTypes: ["multipart/form-data", "application/zip"]

does this have any bearing re sigil files
increase is offline   Reply With Quote
Old 08-20-2024, 08:59 AM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
You do not have mulitipart form data. You are not uploading anything. There is no form.

Is your epub truly bigger than 2 GB in size?

Have you tried updating to an older or newer java version on your machine since as I pointed out some recent java jdk/jre versions are broken in relation to handling zip files created by other tools.

See:
https://bugs.openjdk.org/browse/JDK-8315828

https://bugs.openjdk.org/browse/JDK-8313765

Last edited by KevinH; 08-20-2024 at 10:43 AM.
KevinH is offline   Reply With Quote
Old 08-20-2024, 12:26 PM   #11
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by increase View Post
Here is the fix, You need to specify your binary media types for your gw api ...
What do you mean by gw api? The plugin doesn't use any API except for the Sigil Python API and a custom Python function that uses zipfile.ZipFile for zipping up epub folders.
Unless the zipfile.ZipFile parameters have changed in the new Python version that comes with Sigil, there shouldn't be any problems.

Quote:
Originally Posted by increase View Post
does this have any bearing re sigil files
No, all the plugin does is zip up all epub files and run epubcheck with the temp .zip file as the input file.

Whatever your problem is, it's not caused by Sigil.

I just tested the plugin with a 50MB epub file and didn't get any error messages.

BTW, the Java version on my machine is:

Code:
java version "1.8.0_421"
Java(TM) SE Runtime Environment (build 1.8.0_421-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.421-b09, mixed mode)
Unless you need a higher Java version for other apps, downgrading Java might help, because as KevinH has already mentioned, some higher versions have a bug that produces the error message that you got.
Doitsu is offline   Reply With Quote
Old 08-20-2024, 05:06 PM   #12
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 92
Karma: 10
Join Date: Jan 2020
Device: kindle
Quote:
Originally Posted by Doitsu View Post
What do you mean by gw api? The plugin doesn't use any API except for the Sigil Python API and a custom Python function that uses zipfile.ZipFile for zipping up epub folders.
Unless the zipfile.ZipFile parameters have changed in the new Python version that comes with Sigil, there shouldn't be any problems.


No, all the plugin does is zip up all epub files and run epubcheck with the temp .zip file as the input file.

Whatever your problem is, it's not caused by Sigil.

I just tested the plugin with a 50MB epub file and didn't get any error messages.

BTW, the Java version on my machine is:

Code:
java version "1.8.0_421"
Java(TM) SE Runtime Environment (build 1.8.0_421-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.421-b09, mixed mode)
Unless you need a higher Java version for other apps, downgrading Java might help, because as KevinH has already mentioned, some higher versions have a bug that produces the error message that you got.
I re installed sigil and Java and the error has now disappeared
increase is offline   Reply With Quote
Old 08-20-2024, 09:12 PM   #13
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Then Java was it. Thanks for letting us know. Glad you got it working.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ZipImportError:bad local file header ..\pylib.zip luerman Calibre 2 09-19-2019 06:06 PM
ZipImportError: bad local file header:C:\Program Files (x86)\Calibre2\aap\pylip.zip Anders Gutmann Calibre 2 05-27-2018 06:46 PM
Invalid Zip file - local header is damaged Francois Driesen Conversion 3 09-18-2014 06:07 AM
Bad magic number for file header error RedCanyoneer Devices 8 03-13-2013 11:29 AM
error message: ERROR ITMS-4099: "Invalid ISBN: [#] at Book (MZItmspBookPac NewDay ePub 3 10-07-2010 01:47 PM


All times are GMT -4. The time now is 08:19 PM.


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