Skip to main content

(OPTIONAL) – Configure Warehouse

Best Practice: We recommend a dedicated, X-Small virtual warehouse to be created specifically for the operation of the Genesis Data Agents application. Whether the virtual warehouse exists or is newly created, the Genesis Data Agents application must be granted usage privileges on the virtual warehouse.
Note: the Genesis application has already created an X-Small virtual warehouse, APP_XSMALL, which can be suspended in the case that a custom warehouse is assigned to Genesis.

Configuring A Custom Warehouse

The user configuring the Genesis application can easily select all SQL commands in the code box and copy & paste them into a Snowflake Snowsight worksheet, where the entire set of commands for each individual statement can be executed. Each of the following configuration steps will follow the same process of copying & then pasting the scripts to Snowsight for execution. Refer to the Warehouse configuration script & copy the script below to paste into Snowsight
Result: Below is what it should look like after copying & then pasting the scripts into Snowsight for execution.

Make sure you are clicking “Run All” in the top right in Snowsight after pasting the scripts.

Once that is done, click the “Test Warehouse Access“ button to ensure that the SQL commands were completed successfully.
Custom Warehouse3 Pn
If the test fails, go back to the warehouse configuration script and ensure that the correct warehouse has been granted to the Genesis Bots application.
Once you see that it was a success, please Click “Apply Configuration (Restart Services)”
Expect 3-5 minutes while the Genesis services restart as the virtual warehouse is updated.

Upgrades keep the warehouse you chose

Applying the configuration stores the warehouse, and every later upgrade of the Genesis application keeps it. Granting another warehouse to the application does not move Genesis onto it until you apply the configuration again. For the built-in connector’s SPCS warehouse behavior, see Snowflake connection behavior. If more than one warehouse is granted, Apply uses the first one in alphabetical order, leaving out GENESIS_XSMALL, GENESIS_XSMALL_1 and SYSTEM$STREAMLIT_NOTEBOOK_WH. To choose one by name, run this as the role that owns the app, or one holding APP_OPERATOR, in Snowsight instead:
If the stored warehouse is dropped, or its USAGE grant is revoked, upgrades stop until you fix it. Genesis does not switch to another warehouse on its own. See Upgrade failed: query warehouse unavailable.

Upgrade failed: query warehouse unavailable

Symptom

  • SHOW APPLICATIONS LIKE 'GENESIS_DATA_AGENTS'; shows upgrade_state as QUEUED_RETRY or FAILED.
  • DESCRIBE APPLICATION GENESIS_DATA_AGENTS; shows upgrade_failure_reason containing -20960 and the message Upgrade stopped: the query warehouse stored for this app was dropped, or USAGE on it was revoked from the app. Snowflake may put error details in front of it.
  • While the state is QUEUED_RETRY, Snowflake retries the upgrade, and each retry fails the same way until the warehouse is fixed.
  • Genesis keeps running on its current version, and its warehouse is unchanged.
  • Assigning an external access integration in Genesis fails with the same -20960 error, because assignment restarts the services the same way an upgrade does.
  • If the revoked warehouse is the one Genesis is currently running on, the Genesis UI may not load until it is fixed: pages fail to sign in, and chat disconnects. Use the SQL fixes below in Snowsight.

Cause

Genesis stores the warehouse you chose, and every upgrade keeps it. The upgrade checks that Genesis can still see that warehouse, and it stops when:
  • the warehouse was dropped, or
  • USAGE on the warehouse was revoked from the application.
Genesis checks whether it can see the warehouse with SHOW WAREHOUSES, which lists every warehouse on which the application holds any privilege. If you revoke USAGE but leave another privilege, such as OPERATE or MONITOR, the upgrade is not stopped, but Genesis cannot run queries on that warehouse. To move Genesis off a warehouse, choose another one as shown below, rather than revoking only USAGE.

Find the stored warehouse

Read it in Snowsight. If the Genesis UI still loads, its Warehouse page also shows the stored warehouse and how it was chosen.
The application’s event table also logs it, in a line that starts with QUERY_WAREHOUSE: stored warehouse.

Fix

Run one of these in Snowsight, using your own warehouse for the worksheet. They work even when the Genesis UI does not load. Replace MY_WAREHOUSE with your warehouse and GENESIS_DATA_AGENTS with your application name if it is different. Grant the stored warehouse again. If you dropped it, create it again under the same name first.
Choose another warehouse. Grant USAGE on it, then choose it:
If the Genesis UI still loads, you can instead click “Apply Configuration” on its Warehouse page. Apply picks the first granted warehouse in alphabetical order, leaving out GENESIS_XSMALL, GENESIS_XSMALL_1 and SYSTEM$STREAMLIT_NOTEBOOK_WH. If the warehouse cannot be chosen, CHOOSE_QUERY_WAREHOUSE and Apply stop with an error and leave the warehouse unchanged:
  • -20961: no warehouse other than GENESIS_XSMALL, GENESIS_XSMALL_1 or SYSTEM$STREAMLIT_NOTEBOOK_WH is granted, so there is nothing to choose. Grant USAGE on your warehouse, then call CHOOSE_QUERY_WAREHOUSE, or apply again if the Genesis UI still loads.
  • -20962: Genesis cannot use the warehouse you named. It does not exist, or USAGE on it is not granted. Check the name, grant USAGE, then call CHOOSE_QUERY_WAREHOUSE again.

Confirm the recovery

While the upgrade is in QUEUED_RETRY, Snowflake retries it on its own. When a retry succeeds, upgrade_state is COMPLETE:
If upgrade_state stays FAILED, Snowflake has stopped retrying that version. Genesis keeps running on its current version, and the next Genesis release upgrades it. Contact Genesis support if you need the upgrade sooner. Check the warehouse the Genesis service runs on, in the query_warehouse column:
To confirm external access assignment works again, assign the integration again in Genesis.