{"record":{"id":"eabb7df382ec0df3","repo":"cube-js/cube","slug":"can-t-connect-to-the-snowflake-instance-json-st","errorCode":null,"errorMessage":"Can't connect to the Snowflake instance: ${JSON.stringify(rest)}","messagePattern":"Can't connect to the Snowflake instance: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts","lineNumber":453,"sourceCode":"  private async createConnection() {\n    const config = await this.prepareConnectOptions();\n\n    return snowflake.createConnection(config);\n  }\n\n  /**\n   * Test driver's connection.\n   */\n  public async testConnection() {\n    const connection = await this.createConnection();\n\n    await new Promise(\n      (resolve, reject) => connection.connect((err, conn) => (err ? reject(err) : resolve(conn)))\n    );\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    const { password, ...rest } = this.config;\n    if (!connection.isUp()) {\n      throw new Error(`Can't connect to the Snowflake instance: ${JSON.stringify(rest)}`);\n    }\n    await new Promise(\n      (resolve, reject) => connection.destroy((err, conn) => (err ? reject(err) : resolve(conn)))\n    );\n  }\n\n  /**\n   * Values are interpolated rather than bound because Snowflake does not\n   * support bind variables in `ALTER SESSION SET` (it rejects `?` with\n   * \"invalid value [?] for parameter\"; see\n   * snowflakedb/snowflake-connector-nodejs#315).\n   *\n   * I've tested it on 04 jun 2026, and it still does not work.\n   */\n  protected buildAlterSessionSql(params: Record<string, SessionParameterValue>): string {\n    const assignments = Object.entries(params)\n      .filter(([, value]) => value !== undefined)\n      .map(([key, value]) => `${key} = ${typeof value === 'string' ? `'${value}'` : value}`)","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts#L435-L471","documentation":"Thrown by testConnection after snowflake.connect() and connect() complete when connection.isUp() still returns false — the client library accepted the call but the session is not actually up, and the message embeds the redacted driver config (password stripped) for diagnosis.","triggerScenarios":"Thrown at packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts:453 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the JSON in the message to confirm the account, warehouse, database, schema, role, and user values are correct","Verify network reachability of the Snowflake account host and that firewall/proxy settings allow port 443","Check that the Snowflake account is not suspended and that the credentials are valid","Retry the connection — transient network or DNS failures can leave the session down"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}