sqitch icon indicating copy to clipboard operation
sqitch copied to clipboard

Document need to quote target URIs on the command line

Open wxcsdhr opened this issue 5 years ago • 3 comments

I have ~/.snowsql/config set like below

[connections]
username = nickwang
dbname = MYDB
warehousename = MY_WH
account = myaccount
authenticator = SNOWFLAKE_JWT
private_key_path = "/Users/nickwang/rsa_key.p8"

SNOWSQL_PRIVATE_KEY_PASSPHRASE is set in the environment variable and I can simply run snowsql without any issues or prompts. iodbctest also works fine to connect to snowflake.

when I run

sqitch status -vvv db:snowflake://[email protected]/MYDB?Driver=Snowflake;authenticator=SNOWFLAKE_JWT;priv_key_file=/Users/nickwang/rsa_key.p8;uid=nickwang

I'm getting following traces:

[Snowflake][DSI] (20032) Required setting 'PWD' is not present in the connection settings. (SQL-28000)
trace: Trace begun at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/darwin-thread-multi-2level/DBI.pm line 691
trace: DBI::__ANON__(undef, undef) called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/darwin-thread-multi-2level/DBI.pm line 748
trace: DBI::connect('DBI', 'dbi:ODBC:Server=myaccount.snowflakecomputing.com;Port=443;Database=MYDB;Driver=Snowflake', 'nickwang', undef, 'HASH(0x7fc5d7bd61d8)') called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/App/Sqitch/Engine/snowflake.pm line 225
trace: App::Sqitch::Engine::snowflake::__ANON__('App::Sqitch::Engine::snowflake=HASH(0x7fc5d7bfe0a0)') called at (eval 370) line 52
trace: App::Sqitch::Engine::snowflake::dbh('App::Sqitch::Engine::snowflake=HASH(0x7fc5d7bfe0a0)') called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/App/Sqitch/Engine/snowflake.pm line 283
trace: App::Sqitch::Engine::snowflake::initialized('App::Sqitch::Engine::snowflake=HASH(0x7fc5d7bfe0a0)') called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/App/Sqitch/Command/status.pm line 129
trace: App::Sqitch::Command::status::catch {...} ('App::Sqitch::X=HASH(0x7fc5d6149dd8)') called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/Try/Tiny.pm line 123
trace: Try::Tiny::try('CODE(0x7fc5d4254768)', 'Try::Tiny::Catch=REF(0x7fc5d60a9058)') called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/App/Sqitch/Command/status.pm line 134
trace: App::Sqitch::Command::status::execute(undef, 'db:snowflake://[email protected]/MYDB?Driver=Snowflake') called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/App/Sqitch.pm line 206
trace: App::Sqitch::try {...}  at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/Try/Tiny.pm line 100
trace: eval {...} at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/Try/Tiny.pm line 93
trace: Try::Tiny::try('CODE(0x7fc5d400aa70)', 'Try::Tiny::Catch=REF(0x7fc5d79bf1d8)') called at /usr/local/Cellar/sqitch/v1.1.0/bin/../lib/perl5/App/Sqitch.pm line 226
trace: App::Sqitch::go('App::Sqitch') called at /usr/local/bin/sqitch line 17

Not sure what was set wrong. Can someone help please?

wxcsdhr avatar Jul 16 '20 01:07 wxcsdhr

What was your fix, @wxcsdhr?

theory avatar Jul 19 '20 21:07 theory

@theory that was a stupid mistake I made. Basically the URI I put here should be quoted or my terminal would treat it as several commands instead of a single.

sqitch status -vvv db:snowflake://[email protected]/MYDB?Driver=Snowflake;authenticator=SNOWFLAKE_JWT;priv_key_file=/Users/nickwang/rsa_key.p8;uid=nickwang

wxcsdhr avatar Jul 20 '20 18:07 wxcsdhr

Cool, not the first time it has happened. I should add notes to various docs to this effect, it's not the first time it has come up.

theory avatar Jul 21 '20 17:07 theory