cube-js/cube · error
dremioAuthToken is blank
Error message
dremioAuthToken is blank
What it means
When a DremioDriver is configured with dbUrl, the driver assumes a pre-authenticated connection string and requires the JWT to be supplied via dremioAuthToken. If dbUrl is set but dremioAuthToken is the empty string, the constructor throws this Error because there is no way to authenticate against the custom URL.
Source
Thrown at packages/cubejs-dremio-driver/driver/DremioDriver.js:97
config.ssl ||
getEnv('dbSsl', { dataSource, preAggregations }),
...config,
pollTimeout: (
config.pollTimeout ||
getEnv('dbPollTimeout', { dataSource, preAggregations }) ||
getEnv('dbQueryTimeout', { dataSource, preAggregations })
) * 1000,
pollMaxInterval: (
config.pollMaxInterval ||
getEnv('dbPollMaxInterval', { dataSource, preAggregations })
) * 1000,
};
if (this.config.dbUrl) {
this.config.url = this.config.dbUrl;
this.config.apiVersion = '';
if (this.config.dremioAuthToken === '') {
throw new Error('dremioAuthToken is blank');
}
} else {
const protocol = (this.config.ssl === true || this.config.ssl === 'true')
? 'https'
: 'http';
this.config.url = `${protocol}://${this.config.host}:${this.config.port}`;
this.config.apiVersion = '/api/v3';
}
}
/**
* @public
* @return {Promise<void>}
*/
async testConnection() {
return this.getToken();
}
View on GitHub (pinned to 7d981676b3)
Solutions
- Provide a valid personal access token: dremioAuthToken: '<token>' (or set DREMIO_AUTH_TOKEN env var) alongside dbUrl
- If you intended username/password auth to a standard Dremio server, remove dbUrl and configure host/port/user/password instead
- Generate a new token in the Dremio UI if the old one expired, then restart Cube
Example fix
// before
new DremioDriver({ dbUrl: 'dremio+sql://...', dremioAuthToken: '' })
// after
new DremioDriver({ dbUrl: 'dremio+sql://...', dremioAuthToken: process.env.DREMIO_AUTH_TOKEN }) Defensive patterns
Strategy: validation
Validate before calling
if (config.dbUrl && !config.dremioAuthToken) {
throw new Error('dbUrl requires dremioAuthToken (set DREMIO_AUTH_TOKEN)');
} Type guard
function hasAuthToken(config) {
return typeof config.dremioAuthToken === 'string' && config.dremioAuthToken.length > 0;
} Try / catch
try {
driver = new DremioDriver(config);
} catch (e) {
if (e.message === 'dremioAuthToken is blank') {
console.error('Set DREMIO_AUTH_TOKEN when using dbUrl');
process.exit(1);
} else { throw e; }
} Prevention
- Always source dremioAuthToken from an env var with a fail-fast startup check
- Remove dbUrl if you intend host/port+user/password auth
- Use config templates that mark required vars explicitly
- Verify the token env var name in your deployment manifest matches the driver config
When it happens
Trigger: Configuring dataSource/dbUrl (e.g. for Dremio Cloud or SQL API endpoints) while leaving dremioAuthToken: '' in driver options; environment variable DREMIO_AUTH_TOKEN unset and defaulted to ''.
Common situations: Migrating from username/password config to dbUrl without adding the token; DREMIO_AUTH_TOKEN env var missing in the deployment; typos so the token env var never gets read; using dbUrl for Dremio Cloud where user/password auth is not supported.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- A user-defined contextToApiScopes function returns an incons
- A user-defined contextToApiScopes function returns a wrong s
- Unload is not configured. Please define CUBEJS_AWS_S3_OUTPUT
- Export bucket is not configured.
- Auth isn't set
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/b1fdc93e9bfb4df0.
Report an issue: GitHub.