{"record":{"id":"b1fdc93e9bfb4df0","repo":"cube-js/cube","slug":"dremioauthtoken-is-blank","errorCode":null,"errorMessage":"dremioAuthToken is blank","messagePattern":"dremioAuthToken is blank","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-dremio-driver/driver/DremioDriver.js","lineNumber":97,"sourceCode":"        config.ssl ||\n        getEnv('dbSsl', { dataSource, preAggregations }),\n      ...config,\n      pollTimeout: (\n        config.pollTimeout ||\n        getEnv('dbPollTimeout', { dataSource, preAggregations }) ||\n        getEnv('dbQueryTimeout', { dataSource, preAggregations })\n      ) * 1000,\n      pollMaxInterval: (\n        config.pollMaxInterval ||\n        getEnv('dbPollMaxInterval', { dataSource, preAggregations })\n      ) * 1000,\n    };\n\n    if (this.config.dbUrl) {\n      this.config.url = this.config.dbUrl;\n      this.config.apiVersion = '';\n      if (this.config.dremioAuthToken === '') {\n        throw new Error('dremioAuthToken is blank');\n      }\n    } else {\n      const protocol = (this.config.ssl === true || this.config.ssl === 'true')\n        ? 'https'\n        : 'http';\n      this.config.url = `${protocol}://${this.config.host}:${this.config.port}`;\n      this.config.apiVersion = '/api/v3';\n    }\n  }\n\n  /**\n   * @public\n   * @return {Promise<void>}\n   */\n  async testConnection() {\n    return this.getToken();\n  }\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-dremio-driver/driver/DremioDriver.js#L79-L115","documentation":"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.","triggerScenarios":"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 ''.","commonSituations":"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.","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"],"exampleFix":"// before\nnew DremioDriver({ dbUrl: 'dremio+sql://...', dremioAuthToken: '' })\n// after\nnew DremioDriver({ dbUrl: 'dremio+sql://...', dremioAuthToken: process.env.DREMIO_AUTH_TOKEN })","handlingStrategy":"validation","validationCode":"if (config.dbUrl && !config.dremioAuthToken) {\n  throw new Error('dbUrl requires dremioAuthToken (set DREMIO_AUTH_TOKEN)');\n}","typeGuard":"function hasAuthToken(config) {\n  return typeof config.dremioAuthToken === 'string' && config.dremioAuthToken.length > 0;\n}","tryCatchPattern":"try {\n  driver = new DremioDriver(config);\n} catch (e) {\n  if (e.message === 'dremioAuthToken is blank') {\n    console.error('Set DREMIO_AUTH_TOKEN when using dbUrl');\n    process.exit(1);\n  } else { throw e; }\n}","preventionTips":["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"],"tags":["dremio","configuration","authentication","missing-credential"],"backgroundTag":"missing-env-var","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}