Bug 410331 - When I try to save any Krita file as a jpg or Krita file, I keep getting an error message -- 'cannot save / access is denied'
Summary: When I try to save any Krita file as a jpg or Krita file, I keep getting an e...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-29 02:20 UTC by joelturtel
Modified: 2019-11-05 17:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
attachment-26815-0.html (2.38 KB, text/html)
2019-07-29 13:28 UTC, joelturtel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description joelturtel 2019-07-29 02:20:31 UTC
When I try to save any Krita design as a jpg or Krita file, I keep getting an error message -- 'cannot save / access is denied'. What am I doing wrong.

Also, when I try to browse to a folder on my computer to save the Krita or jpg file, it doesn't allow me to browse all the folders on my computer.
Comment 1 Halla Rempt 2019-07-29 09:44:38 UTC
Then there is something wrong with the permissions set on your computer: this is not a bug in Krita. Where are you trying to save to?
Comment 2 joelturtel 2019-07-29 13:28:52 UTC
Created attachment 121813 [details]
attachment-26815-0.html

I'm trying to save the Krita file to a folder I created in my C drive.
However, I created other similar folders and I keep getting the same error
message about "access is denied." Where do I go on my computer to correct
the 'permissions' setting on my computer? I never had this problem before.
Thanks.

On Mon, Jul 29, 2019 at 5:44 AM Boudewijn Rempt <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=410331
>
> Boudewijn Rempt <boud@valdyas.org> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>          Resolution|---                         |WAITINGFORINFO
>              Status|REPORTED                    |NEEDSINFO
>                  CC|                            |boud@valdyas.org
>            Severity|critical                    |normal
>
> --- Comment #1 from Boudewijn Rempt <boud@valdyas.org> ---
> Then there is something wrong with the permissions set on your computer:
> this
> is not a bug in Krita. Where are you trying to save to?
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Bug Janitor Service 2019-07-30 04:33:15 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 4 Halla Rempt 2019-07-30 08:17:39 UTC
Try to save within your user's directory, and not in a folder directly in c:\. Without access to your computer, I cannot see what you're trying to do. 

I'm not supposed to give Windows support though. I should be fixing bugs in Krita, and this really is not a Krita bug. You'll have to google to find information about working with folder permissions in Windows, and all the various ways that can be set up.
Comment 5 Dmitry 2019-11-04 17:59:23 UTC
Hello, new Krita user here, Windows 10 x64. I've also seen this error. And numerous forum posts about this error, and everywhere people suggest it's a permission issue. Well, I'm a system administrator and I'm pretty sure I have enough permissions on my working folders. I've done some testing and (helped by reports that files can't be saved in folders that are in root) found out that Krita can't save a file in D:\test11, but can save in D:\test11\test22, even though folder permissions are the same. Then I've run procmon to see what exactly Krita tries to do. I'm not that great at understanding Windows file API calls, but I've seen this:
D:\test11.nKanRR.kra	PRIVILEGE NOT HELD
and later when successfully saving to D:\test11\test22\test.kra
D:\test11\test22.aZmNdf.kra	SUCCESS
(multiple operations).

I believe the issue is Krita's trying to create a temp file not in the folder it's saving to, but in the parent folder, probably because the last slash in the filename (or path) is lost (or replaced with "."). Thus when saving in D:\test11 it tries to create temp file in D:\, and that usually requires additional privileges.

BTW, only the temp file name is affected. Later it copies temp file (if it saved succesfully) to the intended file name, and that goes as expected:
ReadFile	D:\test11\test22.aZmNdf.kra	SUCCESS	Offset: 0, Length: 101 629, Priority: Normal
WriteFile	D:\test11\test22\test.kra	SUCCESS	Offset: 0, Length: 101 629, Priority: Normal
(among other things).
Comment 6 Halla Rempt 2019-11-05 08:37:44 UTC
I think you may be right...
Comment 7 Halla Rempt 2019-11-05 10:15:28 UTC
Should be fixed in 

commit 9591e52bbe740e87189394c0a6b8af3f7106695b (HEAD -> master, origin/master, origin/HEAD)
Author: Boudewijn Rempt <boud@valdyas.org>
Date:   Tue Nov 5 09:40:40 2019 +0100
Create temporary files in the temp dir
We probably also should check whether the workaround for QSafeFile
is still needed.
Comment 8 Dmitry 2019-11-05 17:39:06 UTC
As I understand you changed it to use system temp directory instead. Is it always a good idea? What if a project is HUUGE, but the temp dir is on a small SSD for example? Or a limited size tmpfs? Saving temporary file in the directory where the save is directed to seems like a good idea. Could have been a 1 character commit. :)