Bug #76534 Autosave Error in MySQL Workbench
Submitted: 30 Mar 2015 16:21 Modified: 24 Aug 2017 10:57
Reporter: Kenneth Davis Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.2.4.12437 build 2426 (64 bits), 6.3.9,8.0.20 OS:Windows (Windows 7 64-bit Service Pack 1)
Assigned to: CPU Architecture:Any
Tags: Auto save, autosave, Failure, scratch

[30 Mar 2015 16:21] Kenneth Davis
Description:
I am using MySQL Workbench 64-bit (6.2.4 -- latest avail community release) on Win 7 Pro with SP1.

I keep receiving an error message that says it cannot save the Query Tab.  Essentially, the message goes as follows:
Could not save contents of tab Query 1.
Could not save snapshot of editor contents to C:\Users\Ken Da...\{9C3E5371-D600-48B6-80B0-E7019908464B}.scratch: Failed to rename file 'C:\Users\Ken ...\{9C3E5371-D600-48B6-80B0-E7019908464B}.scratch.... to 'C:\Users\Ken D...\{9C3E5371-D600-48B6-80B0-E7019908464B}.scratch': g_rename() failed: Permission denied.

How to repeat:
It auto repeats itself every time the auto save feature attempts to auto save any open query tabs.

Suggested fix:
Provide a method of specifying WHERE the auto save files can be stored and saved, as opposed to the default application level folder.
For example, in the Preferences -> SQL Editor properties panel, allow the user to define specific locations to store the auto-save scripts, such as 
C:\Users\[user]\Documents\[MySQL Auto Save]
[16 Apr 2015 13:49] MySQL Verification Team
Thank you for the bug report. The path where the auto-save (C:\Users\Ken Da...\) fails has an accented letter or non-English symbol?. Thanks.
[16 Apr 2015 13:58] Kenneth Davis
No, it did not.  The file path was too long in the comments, so I abbreviated it.  

However, I did manage to get this somewhat resolved on my own by changing the permissions of the folder and files and removing the "Read Only" settings so that files could be updated or created in the folder.
[2 Jul 2015 15:24] MySQL Verification Team
Please check version 6.3.4. Thanks.
[3 Aug 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 Nov 2016 22:35] Mark Vaughan
This is still an issue with version 5.3.7 version 1199 CE 64-bit, running on Windows 7 SP1 64-bit
[29 Nov 2016 23:10] MySQL Verification Team
Please try version 6.3.8. Thanks.
[29 Nov 2016 23:34] Mark Vaughan
I've installed 6.3.8 build 1228 CE 64-bit. I'll respond back if the issue occurs again. Thank you.
[30 Nov 2016 9:27] MySQL Verification Team
Thank you for the feedback. Please comment when test is done.
[1 Dec 2016 19:17] Mark Vaughan
The same issue has occurred using 6.3.8 build 1228 CE (64 bit)
[1 Dec 2016 19:24] Mark Vaughan
Complete error message

Attachment: MYSQL Workbench bug - 76534 - 1.png (image/png, text), 60.89 KiB.

[1 Dec 2016 19:40] MySQL Verification Team
The error dialog shows permission denied issue please check on the same way [16 Apr 2015 13:58] Kenneth Davis,  fixed it. Thanks.
[1 Dec 2016 19:43] Mark Vaughan
As you can see in the attached file, the directory that sis being used is not visible. Which directory is having the issue?

Thanks!
[1 Dec 2016 19:59] Mark Vaughan
I was able to find the log file and it had the full directory path. I've updated the directory to not be read only. I'll let you know if the issue arises again. Thank you for your help.
[5 Dec 2016 21:25] Mark Vaughan
I still get the error. Here is the error from the log file:
116 14:10:55 [ERR][ SqlEditorPanel]: Could not save snapshot of editor contents to C:\Users\mvaughan\AppData\Roaming\MySQL\Workbench\sql_workspaces\Local_instance_MySQL57-1.autosave\{D1E65E95-6BD7-4699-B975-2C08BDE281CB}.scratch: Existin    g file 'C:\Users\mvaughan\AppData\Roaming\MySQL\Workbench\sql_workspaces\Local_instance_MySQL57-1.autosave\{D1E65E95-6BD7-4699-B975-2C08BDE281CB}.scratch' could not be removed: g_unlink() failed: Permission denied
117 14:10:55 [ERR][      SqlEditor]: Could not auto-save editor load_test_info

Will attach error.txt to show the permissions of the files.
[5 Dec 2016 21:25] Mark Vaughan
Permissions of files

Attachment: error.txt (text/plain), 20.09 KiB.

[6 Dec 2016 15:24] Mark Vaughan
Also note that I checked the access from within the Properties window in Windows 7 Pro. All access is granted to my user, mvaughan
[30 Dec 2016 12:08] Mark Vaughan
Is there any update?
[23 Jan 2017 21:35] Jay Yuan
any update?  I am using 6.3.3.0.  Yet, still have this auto save failure due to "permission denied".
[24 Aug 2017 10:46] MySQL Verification Team
Bug #87523 marked as duplicate of this.
[24 Aug 2017 10:57] MySQL Verification Team
Thank you for the feedback.
With WB 6.3.9 on Win7, open SQL tables and if .info|.scratch files are set read-only then below errors are popped at the time of auto-save:

-- .info|.scratch found in

%AppData%\MySQL\Workbench\MYSQL\WORKBENCH\SQL_WORKSPACES
└───<name>.workspace

[Window Title]
MySQL Workbench

[Main Instruction]
Auto save

[Content]
Could not save contents of tab Query 1.
Could not save snapshot of editor contents to C:\Users\umshastr\AppData\Roaming\MySQL\Workbench\sql_workspaces\hod03-1.autosave\{462511C4-9EAF-4012-A5FA-48BA1BCAF11E}.scratch: Existing file 'C:\Users\umshastr\AppData\Roaming\MySQL\Workbench\sql_workspaces\hod03-1.autosave\{462511C4-9EAF-4012-A5FA-48BA1BCAF11E}.scratch' could not be removed: g_unlink() failed: Permission denied

[OK]

===========
Workaround is to uncheck "read only" check
[18 Jan 2018 0:11] Luke Stevenson
This is also affecting me. MySQL Workbench v6.3.8 on Windows 7.

I have my MySQL Workbench folder symlinked into my Dropbox (to allow me to access the same collection of servers from different computers). I get this message frequently.

At the very least, give us an option to turn off AutoSave until this is fixed.
[8 Mar 2018 13:22] MySQL Verification Team
https://bugs.mysql.com/bug.php?id=89946 marked as duplicate of this one.
[7 Jul 2020 13:08] MySQL Verification Team
Bug #99850 marked as duplicate of this one.
[30 Dec 2022 10:37] MySQL Verification Team
Bug #109500 marked as duplicate of this one
[30 Dec 2022 15:33] Paul Coene
autosave never recovers for me.  I don't have any special directories set and windows does not allow you to change appdata subfolders to unset read only.

Been a bug forever.  I mean, does anyone have recovery from crashes work?  Mu bug marked as a dup of this one, but this one seems very soecific whereas mine was easy to recreate.