Need

This article's goal is to help you configure your Snowflake data source correctly in Semarchy xDM when you are unable to test it inside xDM, consistently getting:

  • 404 HTTP error.
  • No useful logs to diagnose the issue.
  • Installation appears valid, privileges are correct and the app is running normally.


Summarized Solution

When the Snowflake Native App is deployed in any region other than AWS "us-west-1", the default account locator (e.g., XY12345) is not a globally unique identifier and therefore cannot be used as the base hostname in the JDBC URL.


Here are the Snowflake ressources on this topic:

https://docs.snowflake.com/en/user-guide/admin-account-identifier#using-an-account-locator-as-an-identifier

https://docs.snowflake.com/en/user-guide/admin-account-identifier#specifying-the-account-name-when-connecting-to-snowflake


As a result:

  • The JDBC URL is constructed with an invalid hostname.
  • The data source test fails with 404 Not Found.
  • xDM cannot reach the database endpoint.


So we need to correct the hostname format.


Detailed Solution


Configure data sources:

When configuring a data source for the Snowflake Native App, do not use the account locator (e.g., XY12345) as the hostname.


Snowflake account locators are not globally unique in all regions and cloud platforms, and using them will cause data source connectivity failures (HTTP 404 errors).


Instead, always use the global account identifier:

<organization_name>-<account_name>.snowflakecomputing.com

You can retrieve these values in Snowflake using:

SELECT CURRENT_ORGANIZATION_NAME(), CURRENT_ACCOUNT_NAME();


Extend network access for external services:

Because the same issue affects the mandatory egress network rule, we need to check and adjust you Snowflake Native App network rule hostname format.


The mandatory network rule must include the global account identifier hostname, not the account locator.


You can retrieve these values in Snowflake using:

USE DATABASE <native_app_database>_APP_DATA;
USE SCHEMA CONFIGURATION;
BEGIN
  LET SNOW_URL := (SELECT REPLACE(CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME(), '_', '-'))
                    || '.snowflakecomputing.com';
  ALTER NETWORK RULE <network_rule_name>
    SET VALUE_LIST = ('license-api.semarchy.com', :SNOW_URL);
  RETURN SNOW_URL;
END;

Use the returned value as the hostname in your JDBC data source configuration.