SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Troubleshooting "Object Does Not Exist" and Schema Mismatch Errors in Segment

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.

  1. For Snowflake, assume an admin role by running the command USE ROLE ACCOUNTADMIN; or USE ROLE SYSADMIN;.
  2. Verify your existing permissions by running the commands SHOW GRANTS ON SCHEMA <schema_name> and SHOW GRANTS ON USER <username>.
  3. 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.
  4. 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.

Have more questions? Submit a request
Powered by Zendesk