How to Fix Warehouse Suspended Error in Snowflake
The
warehouse suspended error occurs when a Snowflake warehouse is not running. To fix it, use the ALTER WAREHOUSE <name> RESUME command to start the warehouse again. This allows queries to run without errors.Why This Happens
This error happens because the Snowflake warehouse you are trying to use is in a suspended state. Warehouses automatically suspend after a period of inactivity to save costs. When suspended, the warehouse cannot process queries, causing the error.
sql
SELECT * FROM my_table; -- Error: Warehouse 'MY_WAREHOUSE' is suspended
Output
SQL execution error: Warehouse 'MY_WAREHOUSE' is suspended
The Fix
To fix this error, you need to resume the suspended warehouse. This restarts the warehouse so it can process queries again. Use the ALTER WAREHOUSE <warehouse_name> RESUME command.
sql
ALTER WAREHOUSE MY_WAREHOUSE RESUME; SELECT * FROM my_table; -- Query runs successfully
Output
Query executed successfully, returning data from my_table
Prevention
To avoid this error in the future, configure your warehouse to auto-resume. This setting automatically starts the warehouse when a query runs. Also, set an appropriate auto-suspend time to balance cost and availability.
- Enable
AUTO_RESUME = TRUEon your warehouse. - Set
AUTO_SUSPENDto a reasonable number of seconds. - Monitor warehouse usage to adjust settings as needed.
sql
ALTER WAREHOUSE MY_WAREHOUSE SET AUTO_RESUME = TRUE; ALTER WAREHOUSE MY_WAREHOUSE SET AUTO_SUSPEND = 300;
Output
Warehouse MY_WAREHOUSE altered.
Related Errors
Other errors related to warehouse state include:
- Warehouse not found: Happens if the warehouse name is incorrect.
- Insufficient privileges: Occurs if you lack permission to resume the warehouse.
- Resource limits exceeded: When the account has reached warehouse concurrency or credit limits.
Key Takeaways
Resume suspended warehouses with ALTER WAREHOUSE ... RESUME to fix the error.
Enable AUTO_RESUME to automatically start warehouses when needed.
Set AUTO_SUSPEND to balance cost savings and availability.
Check warehouse names and permissions if errors persist.
Monitor warehouse usage to optimize settings and avoid interruptions.
