09-02-2018, 05:01 AM | #1 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2015
Device: none
|
ValueError: Not a ZIP file
I made a backup of my library and, to my amazement, Caliber has not copied a large number of books giving me this error: ValueError: Not a ZIP file.
In my experience, the ZIP format is not absolutely reliable, over the years I lost many files because I had zipped them, what I know is that if you do not put the "recovery record" when you compress a file and a "corrupt header" occurs in the zipped file, the latter is unrecoverable. From the analysis of the corrupt epubs, as can be seen in the enclosed images, the recovery record is absent, why? What do you know, is there a way to recover them? Thanks and bye, Gianni PS. sorry, I found also another error: File "site-packages\calibre\ebooks\metadata\epub.py", line 165, in get_zip_reader File "site-packages\calibre\ebooks\metadata\epub.py", line 148, in __init__ File "site-packages\calibre\ebooks\metadata\epub.py", line 98, in __init__ File "site-packages\calibre\ebooks\metadata\epub.py", line 153, in open File "site-packages\calibre\utils\zipfile.py", line 995, in read File "site-packages\calibre\utils\zipfile.py", line 1030, in open BadZipfile: Bad magic number for file header Last edited by gianni_fed; 09-02-2018 at 05:28 AM. |
09-02-2018, 05:42 AM | #2 |
Banned
Posts: 666
Karma: 1752814
Join Date: Jan 2008
Device: Sony Reader PRS-505 : Onyx Boox Max : Sony PRS-900 : Onyx Kepler Pro
|
As far as I know, zip files don't support recovery records.
|
Advert | |
|
09-02-2018, 07:21 AM | #3 |
cacoethes scribendi
Posts: 5,809
Karma: 137770742
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
Check out your files in another product. You might try Sigil - the epub editor, to see if it can make fixing the files easier. Or failing that, try 7zip or similar product (if necessary rename to give a .zip file extension), to make sure the problem lies in the file and not the program reading them. (There are some explicit requirements for zipping into an epub, it's possible the software used to generate your problem files failed to comply and so causing difficulties for software that expects epub OCF compliance. A more generic .zip file utility program may be able to recover the contents where Calibre fails.)
I've never had problems with corrupt zip files (especially in comparison to other compression formats) that could not be explained by file-transfer problems (and the last of those I had were years ago - touch wood). |
09-02-2018, 07:33 AM | #4 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2015
Device: none
|
zip files
Yes, but why use zip instead of rar? Just because zip is open source?
I would like to spend some money to have the almost certainty of not losing my files. Today I've lost 1041 books! More in general, why use file compression in Calibre? Today you can have tens of TeraByes for little money, maybe there's another reason that escapes me... Thanks and bye… Gianni |
09-02-2018, 07:49 AM | #5 | |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2015
Device: none
|
Quote:
thanks for your answer, I used Winrar, Winzip, Z-Zip trying to open the corrupt files, but none worked. Now I've tried Sigil, but you can see the result from the attached image!!! I would like to ask Kovid and all the developers of this wonderful program if you can modify Calibre so that it does not compress the files but save them in folders, subfolders and so on… Many thanks. Gianni Last edited by gianni_fed; 09-02-2018 at 07:57 AM. |
|
Advert | |
|
09-02-2018, 08:09 AM | #6 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm confused. If you don't want compression or zip files, why would you choose the epub format to archive your books? It's the epub format that dictates books be zip archives, not calibre. Moreover... calibre merely facilitates the storage/viewing of (and conversion to and from) existing ebook formats.
Last edited by DiapDealer; 09-02-2018 at 08:17 AM. |
09-02-2018, 08:18 AM | #7 |
cacoethes scribendi
Posts: 5,809
Karma: 137770742
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
Gianni, I'm not sure I fully understand your situation. Calibre is not the one responsible for defining epub as a zipped collection of files. It is just working with what epub is. If any other program has accessed those epubs then that is just as likely to be responsible for any corruption introduced (assuming the file was not corrupt when downloaded) as Calibre.
Your OP said: "I made a backup of my library and, to my amazement, Caliber has not copied a large number of books giving me this error: ValueError: Not a ZIP file." You may need to explain that: how exactly you made the backup, and how any resulting problems are thought to originate with Calibre. |
09-02-2018, 08:35 AM | #8 |
Banned
Posts: 666
Karma: 1752814
Join Date: Jan 2008
Device: Sony Reader PRS-505 : Onyx Boox Max : Sony PRS-900 : Onyx Kepler Pro
|
|
09-02-2018, 01:01 PM | #9 | |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2015
Device: none
|
Quote:
I begin to believe that the problem is in my PC, it may be in the operating system, because all the problems I have encountered in the "original" version of my library. I backed up with the "save on disk" Calibre function. Please, can someone help me? Thank you. Gianni Last edited by gianni_fed; 09-02-2018 at 01:09 PM. |
|
09-05-2018, 01:17 AM | #10 | |
cacoethes scribendi
Posts: 5,809
Karma: 137770742
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
Quote:
I notice that the library "Export/import all your calibre data" saves everything to a single folder as one or more files of what seems to be a proprietary format (at least 7zip fails to make proper sense of it) and so you would have to use Calibre to recover any data from that folder. (Which makes testing the backup a bit more difficult: presumably create a new library and then import into it using Calibre.) |
|
09-05-2018, 01:35 AM | #11 | |
null operator (he/him)
Posts: 20,553
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
And with Save to Disk, the Preference settings control what is saved, e.g. there are check boxes for the cover and opf files etc. BR |
|
09-05-2018, 01:37 AM | #12 | |
cacoethes scribendi
Posts: 5,809
Karma: 137770742
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
|
Quote:
|
|
09-05-2018, 05:47 AM | #13 | |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2015
Device: none
|
Quote:
Since I've lost 1041 books not in the copied library, but in the original library and, while I tried to copy this library on another disk Calibre not copied several books because they had a problem! So, I would like to come back to original problem, someone can tell me what Calibre try to do in these lines? calibre, version 3.30.0 ERRORE: Could not open e-book: Failed to read book, E:\D_Biblio\AA.VV_\I capolavori del Giallo (56402)\I capolavori del Giallo - AA.VV_.epub click "Show Details" for more information Traceback (most recent call last): File "site-packages\calibre\utils\ipc\simple_worker.py", line 284, in main File "site-packages\calibre\ebooks\oeb\iterator\book.py", line 65, in extract_book File "site-packages\calibre\customize\conversion.py", line 244, in __call__ File "site-packages\calibre\ebooks\conversion\plugins\epub_in put.py", line 266, in convert File "site-packages\calibre\utils\localunzip.py", line 231, in extractall File "site-packages\calibre\utils\localunzip.py", line 218, in _extractall ValueError: Not a ZIP file Thanks, Gianni |
|
09-05-2018, 07:33 AM | #14 |
null operator (he/him)
Posts: 20,553
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
The file "I capolavori del Giallo - AA.VV_.epub" is not a valid EPUB, because its not a valid ZIP file, as others have posted - an EPUB is a rebadged ZIP file.
Calibre will only read the content of files when they're added if: a) you have configured the Add Books auto-convert feature; or b) you use the get metadata from file option. Otherwise it just copies the file. What is the source of the EPUB files? BR |
09-05-2018, 07:37 AM | #15 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Reading the complete thread and I'am still confused what you are doing...
a) You did a backup of your calibre library. b) You are showing a program that tries to open a ZIP file and report a major error with opening an EPUB file. c) You are telling that you loose +1k books by backing up the calibre database. d) You are showing a report telling that the file you like to open isn't a valid EPUB file (calibre and Sigil). e) And you are telling that the RAR is better than ZIP. Well, this is a more philosophic statement what have nothing to do with your fileor backup problem. In this case it is simply a book format decision and not a calibre owned decision (especially for the problem you have for now). Calibre needs only to deal with existing book formats and have no influence on format definitions. But you don't tell exactly what you are doing. Nothing from what you wrote have to do with backup / restore so fare. There is a "not in fractional parts" story to tell. How should anyone give you a good support without knowing what exactly you are doing? By the way, it is common to tell also what calibre version and OS is involved in a problem. The big question is, how exactly did you make the backup and how did you restore. The error you are asking for tells you exactly what had happen if calibre tries to open the file. Your EPUB isn't a EPUB. This means either you have a corrupt file, format wise a corrupt zip archive or a non EPUB file with a wrong file extension. Calibre can't do anything with this file because of these specific information: a) "BadZipfile: Bad magic number for file header" b) "ValueError: Not a ZIP file" c) Sigil shows you exactly the same problem d) Your archive program too tells you there are major problems with the file. This all is nothing that indicate calibre as a root cause so fare. When something like this happen you will face out immediately tons of postings here as this is a elementary problem then. You or your system obviously did something outside calibre with your files (in case you hadn't problems before to open this files within calibre). Any idea? Best regards, DD |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bad Zip file | theducks | Calibre | 12 | 09-09-2018 09:58 AM |
Invalid Zip file?? | Joop | Library Management | 1 | 02-12-2015 08:58 PM |
Cannot Read .htm file auto-imported as zip file | Jimbo724 | Conversion | 2 | 07-24-2012 06:08 AM |
Saving to disk -> ValueError: I/O operation on closed file | Backi | Calibre | 2 | 05-05-2012 02:29 PM |
Where is the .exe file in the zip Calibre2opds file? | chilady1 | Related Tools | 4 | 09-17-2011 11:56 AM |