https://meltano.com/ logo
#cli
Title
# cli
b

brave-ice-86395

11/27/2019, 5:33 PM
meltano permissions grant roles.yml  --db snowflake --dry --diff
this script takes hours to run .. is there anything I might be doing wrong?
f

fierce-honey-5880

11/27/2019, 5:43 PM
Hey @brave-ice-86395! It should be able to complete in a couple of minutes.
At least that's how much time it takes for Gitlab's Snowflake
Is this behavior new or was the permissions command always that slow for you?
b

brave-ice-86395

11/27/2019, 5:47 PM
always slow
our roles.yaml looks very similar to gitlab's
is there a debug flag?
f

fierce-honey-5880

11/27/2019, 5:48 PM
No, unfortunately there is not. But you can always clone Meltano and run the script in debug mode if you really want to check what happens
b

brave-ice-86395

11/27/2019, 5:50 PM
it is stuck at
Checking that all entities in the spec file are defined in Snowflake
f

fierce-honey-5880

11/27/2019, 5:52 PM
That;s the more heavy part: we ping Snowflake a lot to get users, DBs, schemas, etc But I can not see why it would take hours.. you can download all the Star Wars films in a couple hours..
b

brave-ice-86395

11/27/2019, 5:52 PM
True story
f

fierce-honey-5880

11/27/2019, 5:52 PM
Maybe Snowflake throttles you? That's really weird
b

brave-ice-86395

11/27/2019, 5:53 PM
okay that part finished so i guess mostly stuck in fetching privileges per entity
f

fierce-honey-5880

11/27/2019, 5:56 PM
I have only one idea: 1. Clone Meltano 2. Update the SnowflakeConnector and uncomment the
insecure_mode=True,
line https://gitlab.com/meltano/meltano/blob/master/src/meltano/core/permissions/utils/snowflake_connector.py#L37 3. Run meltano using your version of the code (create a venv for meltano inside that project and run
pip install -e '.[dev]'
)
Copy code
python3 -m venv venv

source venv/bin/activate
pip install -e '.[dev]'
You may be getting OCSP errors which would make the script make 100x more calls
If that's the case, then we should add a flag to enable that mode. I was only getting this while testing from home but it may be the case for production systems also.
b

brave-ice-86395

11/27/2019, 5:58 PM
clearly its snowflake's end
didnt know show grants can take soo long
f

fierce-honey-5880

11/27/2019, 6:00 PM
wow! I have never seen that.. It's just a
SHOW
and it takes as much time as adding a primary index over a huge table
Or you have assigned 334198231487123 privileges to that role lol
b

brave-ice-86395

11/27/2019, 6:01 PM
makes sense!!
this is insane it is into 10 mins now
its a xsmall warehouse but not sure we need so much compute for a simple
show
f

fierce-honey-5880

11/27/2019, 6:02 PM
Do you get the same when you run it from inside the Snowflake SQL editor?
You should totally report this to Snowflake! I really want to see what's the problem there..
b

brave-ice-86395

11/27/2019, 6:03 PM
yes doing that now
f

fierce-honey-5880

11/27/2019, 6:03 PM
(I think that I am also using an xsmall warehouse for similar tasks)
b

brave-ice-86395

11/27/2019, 6:09 PM
27,428 rows produced
this was the output of that query but that took 9 mins
insane
f

fierce-honey-5880

11/27/2019, 6:11 PM
Insane indeed. Let's see what they are going to tell you.. Please don't forget to post back here after you discuss this with Snowflake support!
b

brave-ice-86395

11/27/2019, 6:14 PM
sure thing, thanks Yannis