After installation of Snowsql I am getting Failed to initialize log. No logging is enabled: [Errno 13] Permission denied: 'C:\\Users\\snowsql_rt.log'
Asked Answered
V

5

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

Vouge answered 6/11, 2020 at 6:58 Comment(3)
"In my config file I have enabled log_file = ../snowsql_rt.log" - Why are you going up one directory?Skyjack
@Skyjack that's default in the snowsql installation.Judejudea
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.Negrophobe
J
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
Judejudea answered 6/11, 2020 at 10:36 Comment(2)
Thanks Sergiu , i chnaged this to ~/.snowsql/snowsql_rt.log , the error disappearedVouge
Yes, for linux, if you point your log_file entry to any location within your $HOME: ~/, the error will disappear. E.g. log_file = ~/.snowsql_rt.logCardwell
L
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
Laminar answered 4/3, 2021 at 14:44 Comment(0)
O
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
Our answered 7/8, 2021 at 5:51 Comment(0)
H
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.

Hautbois answered 20/4, 2021 at 16:17 Comment(0)
G
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
Gearhart answered 20/10, 2021 at 9:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.