# Snowflake Syncs and Troubleshooting

Use this page after your Snowflake connection is set up: to refresh data, test the connection, fix common errors, rotate the key, or revoke Galdera's access. For first-time setup and the generated setup script, see [Connecting to Snowflake](/sources/connect-snowflake).

Any member can run a sync, confirm a mapping, and delete a table. Testing the connection, rotating the key, and removing the connection need the organization admin role.

A configured Snowflake table has **Data**, **Columns**, and **Import history** tabs. Its status appears in the top toolbar or beside the table's refresh button. Connection tests and syncs use the same stored key, Snowflake service user, and fixed Galdera IP address, so a successful test checks the same route a sync uses.

## Run and monitor a sync

Snowflake syncs are manual. To get fresh data, open the table and use the circular-arrow button in the top toolbar (tooltip **Sync**). A refresh button beside the status is labeled **Import again** in **Connectors**, or **Sync now** on other source pages. Scheduled syncs are unavailable.

A sync reads the configured history window using the table's date column, stages the result in storage isolated to your workspace, and then processes it into Galdera. Each run appears on the **Import history** tab. Only one run can be active for a table at a time. To stop an active run, use the square button in the top toolbar (tooltip **Stop run**), or **Cancel** on the status line, then confirm **Stop run**.

A sync of unchanged data doesn't duplicate existing rows, and new rows extend the existing data. If columns were added or removed in Snowflake, the table changes to **Needs review** and doesn't sync until you confirm the mapping:

1. Open the **Columns** tab.
2. Check the column roles and frequency.
3. Click **Confirm mapping**.

A failed run stays in the import history with its reason. Recovery depends on the run: see **Failed** and **Interrupted** in [Source Status and Troubleshooting](/sources/source-status#if-your-source-shows-an-error).

## Test the connection

Open the Snowflake connection under **Your connections** and click **Test connection**. You can also reach it from a table's **Table settings** (**⋯**) menu by choosing **Manage connection**. Before a table is selected, the test checks that Galdera can sign in and see schemas. After setup, it also checks that Galdera can read the selected table or view.

Galdera stores the result with the connection, so it stays visible after you reload the page. A failed test can change the table's status when the problem affects the whole connection, such as a rejected key or a blocked network policy.

## Resolve common Snowflake errors

Each heading below is a message Galdera shows, followed by how to fix it.

### Your Snowflake network policy is blocking Galdera

Add the exact Galdera `/32` address shown in the setup script or error message to the allowed list of the network policy that applies to `GALDERA_SVC` (or to the Snowflake user you entered when connecting). Keep the policy's existing entries. Tests, browsing, previews, and syncs all use this same address.

### Snowflake rejected our key / Needs re-auth

* **New connection:** confirm that the generated setup script ran in the correct Snowflake account and set the key on `GALDERA_SVC`, or on the Snowflake user you entered.
* **Connection that worked before:** rotate its key. See [Rotate the Snowflake key](#rotate-the-snowflake-key).

A credential marked **Needs re-auth** can't be reused by a new source until it is repaired.

### No schemas are visible / the selected database is not visible

The sign-in worked, but `GALDERA_READER` can't see a data schema in that database. Re-run the database and schema grants from the setup script, and confirm that the database belongs to the connected Snowflake account.

### The table is missing or not shared with us

Snowflake reports the same error for a misspelled object and for a missing grant. Check the schema and the table or view name, including capitalization, then re-run the relevant `USAGE` and `SELECT` grants. Future grants cover newly created objects only when the generated grant statements were kept, and not in schemas that have their own future grants. See **Schemas with their own future grants** in [Connecting to Snowflake](/sources/connect-snowflake).

### The selected date column is missing, ambiguous, or has the wrong type

Select the date column from Galdera's column picker, and make sure it is a Snowflake `DATE` or `TIMESTAMP` column. If the source column has another type, rename or cast it in a view.

### This sync found no rows

The connection worked, but no rows matched the date range shown. Return to setup, choose an earlier custom start date, and run the first sync again. For an existing table, also confirm that the date column contains values in the configured range.

### The connector is temporarily unavailable / the test timed out

Galdera couldn't reach its connector service, or Snowflake didn't respond in time. Wait a few minutes and try again. If the problem continues, contact Galdera support with the table name and the time of the attempt. Don't send private keys or credentials.

## Rotate the Snowflake key

Rotate the key to replace the key pair Galdera uses to sign in to Snowflake, for example after a key is rejected. Rotation applies to every table that uses the same Snowflake account credential.

1. Open any affected Snowflake table, open the **Table settings** menu (**⋯**), and select **Manage credentials**. If the menu offers only **Manage connection**, the table uses a saved connection, whose page has no key-rotation control: contact Galdera to rotate that key.
2. Click **Rotate key**.
3. Click **Copy script** and run the script in Snowflake as `SECURITYADMIN`. It installs the new public key in Snowflake's second key slot, so the current key keeps working during the change.
4. Return to Galdera and click **I've run it — switch to the new key**.
5. After Galdera confirms the switch, you can remove the old key with the statement included in the script.

:::warning
Don't remove the old Snowflake key before Galdera confirms the switch.
:::

## Disconnect and revoke access

Open the Snowflake connection under **Your connections** and click **Remove connection**. This stops future imports for every table using that connection, while keeping imported tables and data in Galdera. It leaves Snowflake's user, role, warehouse, and grants in place.

To revoke access in Snowflake as well, have your administrator remove the dedicated objects:

```sql
USE ROLE SECURITYADMIN;
DROP USER GALDERA_SVC;
DROP ROLE GALDERA_READER;
USE ROLE SYSADMIN;
DROP WAREHOUSE GALDERA_XS_WH;
```

Dropping `GALDERA_SVC` stops every Galdera source on that Snowflake account at once.

If you connected with a user your team created, follow your team's process instead of dropping that user. Remove Galdera's active public key from the appropriate slot (`RSA_PUBLIC_KEY` or `RSA_PUBLIC_KEY_2`); after rotation, removing only the first slot may leave access working. Check for other connections using these objects before dropping the role or warehouse.
