'Snowflake serverless task error out with message Cannot execute task , USAGE privilege on the task's warehouse must be granted to owner role

Snowflake expert,

I am trying to create Snowflake task with Serverless option. Basically i am specifying following option "USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE"='SMALL', I am getting following error message when task ran.

Snowflake recommends to specify the Snowflake Provided warehouse size , which can be either SMALL,MEDIUM, LARGE.

My role has all requisite privileges to run task such as Usage privilege on Database, schema , execute task on ACCOUNT and Ownrship of task

Snowflake serverless task error out with message Cannot execute task , USAGE privilege on the task's warehouse must be granted to owner role

Any clue why is this error appearing when i am running task with serverless option



Solution 1:[1]

The documentation for tasks list several privileges that the task owner (i.e. the role that has the OWNERSHIP privilege on the task) must have. These include USAGE on the warehouse.

Obviously, with serverless, you can't give them that permission, but the Serverless Tasks section also has this bit:

Note that the role that executes the CREATE TASK command must have the global EXECUTE MANAGED TASK privilege.

I'm guessing that this global privilege is supposed to go in place of the Warehouse USAGE privilege for serverless tasks, and Snowflake is just providing an incorrect error message.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 StriplingWarrior