SnowQuest
SnowQuest

Reputation: 79

Snowflake serverless task creation returns error

when trying to create a task using

create task if not exists <task_name> SCHEDULE = '3 minute' USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE = 'XSMALL' AS <sql>

I am getting this error

SQL compilation error: Missing option(s): [WAREHOUSE]

Upvotes: 1

Views: 1059

Answers (2)

Raghuram Gudimetla
Raghuram Gudimetla

Reputation: 11

You should grant 'EXECUTE MANAGED TASK' on account level to the role.

GRANT EXECUTE MANAGED TASK ON ACCOUNT TO ROLE (ROLE_NAME);

Upvotes: 1

patrick_at_snowflake
patrick_at_snowflake

Reputation: 453

I think the documentation is not yet clear (it has been raised) but...

If you are going to grant the ability to run tasks against the serverless warehouse to a custom role, please ensure you grant both "Task" and "Managed Task" to that role. (Failure to grant these rights has tripped up a few of our customers and staff)

use role accountadmin;
grant execute managed task on account to role my_task_role;
grant execute task on account to role my_task_role;

Upvotes: 4

Related Questions