Issue opening my .kra file

I’ve been using Krita for about a month or so give or take. I’ve run into an issue where Krita can’t open an animation ive been working on. I will post the error message.

I looked through a couple troubleshooting options and got as far as here:

My files still seem to be here and i’m able to view the preview image; however even after zipping and unzipping the file it’s unable to be processed in Krita. I would link the file in question but it won’t allow me to link a .kra file here. If anyone could help i’d appreciate it so much, I hate to think I may have to start over when the file is right in front of me.

You will have to run maindoc.xml through xmllint and repair it. I’m not sure what could have happened to it, but the error message clearly says it’s broken.

As for providing the .kra file, use google driver, dropbox, weshare or a similar file sharing service and put the url in your message?

Hey thanks for the reply back! So I used xmllint to repair maindoc.xml and it says it did repair it, however i’m not sure how to remove the old xml and replace it with the newly repaired version. Also I did post the file into a folder on Google Drive which I will link now:
Another note: I noticed that when doing a Test Archive using 7zip, it gives a list of layers with the title: CRC failed. There are also two Headers Errors, however i’m not sure what to make of that info.

Your link is a ‘Google sharing’ link and requires a Google account sign in to access it. I think these are intended for collaborative working/sharing.
A ‘Share with anyone’ link would be a better idea.

If you’ve fixed the old maindoc.xml file, you can rename the .kra file to .zip and unzip it, replace the old .xml file with the new one and then rezip it and rename to .kra.
I’ve no idea what the CRC failures and Header Errors are about.

Here’s the new link:

Didn’t realize it wasn’t viewable for everyone my bad.

I wasn’t sure how to remove the old maindoc.xml file and replace it with the new one; I use 7zip to access the archives to see everything, however i’m unable to actually alter them that way. I end up extracting the file posted above with 7zip and am able to access and edit the individual files.

When I group everything up and zip it, it gets turned into a folder. I can’t seem to turn it back into a .kra file. I am able to unzip it though but it stays as a folder.

Sorry if this is an info dump, it’s my first time dealing with a lot of this stuff and I want to be as detailed as possible in my experience so that it could potentially help anyone that might see this and help you guys helping me out

7zip (and other archiving-zipping utilities will show you what’s inside a zip file but you can’t do anything to them until you extract them (unzip the .zip file).

If you rename a .kra file to a .zip file and unzip it, you get all the internal files extracted out of that zip file.
If you zip up a collection of files you should get a .zip file that has them all packed inside it. You turn it back into a .kra file by renaming it from .zip to .kra. (Right click it and choose the rename option.)

A .kra file is a collection of files that has been zipped up and gven a .kra extension (by krita). You can do the same thing manually.

If you have a lot of CRC failures with the internal layer files then that sounds like something far more serious than a problem with just the maindoc.xml file.

Looks like the zip file itself is corrupt:

Archive: …/F20_BouncingBall_Freeman_Part2_Keys.kra
error: expected central file header signature not found (file #54).

I unzipped the file, and rezipped it, and it loaded, though a number of layers were broken and didn’t load.

I actually don’t understand how it’s still possible to create broken files like this with Krita 4.3.0 or 4.4.0: we even try to load the maindoc.xml file from a .kra file after saving to make sure everything saved correctly.

Just my two cents, I’d start and finish a project with the same version of krita. Maybe you did, I’m just curious

File corruption can happen for a lot of reasons maybe it’s not even krita, but a good starting point looking for bugs in krita first

Thanks for the detailed explanation AhabGreybeard. I wasn’t sure if manually re-naming it actually changes anything. I tried changing the name by putting in .kra at the end of the file/folder but i’ll try again and see what I did wrong.

In the case of the corruption, the only thing I remember prior to it not working was trying to change the name of the file. After that I started having problems up till it eventually wouldn’t work. When you say the layers don’t load do you mean everything in the layers? Or do you mean a select couple of frames in the layers?

To answer Venn: Yes during my time working on this file I was using the same version of Krita. However after it wouldn’t load I attempted to run the latest version to see if that would fix it. The version I was using was the one prior to 4.4.0 I believe.

Another bit of info; I originally worked on the file with my laptop. I don’t think anything should have changed but I did send the file to my Gmail so that I could try and fix it on my desktop. Would sharing the file from my laptop help any?

And sorry for the late reply my notifications didn’t tell me anyone had replied.

Manually renaming a file doesn’t change what’s inside it. The extension of a filename tells the operating system and applications what can be expected to be found inside a file and hence how it ought to be treated. So, the OS opens krita if you double click on a .kra file and krita knows what’s supposed to be inside a .kra file.

Changing the filename from Aproject.kra to Bproject.kra should/will not affect it.
If the layers are so badly damaged that they’re not getting loaded then there’s no telling what’s gone wrong inside them.

The advice from @Venn is hyper-cautious and you can follow it if you’re hyper-cautious too but that should not be needed.

Sending the file from your laptop to your desktop via an email attachment should not change it in any way. (It’s quicker and easier to transfer files via a USB memory stick though, just saying.)
So no, there’s no point in sharing the same broken file.

I think this is one of the very rare times that a .kra file gets corrupted and unrepairable. I realise that’s not any comfort to you at this time.
This seems to happen with Windows systems and I can’t remember a report of it happening on a Linux system but there may be someone who knows otherwise.

For the future, being cautious, you can consider doing a regular Save Incremental Version, which does eat up disk space so after you’ve finished you can check that the latest is ok (by opening it) and delete the older ones. Then save a copy on a USB stick to be very cautious.

Or you can set up a multiple backup file stack of a limited depth at:
Settings -> Configure Krita -> General group -> File Handling tab, then adjust the number of backup files kept, then do regular Saves.
The disadvantage of that method is that if there is data corruption of a type that isn’t noticed as you’re workng on it, the good backups will eventually be pushed out of the bottom of the stack.

Next time I will increment and save. I use Maya and do that religiously however I noticed Krita has an autosave feature and hence didn’t worry too much about incremental saving.

Problem is I couldn’t even find the autosave file after my primary file got messed up.

All of this is definitely a learning experience. If I have to I will start over but I did see @boud say he was able to recover some of the file. Even having a portion of it is fine and i’ll fill in the layers that got corrupted.

I did want to make sure I know exactly how to unzip and rezip the file though and then be able to access it through Krita.

So is it after selecting the file and putting it in a compressed (zipped) folder, you Extract All? I tried this and it doesn’t actually change it to a .kra file that I can access. It stays as a folder that I have to go in first to find the file.

Sorry if this is supposed to be more simple, i’m just struggling understanding the concept of converting a .zip to a .kra

The autosave file is intended for recovery after a crash (which normally is a rare event). If you close krita in the usual way then it’s assumed that you’ve done whatever saving you want to do and the autosave file is deleted.
The details of this and the other forms of saving and backup are explained here:

As usual, if you want to learn about it, don’t just read about it, do it and try simple experiments.

There should be a backup file called filename.kra~ in the same folder as your original and now damaged filename.kra (on your laptop?). That would contain the state of your project as it was before your last working session on it.
Normally, you won’t see that in the file explorer listings because that ‘~’ at the end marks it as a ‘hidden’ file so you have to set the View options to show hidden files. Rename it to filename-bak.kra (or whatever) then open it and see what it has inside.

‘Converting’ a .zip file to a .kra file is simple. You right-click it and chose the Rename option then change its name from ‘’ to ‘filename.kra’.

A .zip file isn’t a folder, it’s a file. It’s a special kind of file that contains compressed/packed versions of other files and/or folders of files. You might like to think of it as a ‘container’ but your operating system sees it as a file and treats it as a file because it is a file.
The best way to learn about them is to get a collection of random files and folders from your hard drive and practice zipping them up and then unzipping/unpacking/Extracting them.

1 Like