Error: No Active Warehouse Selected in the Current Session
Issue
When you create a Snowflake source in Activations and run the setup tests, the following error appears:
Error encountered while running an operation in the data warehouse: No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.
Environment
Activations source: Snowflake
Resolution
To resolve this issue, set a default warehouse for the authorizing Snowflake user:
Replace all placeholders, such as <snowflake_user> with the actual values.
- Set a default warehouse for the authorizing user in Snowflake:
ALTER USER <snowflake_user> SET DEFAULT_WAREHOUSE = <warehouse>; - Ensure the user's role has permission to use the warehouse:
GRANT USAGE ON WAREHOUSE <warehouse> TO ROLE <role_name>; - Log in to Snowflake as the authorizing user and run the following command to verify that the configured default warehouse is active:
SELECT CURRENT_WAREHOUSE(); - In Activations, re-run the setup tests for the Snowflake source.
Cause
This issue occurs when the authorizing user doesn't have a default warehouse configured or the user's role doesn't have permission to use it. For more information, see the Snowflake Access control privileges documentation.