Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.

Auto-storing tab setup failed

pch1900's profile image pch1900 posted 1 month ago in General

Yesterday I updated to version 10.2.0/5599 (64 bit) and since about 22:00 UTC 18/06/2019 I've been getting repeated messages coming up saying "Auto-storing tab setup failed - Unable to write to C:\Users\<username>\AppData\Roaming\HeidiSQL\tabs.in" The worst thing is these messages steal focus so whatever I am doing elsewhere on the PC, even writing this, gets interrupted.

Any thoughts on this?

In the meantime I'm going to have to wind back to a previous version.

ansgar's profile image ansgar posted 1 month ago

This looks as if you lack privileges to write to C:\Users\<username>\AppData\Roaming\HeidiSQL\

Can you please post your Windows version, and please try to create a file in that directory yourself.

pch1900's profile image pch1900 posted 1 month ago

Win 7 Professional Version 6.1 (Build 7601: service pack 1) fully updated.

Creating files in that folder is no problem. The tabs.ini file did have a few lines of text in it but the file has just been emptied by HiediSQL - see snapshot - and as I've been writing this I have been interrupted and tabs.ini is now timestamped 08:59 and contains

[2019-06-18_11-28-25-341] BackupFilename=C:\Users\<user>\AppData\Roaming\HeidiSQL\Backups\query-tab-2019-06-18_11-28-25-341.sql pid=4632 EditorHeight=242 HelpersWidth=253

File now timestamped 09:00

1 attachment(s):
  • Image1


Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.
ansgar's profile image ansgar posted 1 month ago

Ok, I suppose you did not have two or more instances of HeidiSQL open, accessing that tabs.ini from two sides?

Any way, I need to fix these random errors.

pch1900's profile image pch1900 posted 1 month ago

I have three instances open, connecting to three different servers. The tabs.ini file is currently being updated every 4 to 6 seconds. The three instances are probably trying to access at the same time. I've been operating this way for years, no problem until now.

ansgar's profile image ansgar posted 1 month ago

Yes, I was just asking. Multiple instances should not be a problem. I just have to find a way to prevent parallel accesses to that file.

pch1900's profile image pch1900 posted 1 month ago

Thanks for your prompt responses :-)

serg's profile image serg posted 2 weeks ago

Hi, I have the same message: Auto-storing tab setup failed. External exception C06D007F Version 10.2.0.5599 32-bit, Portable Windows Server 2003, 64-bit

ansgar's profile image ansgar posted 2 weeks ago

@serg, could you please check whether you have this folder created automatically by HeidiSQL:

C:\Documents and Settings\<yourusername>\Application Data\HeidiSQL\tabs.ini

I suspect some issue in HeidiSQL with these old XP-aera Windows versions, while I am not able to test that. Several years passed since I had an XP computer. Windows Server 2003 is from the XP aera, is it?

serg's profile image serg posted 2 weeks ago

Folder is created, but there are no files inside.

And I'm using portable version. I think, it should create in program's folder.

Yes, 2003 is a server version of XP.



Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.
ansgar's profile image ansgar posted 2 weeks ago

Yes, the portable version saves its tabs.ini and backups in the folder where you have heidisql.exe and friends.

Windows Server 2008 works without crash.

I'm beginning to think I should just drop XP support.

ansgar's profile image ansgar posted 2 weeks ago

I pushed some changes, so the latest build should disable the tab re/store feature if writing tabs.ini failed. Could you please update and try again?

yphastos's profile image yphastos posted 2 weeks ago

Hello, joining the party here.

I've been having the same problem with the tab.ini file, but I get a couple of very similar messages, apparently randomly.

one is

---------------------------
Error
---------------------------
Auto-storing tab setup failed

Could not open file C:\users\diegodurand\Application Data\HeidiSQL\tabs.ini
---------------------------
OK   
---------------------------

and the other

---------------------------
Error
---------------------------
Auto-storing tab setup failed

Unable to write to C:\users\diegodurand\Application Data\HeidiSQL\tabs.ini
---------------------------
OK   
---------------------------

The thing is, the file IS being writen, i.e. it does have read/write access. in fact it has been writen just now. The file DOES have content.

I am running HeidiSQL trhough wine, so the full path to tabs.ini is: /Users/<user>/.wine/drive_c/users/<user>/Application Data/HeidiSQL/tabs.ini

I am sitll @10.20.5599 instead of latest build, so restoring SHOULD be enabled

I am running two heidi instances.

I tried opening a third instance, creating a few dummy files, and closing (that instance) of heidi, it did prompt to save them, so I didn't manually save any, but when reopening heidi (3rd instance), it still didn't reopen the previous tabs.

Let me know if I can help testing any further.

I also see you are currently working on the issue on a different post, @

heidisql .com/forum.php?t=34044#p34148 (sorry cant post links yet),

but since this seems to be more specificaly related to tab restoring, I am posting this here.

ansgar's profile image ansgar posted 2 weeks ago

Hm, apparently my multi-instance-access-to-file-logic is just shit:

  • if the file exists, then Heidi checks in a loop (15 attempts with a delay of 200ms) if it can touch the file, with the following code:
hFile := CreateFile(PChar('path\to\tabs.ini'), GENERIC_WRITE, 0, nil, OPEN_EXISTING, 0, 0);
Result := hFile <> INVALID_HANDLE_VALUE;
CloseHandle(hFile);
  • now that already raised your first error "Could not open file"
  • if the file could be touched successfully, then the next thing is to create an .ini object:
Result := TIniFile.Create('path\to\tabs.ini');
  • this line, or the following high-level methods of TIniFile raised your second error "Unable to write to"
yphastos's profile image yphastos posted 2 weeks ago

Just some ideas:

Idea #1

  1. For every new instance, create a tabs file for it, with some kind of id (e.g timestamp of opening).

  2. while instances are open, fequently save tabs to each instances unique file. that way you wont lock the same file since each has its own.

  3. when an instance closes, flag the file somehow, to show it doesn't have a 'parent' instance open.

  4. If new instance opens, load all the flagged files and load all the tabs in the new instance as its initial tabs. This would allow that if there were several files from several instances, the new one will load all of them together.

Idea #2

Just forget about tabs.ini file, I see you already save queries into the Backups folder, so why not just load already unopened files in every new instance?

  • Every time either instance saves a query, save it to backups (as already done),
  • every time a tab is closed manually (i.e. single tabs), delete it from backups (either if the user saved it to a file, or ignored the changes), but of course prompt to save if such option is active.
  • every time an instance closes, save all its queries to the corresponding files. In this case, you should save EVERY query, saved, modified, or not, and do not prompt for each (IMO the point of restoring is not needing to be asked to save or discard each tab).
  • every time a new instance opens, just load all the 'not currently open' queries in it.

the whole point is to not depend on a single file to manage 'sesions', and avoid read/write/locking the same file from different instances.

This are just general ideas, I don't know how complicated would they be to implement of if they would work at all. However I hope they are useful.

Or maybe just research about how other apps manage this, the perfect example is sublime text, although i really don't know how it handles multiple instances, since I use it just with one (as opposed to heidi, in which I almost use two).

Let me know if I can help with further testing.

serg's profile image serg posted 1 week ago

The problem is not in access to the file, but in the "External exception C06D007F" (in my case). This is something related to delayed load from DLLs (I don't know).

Please login to leave a reply, or register at first.