{"record":{"id":"2949e6583b560f80","repo":"cube-js/cube","slug":"error-during-upload-of-filename-create-table","errorCode":null,"errorMessage":"Error during upload of ${fileName} create table: ${createTableSqlWithoutLocation}: ${error.error}","messagePattern":"Error during upload of (.+?) create table: (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts","lineNumber":392,"sourceCode":"        if (!currentFileStream) {\n          const writer = csvWriter({ headers: columns.map(c => c.name) });\n          const tempFile = tempy.file();\n          tempFiles.push(tempFile);\n          const gzipStream = createGzip();\n          pipelinePromises.push(new Promise((resolve, reject) => {\n            pipeline(writer, gzipStream, createWriteStream(tempFile), (err) => {\n              if (err) {\n                reject(err);\n              }\n\n              const fileName = `${table}-${fileCounter++}.csv.gz`;\n              filePromises.push(fetch(`${baseUrl.replace(/^ws/, 'http')}/upload-temp-file?name=${fileName}`, {\n                method: 'POST',\n                body: createReadStream(tempFile),\n              }).then(async res => {\n                if (res.status !== 200) {\n                  const error = await res.json();\n                  throw new Error(`Error during upload of ${fileName} create table: ${createTableSqlWithoutLocation}: ${error.error}`);\n                }\n                return fileName;\n              }));\n\n              resolve(null);\n            });\n            currentFileStream = { stream: writer, tempFile };\n          }));\n        }\n        if (!currentFileStream) {\n          throw new Error('Stream init error');\n        }\n        return currentFileStream;\n      };\n\n      let rowCount = 0;\n\n      const endStream = (chunk, encoding, callback) => {","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts#L374-L410","documentation":"During stream import, temp files are POSTed to Cube Store's /upload-temp-file endpoint. If the server responds with non-200, the driver reads the JSON error body and throws this message including the file name and the CREATE TABLE SQL, surfacing the Cube Store-side error.","triggerScenarios":"POST to ${baseUrl}/upload-temp-file?name=... returns status != 200 — Cube Store unreachable/misconfigured, disk full on Cube Store side, rejected file name, or HTTP/WS proxy misrouting (baseUrl ws->http rewrite failing).","commonSituations":"Cube Store process down or restarted during pre-aggregation build; wrong CUBEJS_CUBESTORE_HOST/PORT; Cube Store version mismatch rejecting the request; network/firewall issues; auth token mismatch between cube.js and Cube Store.","solutions":["Check Cube Store logs for the underlying `error` in the response body.","Verify CUBEJS_CUBESTORE_HOST/PORT and that Cube Store is running/reachable.","Restart the pre-aggregation build and confirm disk space on the Cube Store host.","Align Cube Store and cube.js versions (cubestore upgrade)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// check Cube Store reachability before heavy builds\nconst res = await fetch(`http://${cubestoreHost}:${cubestorePort}/v1/status`);\nif (!res.ok) throw new Error('Cube Store is not reachable before pre-aggregation upload');","typeGuard":null,"tryCatchPattern":"try {\n  await driver.uploadTable(table, columns, tableData);\n} catch (e) {\n  if (e.message.startsWith('Error during upload of')) {\n    console.error('Cube Store rejected temp-file upload; check Cube Store logs and disk space');\n    await retryWithBackoff(() => driver.uploadTable(table, columns, tableData), 3);\n  }\n  throw e;\n}","preventionTips":["Monitor Cube Store process health and disk space.","Verify CUBEJS_CUBESTORE_HOST/PORT and auth token settings.","Keep Cube Store and cube.js versions in sync.","Add retries with backoff for transient network failures during builds."],"tags":["cubestore","upload","network"],"backgroundTag":"cubestore-upload-failed","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}