Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-02-2018, 05:01 AM   #1
gianni_fed
Member
gianni_fed began at the beginning.
 
Posts: 17
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
Attached Thumbnails
Click image for larger version

Name:	Winrar error.jpg
Views:	39
Size:	126.4 KB
ID:	165998   Click image for larger version

Name:	Unzip error.jpg
Views:	36
Size:	104.5 KB
ID:	165999  
Attached Files
File Type: txt Nuovo documento di testo (2).txt (2.3 KB, 16 views)

Last edited by gianni_fed; 09-02-2018 at 05:28 AM.
gianni_fed is offline   Reply With Quote
Old 09-02-2018, 05:42 AM   #2
sealbeater
Guru
sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.
 
Posts: 644
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.
sealbeater is offline   Reply With Quote
Advert
Old 09-02-2018, 07:21 AM   #3
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 3,801
Karma: 88073705
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).
gmw is offline   Reply With Quote
Old 09-02-2018, 07:33 AM   #4
gianni_fed
Member
gianni_fed began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Oct 2015
Device: none
zip files

Quote:
Originally Posted by sealbeater View Post
As far as I know, zip files don't support recovery records.
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
gianni_fed is offline   Reply With Quote
Old 09-02-2018, 07:49 AM   #5
gianni_fed
Member
gianni_fed began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Oct 2015
Device: none
Quote:
Originally Posted by gmw View Post
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).
Hello,
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
Attached Thumbnails
Click image for larger version

Name:	Sigil error.jpg
Views:	45
Size:	111.1 KB
ID:	166003  

Last edited by gianni_fed; 09-02-2018 at 07:57 AM.
gianni_fed is offline   Reply With Quote
Advert
Old 09-02-2018, 08:09 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 19,008
Karma: 97915638
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by gianni_fed View Post
More in general, why use file compression in Calibre?
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.
DiapDealer is offline   Reply With Quote
Old 09-02-2018, 08:18 AM   #7
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 3,801
Karma: 88073705
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.
gmw is offline   Reply With Quote
Old 09-02-2018, 08:35 AM   #8
sealbeater
Guru
sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.
 
Posts: 644
Karma: 1752814
Join Date: Jan 2008
Device: Sony Reader PRS-505 : Onyx Boox Max : Sony PRS-900 : Onyx Kepler Pro
Quote:
Originally Posted by gianni_fed View Post
Yes, but why use zip instead of rar? Just because zip is open source?
Probably. I prefer rar for zip for that exact reason, recovery records. Sorry you lost your books, maybe you can generate a list and recover them some other way. Good luck.
sealbeater is offline   Reply With Quote
Old 09-02-2018, 01:01 PM   #9
gianni_fed
Member
gianni_fed began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Oct 2015
Device: none
Quote:
Originally Posted by gmw View Post
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.
Thanks to all,
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.
gianni_fed is offline   Reply With Quote
Old 09-05-2018, 01:17 AM   #10
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 3,801
Karma: 88073705
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
Quote:
Originally Posted by gianni_fed View Post
Thanks to all,
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
I'm still confused. I've never used the "Save to disk" feature because my library is all local and all backups are part of my usual backup routine. I just tried now, and it seems Save to disk saves all the files separately - so you should be able to test the files in your backup and see if they are readable. If your backup files are good you should be able to use them replace the corrupted originals - presumably delete and reimport. If your backups are not good, then you are probably stuck trying to recover your files from wherever you downloaded them originally.

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.)
gmw is offline   Reply With Quote
Old 09-05-2018, 01:35 AM   #11
BetterRed
null operator
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: 11,087
Karma: 10563148
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by gmw View Post
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.)
@gmw - Export/Import was implemented to facilitate one-off transfer of calibre libraries and configuration data (plugins, preferences, customisations etc) between computers, including from one platform (operating/file system) to another platform - e.g. Windows/NTFS to Linux/Ext4. Anticipated usage was when someone got a new computer, but not as a backup medium.

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
BetterRed is online now   Reply With Quote
Old 09-05-2018, 01:37 AM   #12
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 3,801
Karma: 88073705
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
Quote:
Originally Posted by BetterRed View Post
@gmw - Export/Import was implemented to facilitate one-off transfer of calibre libraries and configuration data (plugins, preferences, customisations etc) between computers, including from one platform (operating/file system) to another platform - e.g. Windows/NTFS to Linux/Ext4. Anticipated usage was when someone got a new computer, not backups. [...]
I guessed that was probably the case, I mentioned mainly because I wondered whether the OP may have accidentally created something using this feature and was expecting to be able to read it in other products.
gmw is offline   Reply With Quote
Old 09-05-2018, 05:47 AM   #13
gianni_fed
Member
gianni_fed began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Oct 2015
Device: none
Quote:
Originally Posted by gmw View Post
I guessed that was probably the case, I mentioned mainly because I wondered whether the OP may have accidentally created something using this feature and was expecting to be able to read it in other products.
Hello,
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
gianni_fed is offline   Reply With Quote
Old 09-05-2018, 07:33 AM   #14
BetterRed
null operator
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: 11,087
Karma: 10563148
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
BetterRed is online now   Reply With Quote
Old 09-05-2018, 07:37 AM   #15
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,119
Karma: 1404167
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
Divingduck is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 02:46 AM.


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