{"record":{"id":"54f08c00c6f5e466","repo":"cube-js/cube","slug":"cubejs-enable-tls-has-been-deprecated-and-removed","errorCode":null,"errorMessage":"CUBEJS_ENABLE_TLS has been deprecated and removed.","messagePattern":"CUBEJS_ENABLE_TLS has been deprecated and removed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-server/src/server.ts","lineNumber":106,"sourceCode":"  public async listen(options: http.ServerOptions = {}): Promise<{app: Express, port: number, server: GracefulHttpServer, version: any }> {\n    try {\n      if (this.server) {\n        throw new Error('CubeServer is already listening');\n      }\n\n      const app = express();\n      app.use(cors(this.config.http.cors));\n      app.use(bodyParser.json({ limit: getEnv('maxRequestSize') }));\n\n      if (this.config.gracefulShutdown) {\n        app.use(gracefulMiddleware(this.status, this.config.gracefulShutdown));\n      }\n\n      await this.core.initApp(app);\n\n      const enableTls = getEnv('tls');\n      if (enableTls) {\n        throw new Error('CUBEJS_ENABLE_TLS has been deprecated and removed.');\n      }\n\n      this.server = gracefulHttp(http.createServer(options, app));\n\n      if (this.config.webSockets) {\n        this.socketServer = new WebSocketServer(this.core, this.config);\n        this.socketServer.initServer(this.server);\n      }\n\n      if (this.config.sqlPort || this.config.pgSqlPort) {\n        this.sqlServer = this.core.initSQLServer();\n        await this.sqlServer.init(this.config);\n      }\n\n      if (this.config.serverKeepAliveTimeout) {\n        this.server.keepAliveTimeout = this.config.serverKeepAliveTimeout;\n      }\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-server/src/server.ts#L88-L124","documentation":"TLS support via the CUBEJS_ENABLE_TLS environment variable was deprecated and removed from Cube Server. During listen(), if getEnv('tls') resolves truthy, Cube throws immediately rather than attempting a TLS listen it no longer supports. TLS must now be terminated externally (reverse proxy/load balancer) or via other means.","triggerScenarios":"Starting CubeServer.listen() in an environment where CUBEJS_ENABLE_TLS is set (to 'true', '1', etc.), triggering the getEnv('tls') check right after initApp.","commonSituations":"Older deployments (Docker, Kubernetes manifests, docker-compose files) that still export CUBEJS_ENABLE_TLS; upgrade from an older Cube version where TLS-in-process was supported; copy-pasted env templates.","solutions":["Remove the CUBEJS_ENABLE_TLS environment variable from the deployment environment","Terminate TLS with a reverse proxy or load balancer (nginx, Traefik, ALB) in front of Cube","Audit Docker/K8s env files and CI configs for leftover CUBEJS_ENABLE_TLS after upgrading","Check Cube docs for the current recommended TLS/HTTPS setup"],"exampleFix":"// before (docker-compose env)\nenvironment:\n  - CUBEJS_ENABLE_TLS=true\n// after\nenvironment:\n  - CUBEJS_API_PORT=4000\n# terminate TLS at your proxy/load balancer instead","handlingStrategy":"validation","validationCode":"if (process.env.CUBEJS_ENABLE_TLS) {\n  throw new Error('CUBEJS_ENABLE_TLS is no longer supported; remove it and terminate TLS at your proxy');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await server.listen();\n} catch (e) {\n  if (e.message.includes('CUBEJS_ENABLE_TLS has been deprecated')) {\n    console.error('Unset CUBEJS_ENABLE_TLS and terminate TLS externally');\n  } else { throw e; }\n}","preventionTips":["Audit deployment env files for CUBEJS_ENABLE_TLS after upgrading","Terminate TLS at a reverse proxy/load balancer in front of Cube","Check release notes for removed env vars when upgrading Cube"],"tags":["tls","deprecation","environment","startup"],"backgroundTag":"removed-environment-variable","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}