Troubleshooting

This topic provides guidelines for troubleshooting issues with the Snowflake Native SDK for Connectors. If you want to discover the cause of a specific error, you need appropriate tools that make the troubleshooting process easier. For that reason the Snowflake Native SDK for Connectors provides a couple of procedures, views, and other methods to troubleshoot the connector effectively.

Procedure responses

Usually when something wrong happens with the connector, or even when the user cannot execute the particular procedure successfully because of the state of the Connector, the first source of the troubleshooting data should be the procedure response. In the Snowflake Native SDK for Connectors, the error response from the procedure is standardized. The response is returned as a VARIANT with two fields, that are always present:

  • response_code - the value of this field, in case of an error response, is an error code, e.g. INVALID_CONNECTOR_STATUS

  • message - the value of this field is a message that provides more information regarding the occurred error

Structure of an error response:

{
  "response_code": "<ERROR_CODE>",
  "message": "<error message>"
}
Copy

Database objects

The Snowflake Native SDK for Connectors provides a couple of views and procedures that help in checking the actual state of the Connector.

Views:

Procedures:

Event table

By default, procedures provided by the SDK that are implemented in Java use ConnectorErrorHelper to wrap thrown exceptions during the particular procedure execution. Apart from wrapping the thrown exception and mapping it to ConnectorResponse with an error code, the default implementation of ConnectorErrorHelper logs events basing on the thrown exceptions to the Event Table if it’s set up in the customer’s account. If you want to learn more about using Event Table, see the official Snowflake documentation.

There is a possibility to filter out logs generated by the Snowflake Native SDK for Connectors from the event table knowing only the application instance name. In addition, there is also a possibility to filter out logs of errors that occurred in the most common parts of the Connector.

Example query:

SELECT * FROM PLATFORM_CI_TOOLS.PUBLIC.EVENTS
    WHERE RESOURCE_ATTRIBUTES:"snow.database.name" LIKE '<INSTANCE_NAME>'
    [AND SCOPE:"name" LIKE '<ERROR_CODE>']
    [ORDER BY timestamp DESC];
Copy

Possible error codes:

  • CONFIGURE_CONNECTOR_FAILED - occurs when Configure Connector Wizard step failed

  • SET_CONNECTION_CONFIGURATION_FAILED - occurs when Set Connection Configuration Wizard step failed

  • FINALIZE_CONNECTOR_CONFIGURATION_FAILED - occurs when Finalize Connector Configuration Wizard step failed

  • PAUSE_CONNECTOR_FAILED - occurs when Pause Connector process failed

  • RESUME_CONNECTOR_FAILED - occurs when Resume Connector process failed

Connector state recovery

If an uncaught error occurs during pause or resume process, which causes the connector to not rollback the process and fail unexpectedly - an ERROR connector status may be set. Also, if for any reason these processes get suddenly terminated - the connector may be ‘stuck’ in a STARTING or PAUSING connector status.

Such problems should be diagnosed using the above mentioned methods and a suitable repair should be attempted. In many cases a complete reinstallation of the connector may be required, but if the repair was successful and the only remaining issue is the ‘stuck’ connector status - there may a couple possible solutions:

  • If the connector is ‘stuck’ in the STARTING status - another call of the PUBLIC.RESUME_CONNECTOR() procedure may fix the status issue

  • If the connector is ‘stuck’ in the PAUSING status - another call of the PUBLIC.PAUSE_CONNECTOR() procedure may fix the status issue

  • If the aforementioned methods failed, or the connector is in the ERROR status - the PUBLIC.RECOVER_CONNECTOR_STATE(STRING) procedure may be used to force the status change (see Core SQL reference). It is advised to force the change into PAUSED status and try restarting the connector using the PUBLIC.RESUME_CONNECTOR() procedure