0

I'm following the sqitchtutorial-snowflake tutorial and getting stuck when initializing a sqitch project

When i run sqitch init widgets --engine snowflake

The terminal indicates, "Cannot determine Snowflake account name"

vbp13
  • 1,040
  • 1
  • 10
  • 20
  • Could you please share the error, by seeing the error seems account name is invalid. – Sriga Mar 10 '20 at 15:45
  • @Sriga - where is sqitch getting an account name from? – vbp13 Mar 10 '20 at 16:37
  • By checking sqitch documentation page it is recommended to use project URI like below: sqitch init flipr --uri https://github.com/sqitchers/sqitch-snowflake-intro/ --engine snowflake You can refer the documentation page using below link: https://sqitch.org/docs/manual/sqitchtutorial-snowflake/ – Sriga Mar 10 '20 at 17:04
  • @Sriga that's the first thing i did. same error... the uri is actually not necessary but that's beside the point. – vbp13 Mar 10 '20 at 17:46
  • From what I can see it looks like sqitch uses the snowSQL config file? or does it have its own file, if so, please check to make sure the account name in those files is only the information before the first "." in your Snowflake instance url. – Rachel McGuigan Mar 10 '20 at 23:40
  • @RachelMcGuigan - yes! that worked. How did you know that sqitch uses the snowsql config file? Was it in documentation or just tried it out? Also, is there a way to indicate the account name with the sqitch init command if an account name isn't specified in the snowsql config file? from the sqitch help init -> i'm not seeing an option to indicate account name – vbp13 Mar 11 '20 at 05:00
  • Vbp13 - in the second link that Sriga provided the "client" is "snowsql" from the sqitch.conf file in the setup options. I did not see an account name in that file either. (lucky guess) – Rachel McGuigan Mar 11 '20 at 17:32
  • @RachelMcGuigan - do you want to submit an answer – vbp13 Mar 11 '20 at 22:03

2 Answers2

1

Sriga provided the documentation for this answer viewed here.

However, to answer your question, to determine the account name, the SnowSQL configuration file needs to be set. To do this you will need to follow the guide on how to set up SnowSQL on the computer establishing a connection to Snowflake.

Make sure you also follow the steps to connect with Sqitch with the documentation provided in the beginning of this post.

Rachel McGuigan
  • 511
  • 4
  • 22
  • specifically, you need to make sure the "accountname" is set in the config... Unfortunately, the sqitch documentation does not state that it uses the snowsql config. It also doesn't state that the accountname must be set in the config. Sqitch also does not allow you to set the account name in the command. – vbp13 Mar 11 '20 at 23:22
  • That is weird - can you confirm if that worked? If not, I would like to reach out to the document author. – Rachel McGuigan Mar 11 '20 at 23:24
  • What would you like me to confirm? – vbp13 Mar 12 '20 at 02:29
  • Were you still running into the error that account name cannot be determined when setting the snowsql config file? – Rachel McGuigan Mar 12 '20 at 17:22
  • 1) create a snowsql config file with no default values -> snowsql works because as part of the command you can specify -a MYACCCOUNTNAME -> however, if the accountname property is not set in the snowql config -> sqitch will NOT work. 2) set the "accountname" property in the snowsql config--> sqitch will work. Summary 1) It would be helpful if the documentation stated this 2) It would be even better if sqitch allowed you to indicate the account name as part of the CLI command, similar to how snowsql does. – vbp13 Mar 13 '20 at 18:28
  • since you were the first to help me to the solution, I'd like to accept your answer. If you don't mind, can you please add the details about requiring accountname being set in the config? – vbp13 Mar 26 '20 at 11:19
  • vbp13 -apologies in the delay in response, I was getting carried away in python. I actually heard back from the maintainer of the documentation and they are addressing it here:https://github.com/sqitchers/sqitch/issues/502 – Rachel McGuigan Mar 26 '20 at 22:45
  • Great. Let me know if you have a chance to update your answer so I can accept it. – vbp13 Mar 27 '20 at 02:13
1

Ugh, sounds like a defect in Sqitch. It complains if it can't find an account code, since without an account code one cannot connect to Snowflake. However, it should suppress that error when the command won't be connecting to Snowflake, as in the init command.

Here's a bug report; we should get it fixed before v1.0.1.

In the meantime, setting up the SnowSQL config file as mentioned in comments here is a decent workaround, but you can also set the $SNOWSQL_ACCOUNT environment variable, e.g.,

SNOWSQL_ACCOUNT=xxx ./t/sqitch init foo --engine snowflake
theory
  • 9,178
  • 10
  • 59
  • 129