![]() |
#1 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Problem with epub zip files sent via Wireless Device?
I'm seeing problems where some of the epubs sent to CC in my phone from Calibre have (slightly) damaged zip files when they arrive.
(For anyone who didn't know, an epub is a zip file with a bit of standardized structure.) I say '(slightly)' because some book readers, including Calibre, can still read them. I noticed the problem from Android app @Voice Aloud Reader reporting "This ebook file appears to be damaged" for some, but not all, of my recent uploads. When I reported it to them with the epub, they pointed out the damaged zip. I'm using Calibre 4.18 on Windows 10 and Calibre Companion 5.4.4.10 (401) on Android 10(?) on a Samsung Galaxy S10e, connecting as a Wireless Device. Attached is one of the damaged epubs as copied from the CC dir on the phone and exhibits the following errors. The same book taken from the Calibre dir directly, saved from Calibre, and sent to a Nook from Calibre has no issues. Errors: Spoiler:
Any help getting this fixed would be appreciated. |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,910
Karma: 3933245
Join Date: Sep 2012
Location: Salzburg AT
Device: Bigme 3/3, Boox 4/14, Like-/Meebook 2/8, Tolino 1/10, Ki/Ko 0/8
|
Quote:
Standard routines from the operating system are used here. If so, then the problem lies there, or else in a hardware defect. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
I have seen the same epub sent without issue through the other parts of the path (Calibre) and if it was a hardware defect on the phone I would expect to see low level read errors, not just zip file errors. The fact Calibre can still read these and silently fixes them suggests to me that it may be a differing OS/library thing of some kind. I will be looking at the Calibre code for inspiration, but obviously I can't do that with CC. |
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
But cc does not open the zip( the eoub). It simply files it and hands a copy to reader app as needed. So it can't be the cause of the corruption.
But anyway. There are 2 connection options. Content server and wireless device. See if both corrupt or only one of the two. That may help narrow things down. And also try getting the books from calibre using the device browser to connect. Type in the calibre content server URL.. Not using cc at all. Compare what happens with all 3 routes Ps what app is actually reading the book. Try repairing, reinstalling that app. |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I suspect that something on the calibre side is borking the epub when it is created to be copied. When sending via a device, calibre creates a new copy, applies plugboards and cover changes, embeds new metadata, then hands it to the device driver (the wireless device). Do you use any plugins that could get in the middle of that, such as an epub metadata writer? |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
Quote:
Good hypothesis, if it is calibre side, then leaving out cc and using a device browser to fetch from calibre should show the same corruption I can't type the URL syntax for that test from memory,. But it is easily found. |
|
![]() |
![]() |
![]() |
#7 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I was not aware that CC doesn't open the zip file. As you say, that likely points back to code in Calibre instead. I have a couple metadata plugboards that are applied that I've used for years, but no metadata modifying plugins.
I'm not able to find anything about manually testing the wireless device interface. Can I get a pointer or a phrase to google for that? Pointing my browser at ipaddr:9090 gets some basic library metadata in JSON after a lengthy (~5minute) wait. I am assuming (possibly wrongly) that the 'smart device' AKA wireless device interface is different than the Content Server. I also noticed that the corrupted zip files were ~2x the size of the correct one. Of course, now I can't duplicate the problem even sending the same file from Calibre. So that helps a lot. And now I can't find any other cases of it, just to insure I look crazy. ![]() Until I can duplicate the problem again, it's basically impossible to troubleshoot. So I'll go away again for now. Thanks for your help, folks. |
![]() |
![]() |
![]() |
#8 | |||||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
Koreader has an independently-written client. If it is reasonable for you to install it then the next time something breaks you could use koreader to see if it breaks in the same way. You could also look at the code of this client, given that it is open source. You can also look at the code for the wireless device driver. Quote:
Quote:
Quote:
|
|||||
![]() |
![]() |
![]() |
#9 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
|
![]() |
![]() |
![]() |
#10 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Okay, I believe I've tracked down this problem and I believe that it is with the Calibre Companion android app.
It looks like CC, when writing an epub that already exists, overwrites the existing file but doesn't truncate the file if the new epub is shorter. I'll spare you the details of how I got there and just tell you about the proof. I added debug output Calibre to report the bytes sent, and save the temp epub created to be sent. After picking one epub, I:
I ran the same test on koreader and did not see this issue. Before you ask, I have checked and in all the cases I can still find the files for, the epub was legitimately shorter due to text or cover image changes. The only user-level work around I see right now is to explicitly delete each book before sending it. If there is a better place I should be reporting this to make sure the new CC team see it, please let me know. |
![]() |
![]() |
![]() |
#11 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Good hunting! |
|
![]() |
![]() |
![]() |
#12 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I confess to complete ignorance of the Android SAF.
But I do keep my CC files on 'Phone' instead of 'SD Card', FWIW. |
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
If you are running Android 10 and if you changed the CC folder name then you are using the SAF. And it is possible that the new devs have removed that one exception; using the default folder CC creates at install time. And thinking about it, since they are making releases they must have changed it, because they must "target" a version of Android that forces use of the SAF.
|
![]() |
![]() |
![]() |
#14 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I had to change from SD Card to Phone to avoid some other permissions problem a while back, so I think you are doubly correct.
Right now I'm trying to figure out why FBReader (on Android) and Calibre's reader work fine with the corrupt zip files. In Calibre's case, it looks like it falls back to calibre.utils.localunzip which ignores the fact the zip central dir structure isn't in the right place and reads the 'local' filenames. |
![]() |
![]() |
![]() |
#15 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,834
Karma: 4604429
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
FYI, I saw there was a CC android app update recently; so I went back and tested for this problem again.
It's still happening for me. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem converting from zip to epub. | nstock | Conversion | 2 | 10-31-2017 03:18 AM |
ERROR:Problem starting the wireless device | mariaclaudia | Devices | 15 | 10-27-2017 08:15 AM |
Wireless Device Connection Problem | HisLittleOne | Calibre Companion | 1 | 12-09-2014 02:53 AM |
Problem with zip to epub | hstiver | Conversion | 8 | 02-01-2011 01:55 PM |
How do I zip my files into an ePub? | eosrose | ePub | 5 | 05-06-2010 05:07 PM |