{"record":{"id":"eb7c99f2971d5381","repo":"cube-js/cube","slug":"file-tokenpath-provided-by-cubejs-db-snowflake","errorCode":null,"errorMessage":"File ${tokenPath} provided by CUBEJS_DB_SNOWFLAKE_OAUTH_TOKEN_PATH does not exist.","messagePattern":"File (.+?) provided by CUBEJS_DB_SNOWFLAKE_OAUTH_TOKEN_PATH does not exist\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts","lineNumber":395,"sourceCode":"      if (keysToValidate.length) {\n        throw new Error(\n          `Unsupported configuration exportBucket, some configuration keys are empty: ${keysToValidate.join(',')}`\n        );\n      }\n\n      return exportBucket;\n    }\n\n    return undefined;\n  }\n\n  private async readOAuthToken() {\n    const tokenPath = this.config.oauthTokenPath || '/snowflake/session/token';\n\n    try {\n      await fs.access(tokenPath);\n    } catch (error) {\n      throw new Error(`File ${tokenPath} provided by CUBEJS_DB_SNOWFLAKE_OAUTH_TOKEN_PATH does not exist.`);\n    }\n\n    const token = await fs.readFile(tokenPath, 'utf8');\n    return token.trim();\n  }\n\n  private async prepareConnectOptions(): Promise<snowflake.ConnectionOptions> {\n    const config: Record<string, any> = {\n      account: this.config.account,\n      region: this.config.region,\n      host: this.config.host,\n      application: this.config.application,\n      authenticator: this.config.authenticator,\n      clientSessionKeepAlive: this.config.clientSessionKeepAlive,\n      database: this.config.database,\n      warehouse: this.config.warehouse,\n      role: this.config.role,\n      resultPrefetch: this.config.resultPrefetch,","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts#L377-L413","documentation":"Thrown by readOAuthToken (invoked from prepareConnectOptions) when fs.access fails on the OAuth token file path, i.e. the token file does not exist at the configured location before the driver attempts to read it for token-based Snowflake authentication.","triggerScenarios":"Thrown at packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts:395 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the path set in CUBEJS_DB_SNOWFLAKE_OAUTH_TOKEN_PATH (or the default /snowflake/session/token) exists and is readable by the Cube process","When running outside the Snowflake container OAuth setup, mount or copy the token file to the expected path","If not using token OAuth, remove CUBEJS_DB_SNOWFLAKE_OAUTH_TOKEN_PATH and configure user/password or key-pair authentication instead"],"exampleFix":null,"handlingStrategy":"validation","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"}