06-26-2017, 11:21 AM | #1 |
Banned
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
|
Recreating Container.xhtml
Not long ago, I started a thread to discuss my Container.xml file, which had mysteriously vanished. I fixed the problem by creating a new epub and importing all the files from the damaged epub into it.
I then found a second thread discussing the same problem @ https://www.mobileread.com/forums/sh...d.php?t=225261 My understanding is that Sigil automatically recreates the file when you open it. Well, the same thing just happened - my file Container.xml just vanished. I closed the epub and reopened it, but it's still missing. I then shut down Sigil and reopened it. But my images still don't display, and when I validate my epub in Epub-Checker, I get the error message "ERROR RSC-001 Geobop3.0.epub File 'META-INF/container.xml' could not be found." So is there some way to manually create this file? Actually, the first problem is finding it; it's apparently invisible. This reminds me of another problem I've had - vanishing images. I fixed that by backing up all my images. So if the images in an ePub disappear, I just reimport them from my backup folder. But I don't know how to recreate Container.xml. Any ideas? Thanks. Last edited by SigilBear; 06-26-2017 at 11:30 AM. |
06-26-2017, 11:42 AM | #2 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
As we explained earlier, Sigil will not create/write an epub without a container.xml file so something very strange is happening. My guess is some software is either playing around with the epub after Sigil creates it, or some anti-virus software is interfering with Sigil creating it. Its that or you or something is directly looking at the files and manipulating them inside Sigil's temp disk space, which is a very bad idea.
For example, if you are on a Mac and leave your machine on over 24hrs (say over a weekend) and don't close Sigil, the Mac OS itself will remove files from its temp for no valid reason, that can cause this problem. That is why we allow users to set Sigil's temp directory if need be. So next time you get an epub that Sigil has supposedly created without a container.xml check its modification date and time to see when it was last manipulated. If you are on a Mac or Linux box, please try running the following command on that epub and paste its output here. unzip -t PATHTOYOURPROBLEMEPUB That will show us modification times of the contents and test the zip (epub) for errors. Please let us know what you see. Kevin |
Advert | |
|
06-26-2017, 11:45 AM | #3 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Also, how could you tell inside Sigil that the container.xml file was missing? It is not shown in the BookBrowser since users should not be changing it in any way.
|
06-26-2017, 11:45 AM | #4 |
Banned
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
|
Wow, that's probably the answer right there. Weird.
|
06-26-2017, 11:46 AM | #5 |
Banned
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
|
|
Advert | |
|
06-26-2017, 11:47 AM | #6 |
Banned
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
|
One more question: If I use eCan Crusher to unzip this ePub, then create a new ePub and import the files from the old one, is there a way to make the files import in the same order? I have over a hundred text files, and it's a pain in the butt to have to reorder them.
Thanks. |
06-26-2017, 11:50 AM | #7 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Yes, it is weird. The MacOS simply cleans up its temp folder by removing files/folders that are untouched after a set time no matter if an application is open and using them.
This is a serious bug for people who do not close out and exit Sigil for very very long (over 24 to 48 hours). If you are on a Mac and do things like that, you should create a Sigil specific temp folder (and never play around inside of it!) and use Sigil's preferences to choose it to prevent to OS "housecleaning" from messing around with things. Same is true for most spps that use temp files on a Mac. |
06-26-2017, 11:53 AM | #8 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Use Sigil to create a new empty epub, unzip it and copy the META-INF folder and its contents and stick them into the broken epub in the same spot.
|
06-26-2017, 12:01 PM | #9 |
Banned
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
|
Hmmm, that didn't work, but at least I know how to find the META-INF folder now. I'll try it again...
|
06-26-2017, 12:02 PM | #10 | |
Grand Sorcerer
Posts: 27,962
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Last edited by DiapDealer; 06-26-2017 at 12:05 PM. |
|
06-26-2017, 12:04 PM | #11 |
Grand Sorcerer
Posts: 27,962
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
06-26-2017, 12:05 PM | #12 |
Banned
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
|
|
06-26-2017, 12:09 PM | #13 |
Grand Sorcerer
Posts: 27,962
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
06-26-2017, 12:14 PM | #14 |
Banned
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
|
If I have an invisible file that obviously isn't working, then there isn't much point continuing down that path, is there? I started a new thread and got some good tips that actually fixed the problem, which was the whole point of my question.
By the way, the fix KevinH suggested does indeed work. It turned out that my images had vanished again, making me think it wasn't working. But I replaced the images, and it works fine. Just create a new ePub, open it and the original damaged ePub with eCan Crusher, then copy the META-INF folder from the new ePub over the the META-INF in the damaged ePub. Then make sure your images are still there. |
06-26-2017, 12:24 PM | #15 |
Grand Sorcerer
Posts: 27,962
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The problem I have with this is that it's completely unnecessary if you're using and saving with Sigil. It's also completely unrelated to using Sigil. If your container.xml file is disappearing, it's something other than Sigil that's causing the problem. You're free to take up your "how to manually fix some mysteriously broken epubs" in the epub format forum if you like, but Sigil doesn't need any more threads about missing container.xml files.
Last edited by DiapDealer; 06-26-2017 at 12:26 PM. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
container.xml problems | SigilBear | Sigil | 4 | 06-11-2017 09:43 PM |
Some files.html & toc.xhtml (also Cover.xhtml) | chaot | Workshop | 23 | 02-13-2017 12:20 PM |
Container methods, various scenarios | jackie_w | Development | 15 | 11-09-2015 02:32 PM |
Recreating my Library on my server takes weeks now | mohataj | Calibre | 9 | 09-12-2015 11:17 PM |
Recreating library on new computer? | jeather | Calibre | 5 | 01-31-2013 02:22 PM |