Error with saving certain documents

For some reason, I can’t save some of my documents anywhere on my computer. IT keeps giving me “Unknown Error” when I try to save the files on their own, and it shows “Error occurred while writing to the file” when I try to do Save As. If I copy and paste the layers onto a new document, I can save them normally.

Update: in the Log Viewer it shows “saving palettes data failed” when I try to save the file

I think I might be having the same issue; so mentioning it here instead of starting another thread.

I’ve tried granting read/write permissions to both the appimage for krita, as well as to the file I’m working with, renaming the “[name].kra~” file to “[name]2.kra” and opening, saving to different places on the same drive and on an external drive, and keep getting the same (so helpful) error:

Could not save /home/eatrosin/Documents/diplomacy/gmfiles/Haven-1.2/master.kra Reason: Unknown error.

I just tried running it as root, but same thing. Here’s the output from that:

$ sudo ~/indprams/krita-4.4.5-x86_64.appimage ./master.kra
[sudo] password for eatrosin: 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QObject::startTimer: Timers cannot have negative intervals
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
/tmp/.mount_krita-JxysRh/usr/lib/krita-python-libs/krita added to PYTHONPATH
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
saving palettes data failed

Seems like some things are missing, but not only does it continue to open just fine, I was working on it and constantly (successfully) saving last night. I did create the file with L*a*b* color space; I don’t know if that could be obliquely related? I can’t imagine why, but it’s the only “weird” thing I think (emphasis on think: thinking you didn’t mess up is often a good clue you have :smiley: ) I’ve done.

Not too stressed about it; the only thing I’ve done so far in this project is start work on a palette, so I can just write down the values I’ve found so far and make a new file or use Inkscape or something (if Inkscape supports Lab* and I can figure out how to get that to work) in the worst case; no big deal.

Is it relevant that we both have “saving palettes data failed”? @SuperVGBoy What color space are you using? Have you used palettes before? I haven’t used Krita in months; just re-downloaded it last night for this.e

EDIT: I forgot to mention the files with the zip archive icon that krita has been saving, but as I went to look more closely at them, I realize they don’t end in .zip or .tar.gz, but .kpl! And the name at the beginning (before a string of seemingly semi-random mixed-case letters) is not the name of the file, nor quite the name of the folder in which the file is in, it’s the name of the palette! Maybe the palette thing does have something to do with it? Let me see if I can do anything to the palette in Krita that might help.

EDIT 2: Solved? At least for now? I renamed my palette to eliminate a period I had in there (really, having a period not preceding a file extension in my name was really just asking for trouble), and it seems to work now? I scribbled a pink line, saved with no error, closed, reopened, and the pink scribble was still there.

EDIT 3: Nevermind; I made another scribble, this time a nice rose (roughly midway between red and magenta on a CMY color wheel), tried to save, and back to the same error. So maybe so long as I change the name of the palette every time I open the file it will work? I guess I’ll do that unless someone can sus out more specifically why it’s doing this or how to more properly fix it.

EDIT 4: It seems changing the palette settings from Resource Folder to Document helped? Maybe? I’m just going to get some work done since it seems I’ve found a workaround now, but I’d love to see a better answer if anyone has one.

I’m having the same problem! I was about to create a new topic about this when I saw this one. Here’s my story: I’ve been working on this file for a few days (about a week now, I think) and I’ve saved it many times before without any problem. Today, I opened it to continue working and made some modifications, but when I tried to save, it showed this error message:

I hadn’t done too much work, so I decided to restart Krita and try saving again, but I got the same error. I then tried to use “Save As…” and change the name of the file so I could create a “copy” of it, but this time I got this other error:

I’ve also tried:

  • Restarting my computer.
  • Turning off OneDrive syncing while trying to save.
  • Adding the file I was trying to save to my permissions list on my AVG antivirus software.
  • Turning off my antivirus before trying to save.
  • Trying to save to a different driver in my computer.

None of that worked, so I really don’t know what to do anymore. I guess I could just copy it layer by layer to a new file, but I really hope there’s an easier way to recover my work. =(

I’ve also tried creating a new file and saving it to see if it would save, and it did. I’ve opened another .kra file that I had from my most recent work that I made before this one, and it also saved normally.

Oh! I saw that @Samraku mentioned using the palette feature. I’ve actually tried using the palette tool for the first time with this piece and I remember checking the “Save Palette In The Current Document” option while creating it. Maybe that has something to do with the issue, afterall? Is there a way to undo it? The palette seems to have vanished here, but I just assumed it hasn’t saved as the file hasn’t saved.

Sorry for the looooong reply. I just have some final information:

  • I’m using Krita 4.4.5, and I had updated it before I started working in this project.
  • My computer’s OS is Windows 10.
  • I was trying to save it to a subfolder in my “Images” library in my computer. That’s where I store all my .kra files and I had never had any issues with it. It’s located in the C: driver of my computer.

I really wanted to include the bug report log here but PasteBin says it’s too long for it. Is there another way I can share it with you guys? I have saved it as a .txt file.

I hope we can solve this mysterious bug. Please let me know if there is any other information I can provide to help. Thanks a lot in advance!

[Edit] Just tried running Krita in admin mode to see if it would make any difference. It didn’t. So another thing that we can discard.

Just FYI: you don’t have to do it ‘layer by layer’. You can select all layers and copy/paste in one step.

This problem has been fixed in the nightly 5.0.0-prealpha appimage so I assume it’s fixed in the Windows builds as well.
I can’t find a bug report for it.

It’s not fixed in the Jun15 4.4.7-alpha appimage and later appimages had build problems. Windows builds are building but I haven’t looked at them.

The problem is caused by having a palette stored in the .kra file. Once you’ve done that it can’t be saved anymore in 4.4.5.
It can be saved in 4.4.3.

If you really want to use 4.4.5, all you can do is save the palette to disk then unzip the .kra file and remove the palette and its reference in the maindoc.xml, then zip it back up again.

Oh, that’s great! Thank you for letting me know. I’m relatively new to Krita (and to digital art altogether), so I really didn’t know. You’ve just saved me a lot of time! =)

Oh, I’m happy to hear that it’s already been fixed in the following versions of the software. That’s good news! Thank you for letting us know and for explaining what we can do to avoid/“solve” it, @AhabGreybeard. I guess I’ll just transfer my work to a new file by using copy/paste like @dreamkeeper suggested. And avoid storing palettes in .kra files in the future. Thank you!

Is there a confirmed solution that would help users who are in Krita and cannot save? If so, I would like to put it on reddit, too, since it’s happening somewhat often…

If they’re running krita and can’t save the changes they’ve made, the only solution I can think of is to copy-paste all the layers to a new image and save that as a new working .kra file.
Then, they can save the palette to disk and use it in future as a palette in resources not in the .kra file.

If they really want to have a palette in the .kra file, then they’re limited to using 4.4.3 until 5.0.0 is formally released, based on what I’ve seen.

Cutting the palette out of the .kra file was an investigation thing I did and is probably not a suitable activity for most users.