Skip to main content
All CollectionsIntegrationsSnowflake
Snowflake troubleshooting guide
Snowflake troubleshooting guide

Solutions to some errors you may encounter and questions you might have

Christian Dreyer avatar
Written by Christian Dreyer
Updated over a week ago

Summary

  • Ensure you carefully follow the Snowflake integration setup instructions to minimise the chances of encountering an error

  • If you do see an error, in this article we take you through causes and solutions

  • We also explain why you might see a blank dropdown or an orange warning triangle

Who is this article for?

  • Planhat users who are setting up the Snowflake integration (e.g. Tech/Ops)

Series

This article is part of a series on the Snowflake integration:


Article contents


Introduction

In our series of articles on setting up the Snowflake integration, we talk through how you can easily connect Planhat to Snowflake tables/views, and sync your choice of CRM data (bidirectionally if desired) and time-series usage data (from Snowflake into Planhat).

While generally, the setup will go very smoothly, occasionally you may have questions about why you're not seeing something you expected.

In this article, we take you through quick troubleshooting steps. The majority of the time, these will resolve any questions or issues you may have, but if you do need further assistance, please reach out to our amazing Support team via the in-app chat, or speak to your TAM or CSM.


Initial setup advice

  • The permission "Data warehouse integrations" needs to be enabled for your Planhat tenant and for the role of your Planhat user. If you think this isn't enabled for you and you need help, please contact your CSM or TAM

  • If you have an IP whitelist in place in Snowflake, you should reach out to your CSM for the relevant IP addresses to add to your whitelist

  • If no fields are available to select in the "Key in Snowflake" dropdown when mapping usage data (unlike the image below, which shows an example of this populated), this is likely due to the Snowflake table having no numeric fields - keys for usage data must be numeric in order to be selected in the integration. They must also be unique and incrementing. (Note that ID fields for CRM data should be text fields.)

  • When you're configuring field mapping for CRM data, you may see an orange warning triangle indicating that a required field is missing

    • Mouse over it to reveal a tooltip explaining what's missing

    • You should ensure that any required fields are mapped to ensure successful syncing

    • In the example below - "The following Planhat fields are required for creation" - the named fields are required for creating an Asset record in Planhat (although records could still be updated without them)


Error messages

Helpfully, Snowflake errors are surfaced within the integration, which helps with troubleshooting.

You may see errors in red at the top of the integration. For example, there could be an issue with a token expiring, or maybe you made a mistake in the setup within Snowflake.

You can also click into the sync logs in the top right of the integration. The logs enable you to see details of what went wrong and when.

Clicking into the logs gives you a list of actions. Where it's red, there is an error. You can click on this to expand it out and show further details.


Specific errors

Here we list some examples of errors you might experience, and what the causes and solutions are. Again, double check you have correctly followed the setup instructions.


  • Error

    • Error occurred in authorization

      There is a mismatch in the given redirect uri with the one in the registered OAuth client integration

  • Cause

    • If you see this Snowflake error when trying to authenticate, there's a mismatch between what you prepared in Snowflake and what you configured in Planhat

  • Solution

    • You should check what you've set up in both places and correct any discrepancies (most notably, the "OAUTH_REDIRECT_URI"), and try to enable it again. If this issue persists, reach out to your Planhat TAM or CSM


  • Error

    • Some problems with connection to Snowflake

  • Cause

    • This could have a number of different causes

    • Firstly, it's normal to see this briefly while the Snowflake integration is loading (when you navigate to it), as shown in the example below

    • If it persists, this error may be caused by a lack of necessary permissions for the mapped Snowflake tables/views. You can investigate this by verifying the following endpoint in your browser dev tool: /integrations/warehouses/Snowflake/models. If the content of this endpoint is empty, it is likely that the integration user that authorised the Snowflake connection does not have permission to read the mapped tables

  • Solution

    • The following should grant the needed permissions:

      GRANT SELECT ON ALL TABLES IN SCHEMA <DB>.<SCHEMA> TO ROLE <ROLE>; GRANT SELECT ON FUTURE TABLES IN SCHEMA <DB>.<SCHEMA> TO ROLE <ROLE>; GRANT USAGE ON DATABASE <DB> TO ROLE <ROLE>; GRANT USAGE ON SCHEMA <DB>.<SCHEMA> TO ROLE <ROLE>;


  • Error

    • [Snowflake] unable to get databases. refresh tokens operation had error

  • Cause

    • This error is caused by the expiration of your Snowflake refresh token

    • The purpose of the refresh token is to refresh the access token used in the Snowflake integration. However, the refresh token itself cannot be automatically refreshed. Snowflake explain their stance on this topic in this article

  • Solution

    • By default, the refresh token expires every 90 days, but you can contact Snowflake support, and ask them to extend this to 1 year

    • You should reauthenticate (disable and enable your Snowflake connection), in order to resolve this error


  • Error

    • Sequence cannot be found or accessed

  • Cause

    • You may see this when querying your Snowflake table, if the autoincrementing field was created incorrectly on an existing table already synced to Planhat

  • Solution

    • Our recommended query for creating a new autoincrementing column in a pre-existing table is:

      ALTER TABLE "TABLE_NAME" ADD "NEW_COLUMN" NUMBER autoincrement START 1 INCREMENT 1;


  • Error

    • SrcKey is missing, can't parse object

  • Cause

    • This error indicates that a row in the Snowflake table has a null/undefined value in the column used as "Key in Snowflake" in your integration configuration

  • Solution

    • Ensure each row has a valid value for the key/ID column


  • Error

    • [Error] Could not fetch from <TABLE>

    • undefined is not iterable (cannot read property Symbol (Symbol.iterator))

  • Cause

    • This may be due to the ID/key being undefined in the integration mapping section

  • Solution


  • Error

    • [Error] Could not fetch from <TABLE>

      [Snowflake] Unable to fetch data. SQL compilation error: Change tracking is not enabled or has been missing for the time range requested on table '<TABLE>'

  • Cause

    • This error occurs if "change_tracking" is not enabled on the mapped Snowflake table or view - this is needed for the automatic partial sync of CRM data

  • Solution

    • This query should fix the issue: ALTER table <DATABASE>.<SCHEMA>.<TABLE> SET change_tracking = true;


  • Error

    • [Error] Could not push to <TABLE>

    • [Snowflake] Unable to execute statement. Error parsing JSON: missing comma, pos <position>

  • Cause

    • This is likely due to the text or values contained in a mapped Planhat field conflicting with Snowflake's rules for delimiting data

    • For example, "\" (backslash) may be considered by Snowflake as a delimiter - if this character is contained at the end of a field in Planhat, and is sent to Snowflake, this may prevent the payload from being parsed by Snowflake

  • Solution

    • Consider editing your data to avoid this situation

    • It is sometimes possible to customise how Snowflake parses files, such as configuring escape_unenclosed_field = none in Snowflake settings. You can read more about Snowflake's rules for parsing data here

Did this answer your question?