Issue
Customers might observe sync failures with error messages such as "Object does not exist, or operation cannot be performed" or "SQL compilation error: Schema 'XXX' already exists, but current role has no privileges on it". These errors appear in the warehouse sync logs when attempting to load data into Snowflake or Databricks destinations.
Product
Segment
Environment
Segment Console
Cause
These errors are typically caused by missing schema modification permissions or incorrect role inheritance within the data warehouse. It means the user authenticated by Segment does not have the necessary permissions to either read, modify, or create schemas and tables in the warehouse. In Snowflake, this often happens if the proper permissions were not assigned using the SYSADMIN or ACCOUNTADMIN accounts. For Databricks, a similar error can occur if the root storage credential for the metastore is invalid or does not exist.
Resolution
Log in to your Snowflake or Databricks warehouse console.
- For Snowflake, assume an admin role by running the command USE ROLE ACCOUNTADMIN; or USE ROLE SYSADMIN;.
- Verify your existing permissions by running the commands SHOW GRANTS ON SCHEMA <schema_name> and SHOW GRANTS ON USER <username>.
- Grant the necessary schema privileges (such as USAGE and CREATE TABLE) to the user role configured in Segment so it can create and modify schemas.
- For Databricks connections, verify your service principal and ensure you update the metastore with a valid storage credential.
Additional Information
If you have confirmed that the proper permissions are in place but syncs are still failing with privilege errors in Snowflake, you may have "future grants" configured. You must ensure that these future grants are not automatically re-assigning the ownership of any Segment-created tables (including temporary tables) away from the Segment role to ACCOUNTADMIN or other roles.