cube-js/cube · error
File ${tokenPath} provided by CUBEJS_DB_SNOWFLAKE_OAUTH_TOKE
Error message
File ${tokenPath} provided by CUBEJS_DB_SNOWFLAKE_OAUTH_TOKEN_PATH does not exist. What it means
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.
Source
Thrown at packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts:395
if (keysToValidate.length) {
throw new Error(
`Unsupported configuration exportBucket, some configuration keys are empty: ${keysToValidate.join(',')}`
);
}
return exportBucket;
}
return undefined;
}
private async readOAuthToken() {
const tokenPath = this.config.oauthTokenPath || '/snowflake/session/token';
try {
await fs.access(tokenPath);
} catch (error) {
throw new Error(`File ${tokenPath} provided by CUBEJS_DB_SNOWFLAKE_OAUTH_TOKEN_PATH does not exist.`);
}
const token = await fs.readFile(tokenPath, 'utf8');
return token.trim();
}
private async prepareConnectOptions(): Promise<snowflake.ConnectionOptions> {
const config: Record<string, any> = {
account: this.config.account,
region: this.config.region,
host: this.config.host,
application: this.config.application,
authenticator: this.config.authenticator,
clientSessionKeepAlive: this.config.clientSessionKeepAlive,
database: this.config.database,
warehouse: this.config.warehouse,
role: this.config.role,
resultPrefetch: this.config.resultPrefetch,View on GitHub (pinned to 7d981676b3)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts:395 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/eb7c99f2971d5381.
Report an issue: GitHub.