5

HI I have downloaded and installed SNowSQL onto my Windows Machine 64 bit machine

After entering command snowsql -a zx12334 -u someone ; i am getting following error

Failed to initialize log. No logging is enabled: [Errno 13] Permission denied: 'C:\Users\snowsql_rt.log'

Any idea what is reason.

In my config file I have enabled log_file = ../snowsql_rt.log

Aniruddha Shinde
  • 124
  • 1
  • 2
  • 11
  • *"In my config file I have enabled log_file = ../snowsql_rt.log"* - Why are you going up one directory? – Tomalak Nov 06 '20 at 08:54
  • 1
    @Tomalak that's default in the snowsql installation. – Sergiu Nov 06 '20 at 10:37
  • The entire way this thing installs on windows is weird. You run an msi installer which puts files in %USERPROFILE%\.snowsql\ , including the config file, and then when you run `snowsql` at the command line it does a secondary install to %PROGRAMFILES%\Snowflake SnowSQL\ , so when you run it, the executable from there it is not one directory below the config file anymore. Broken. – Davos Dec 14 '20 at 22:03

5 Answers5

12

For Windows go to:

%USERPROFILE%\.snowsql\

and update file config and replace this line:

log_file = ../snowsql_rt.log

with this line:

%USERPROFILE%\.snowsql\log
Sergiu
  • 4,039
  • 1
  • 13
  • 21
3

The suggested answer for Windows did not work for me as (I think) it is missing log_file =. To fix my issue in Windows, I went to:

%USERPROFILE%\.snowsql\config

And changed this:

log_file = ../snowsql_rt.log

to this:

log_file = %userprofile%\.snowsql\log
1

To login SnowSQL client , open you windows command prompt and run the following command:

snowsql -a your_acct_name.your_region -u your_username -o 
log_level=DEBUG

Also, if you are getting log error , then go to config file under snowsql application using

%USERPROFILE%\.snowsql\

and replace the log_file value with

%USERPROFILE%\.snowsql\log
Dharman
  • 30,962
  • 25
  • 85
  • 135
Priya Chauhan
  • 445
  • 1
  • 5
  • 21
0

This post and the answer helped me solve this problem when launching snowsql from my home directory on Windows.

The error states that it cannot access it in the Users folder but snowsql tries to create the files in the parent directory from which it is launched.

For what it's worth, You can avoid the error on windows by launching snowsql from a different directory that is not restricted by Windows.

For example, I have a directory C:\WS\SnowSQL that I launched SnowSQL from this location and I did not get the error reported above.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

I had the same problem and resolved with the next assignment to log_file, in order to save log file in the same location of config file :

log_file = ~/.snowsql/snowsql_rt.log
Aitor
  • 1
  • 2