cube-js/cube · error · TypeError

The ${keyByDataSource('CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KE

Error message

The ${keyByDataSource('CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVE', dataSource)} must be either 'true' or 'false'.

What it means

Env type validation in env.ts snowflakeSessionKeepAlive: CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVE is set to something other than the string 'true' or 'false' (case-insensitive). This boolean env var is strict-parsed, so any other value aborts with a TypeError at accessor time.

Source

Thrown at packages/cubejs-backend-shared/src/env.ts:1552

  }: DataSourceOpts) => (
    get(keyByDataSource('CUBEJS_DB_SNOWFLAKE_ROLE', dataSource, preAggregations)).asString()
  ),

  /**
   * Snowflake session keep alive flag.
   */
  snowflakeSessionKeepAlive: ({
    dataSource,
    preAggregations,
  }: DataSourceOpts) => {
    const val = get(keyByDataSource('CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVE', dataSource, preAggregations)).asString();
    if (val) {
      if (val.toLocaleLowerCase() === 'true') {
        return true;
      } else if (val.toLowerCase() === 'false') {
        return false;
      } else {
        throw new TypeError(
          `The ${
            keyByDataSource(
              'CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVE',
              dataSource,
            )
          } must be either 'true' or 'false'.`
        );
      }
    } else {
      return true;
    }
  },

  /**
   * Snowflake authenticator.
   */
  snowflakeAuthenticator: ({
    dataSource,

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Set the variable to exactly 'true' or 'false' (lower or upper case).
  2. Remove the variable to accept the driver default.
  3. Check for stray whitespace, quotes, or 0/1 values, which are not accepted.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cubejs-backend-shared/src/env.ts:1552 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/af6a73966b1c4a5c. Report an issue: GitHub.