snowsql command failing from root user / crontab - snowflake-cloud-data-platform

I am not able to run snowsql script from crontab. Its saying snowsql command not found.
Please help me to resolve the issue.

After including environment variables in crontab , I was able to resolve the issue. The above issue was also related to certificate verification which was resolved after including the certificate path.

Related

Getting snowsql bootstrap could not verify the signature error when initializing snowsql after successful install

I installed snowsql-1.2.17-windows_x86_64.msi from the installer. After install, I am getting the
below error when calling the below command. please advice
snowsql -a XXXXXXX -u YYYYYY
Installing version: 1.2.17 [####################################] 100%
snowsql bootstrap could not verify the signature for the downloaded file. This snowsql command is not legitimate code. Enable the debug log -o log_level=DEBUG.
Failed to download snowsql. Check network connectivity: 1.2.17
I think it's because SnowSQL is trying to automatically update to the latest version but the signature file is still from the installed version.
In your config file under options, add noup=True (default is false which means update when available), and try again. Haven't tested this, but I think you can also add an option on the launch like this:
snowsql -a XXXXXXX -u YYYYYY --noup
Based on Nick's answer, this seems like a bug so let's hope we don't see these errors going forward.
Open cmd as administrator. Execute the command:
snowsql --noup
Close the window and now run snowsql as administrator. It should open, show a bunch of options and close automatically. Your snowsql should run fine now.
Snowflake reviewed the issue and found that the signature file was incorrect. It has been replaced with a correct signature file and you should not see this issue going forward.

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

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
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
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
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
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.
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

gcloud compute scp - permission denied error

I would like to transfer file from my local machine to Google cloud instance. Here is my command:
gcloud compute scp "C:\Temp\esim_replication.ipynb" nlp-3:
Here is error message:
pscp: unable to open ./esim_replication.ipynb: permission denied
ERROR: (gcloud.compute.scp) [C:\Program Files (x86)\Google\Cloud SDK\google-clou
d-sdk\bin\sdk\pscp.exe] exited with return code [1].
This is brand new error. Everything worked fine 2 weeks ago. I am on Windows 7 locally and ran cmd as Administrator. I tried the above command with and without quotations.
Any suggestions?
Go to gcloud via ssh:
gcloud beta compute ssh --zone "your_zone" "instance_name" --project "project_name"
Give full access to your file:
sudo chmod 777 esim_replication.ipynb
In case someone finds this like I did: I had a similar error message, and what did the trick for me was using sudo: sudo gcloud compute scp [LOCAL] [REMOTE]. Apparently there was the need for updating the project ssh metadata (even though copying in the other direction worked just fine).
Encountered the same error while transferring from my local Windows desktop to Debian VM in GCP.
Changed the permission of the destination folder to 777.
gcloud compute scp source_folder/File1.txt VM_instance_name:destination_folder
It worked!
What? from a windows machine?
'sudo' is not recognized as an internal or external command,
operable program or batch file.
It turned out that I already had identically named file at destination. This caused the error. But Patrick W comment is very helpful

Using appengine with arch and zsh unable to find goapp

I am new to appengine and have installed google-cloud-sdk from the AUR(arch user repository) and and the google-appengine-go extention at /opt/google-cloud-sdk
thanks to this I am able to run a dev server using
dev_appserver.py app.yaml
But when using goapp serve I found
goapp: command not found
After adding /opt/google-cloud-sdk/platform/google_appengine:$PATH to my $PATH variable in zshrc and running goapp serve i now get the error.
zsh: permission denied: goapp
if sudo goapp serve
sudo: goapp: command not found
Due to this I am unable to use the updated sdk to run tests using goapp test
Thank you in advance for your help.
I had the same problem and I think I figured out how it usually works.
You download the google cloud sdk (https://cloud.google.com/sdk/downloads)
After downloading and unzipping to the folder where you want to use it you have to executet the ./google-cloud-sdk/install.sh.
Appengine is not part of the download.
It can be chosen with that install.sh script.
it will download items like appengine.
Afterwards you have a folder called
platform/google_appengine
as you mentioned yourself.
You might have to change execution permissions like
chmod 755 platform/google_appengine/go*
Add folder platform/google_appengine to the PATH if not done already.
The command "which" will not show non-executable binaries.
If you did not change permissions it will not show the path, even being within the PATH variable.

fatal error when starting postgres on solaris

I'm trying to install postgres on a sun solaris sparc instance in my home directory.
Everything is fine except when I try to start postgres server, I get the following error
FATAL: "/home/reic/var/lib/pgsql/data" is not a valid data directory
DETAIL: File "/home/reic/var/lib/pgsql/data/PG_VERSION" is missing.
I used the command pg_ctl -l logfile start to start the server.
I have followed all the necessary steps for installation on sun solaris.
Any idea as to why is this happening ?
Solution:
All the necessary files are there in the PGDATA directory and I ran it as the same user which is trying to start the server. The problem is with the placement of env variables in the .bashrc instead of .bash_profile file. Apparently the customisations are not propagated to sub shells when the env variables are put in .bashrc.
My bad for not realising this! Thank you all....

Resources