Exception message "Unable to create directory." during the first launch

[expired user #10973]'s profile image [expired user #10973] posted 7 years ago in Installation Permalink

I just installed the latest version of HeidiSQL (v9.4, 20 Oct 2016). I got the exception message "Unable to create directory." during the first launch. The portable version, which I also downloaded and run today works fine. Prior to downloading and testing the latest version, I was using the portable version 8.1.0.4545.

Here is the bug report:

date/time          : 2017-09-14, 14:25:47, 475ms
computer name      : FLORENTPC
user name          : Florent
registered owner   : Windows User
operating system   : Windows 10 x64 build 15063
system language    : English
system up time     : 2 days 2 hours
program up time    : 266 milliseconds
processors         : 8x Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
physical memory    : 9250/16320 MB (free/total)
free disk space    : (C:) 452.57 GB
display mode       : 2560x1440, 32 bit
process id         : $174
allocated memory   : 64.51 MB
largest free block : 122843.99 GB
executable         : heidisql.exe
exec. date/time    : 2016-10-21 13:40
version            : 9.4.0.5125
compiled with      : Delphi XE5
madExcept version  : 4.0.12
callstack crc      : $f3a9104f, $d2004bb5, $d2004bb5
exception number   : 1
exception class    : EInOutError
exception message  : Unable to create directory.

main thread ($2fd0):
00475e09 heidisql.exe System.SysUtils           ForceDirectories
00475e93 heidisql.exe System.SysUtils           ForceDirectories
00c4c5b7 heidisql.exe Main            7109   +8 TMainForm.SetLogToFile
00c29af6 heidisql.exe Main            1779 +214 TMainForm.FormCreate
00804433 heidisql.exe Vcl.Forms                 TCustomForm.DoCreate
00803c4e heidisql.exe Vcl.Forms                 TCustomForm.Create
0081486e heidisql.exe Vcl.Forms                 TApplication.CreateForm
00c847f6 heidisql.exe heidisql          74  +19 initialization
7ff824e4 KERNEL32.DLL                           BaseThreadInitThunk
7ff82628 ntdll.dll                              RtlUserThreadStart

Any idea how I can fix this issue? Thanks in advance for your help.

ansgar's profile image ansgar posted 7 years ago Permalink

According to the callstack you provided, this happens when HeidiSQL tries to create the general log file, and due to an activated "Log to file" setting. Normally, this setting is disabled. When activated, it starts with creating the required directory structure if it does not exist. The default folder where HeidiSQL writes its log files is

C:\Users\[your-username]\AppData\Roaming\HeidiSQL\Sessionlogs\

You can find the two relevant settings when starting regedit.exe, navigating to the key HKEY_CURRENT_USER\Software\HeidiSQL, while heidisql.exe is not running:

  • LogToFile (set to 0 or just remove to disable logging)
  • SessionLogsDirectory (must be a writable folder if LogToFile is activated
ansgar's profile image ansgar posted 7 years ago Permalink

Or, much easier fix:

Click "continue application" when that crash happens, then rightclick the log panel, then click "Log to file" to disable that. Restart HeidiSQL.

[expired user #10973]'s profile image [expired user #10973] posted 7 years ago Permalink

I fixed the issue by changing the value of the LogToFile setting in the registry. Thanks.

At first, I tried the "easier fix", but I got another error (see below). Right clicking on the log panel did not prompt any context menu.

date/time          : 2017-09-14, 17:20:10, 736ms
computer name      : FLORENTPC
user name          : Florent
registered owner   : Windows User
operating system   : Windows 10 x64 build 15063
system language    : English
system up time     : 2 days 5 hours
program up time    : 10 seconds
processors         : 8x Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
physical memory    : 8269/16320 MB (free/total)
free disk space    : (C:) 452.57 GB
display mode       : 2560x1440, 32 bit
process id         : $2620
allocated memory   : 52.79 MB
largest free block : 122843.99 GB
executable         : heidisql.exe
exec. date/time    : 2016-10-21 13:40
version            : 9.4.0.5125
compiled with      : Delphi XE5
madExcept version  : 4.0.12
callstack crc      : $3281a4e2, $2aa06a22, $2aa06a22
exception number   : 2
exception class    : EAccessViolation
exception message  : Access violation at address 0000000000C2B3C1 in module 'heidisql.exe'. Read of address 0000000000000010.

main thread ($3b40):
00c2b3c1 heidisql.exe Main     2007 +96 TMainForm.AfterFormCreate
00c84805 heidisql.exe heidisql   75 +20 initialization
7ff824e4 KERNEL32.DLL                   BaseThreadInitThunk
7ff82628 ntdll.dll                      RtlUserThreadStart

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