cube-js/cube · critical

Something wrong with downloading Cube Store before running…

Error message

Something wrong with downloading Cube Store before running it.

What it means

Thrown by CubeStoreHandler.getBinary after attempting an automatic download of the Cube Store binary: even though downloadBinaryFromRelease() resolved, the expected executable at <cubestore>/downloaded/latest/bin/cubestored[.exe] still does not exist on disk. It is a sanity check indicating the download-or-extract step silently failed to produce the binary (or wrote it elsewhere).

Solutions

  1. Delete the stale downloaded directory (node_modules/@cubejs-backend/cubestool/downloaded or rust/cubestore/downloaded) and re-run install/start to force a clean re-download.
  2. Check filesystem permissions on the package directory; reinstall with a writable node_modules (avoid sudo/local permission mismatches; fix npm/yarn cache ownership).
  3. Disable/whitelist antivirus interception of cubestored and re-download.
  4. Check disk space and network/proxy settings; retry the install.
  5. As a workaround, build cubestored from source and place it at <package>/downloaded/latest/bin/cubestored, or run Cube Store separately via Docker instead of the auto-download path.

Example fix

// before
rm -rf node_modules && yarn install   # may reuse a corrupt cache entry
// after
cd node_modules/@cubejs-backend/cubestool
rm -rf downloaded/latest
ls -la downloaded/latest/bin/cubestored  # verify binary exists after re-download
Defensive patterns

Strategy: fallback

Validate before calling

import fs from 'fs';
import { getBinaryPath } from '@cubejs-backend/cubestool/dist/process';
if (!fs.existsSync(getBinaryPath())) {
  console.warn('cubestored missing; will trigger download — ensure writable node_modules and no AV interference.');
}

Type guard

function binaryExists(path: string): path is string {
  return fs.existsSync(path) && fs.statSync(path).size > 0;
}

Try / catch

try {
  await cubeStoreHandler.acquire();
} catch (e) {
  if (/Something wrong with downloading Cube Store/.test(String(e))) {
    await rmrf(path.join(cubestoolDir, 'downloaded', 'latest'));
    await cubeStoreHandler.acquire(); // clean re-download
  } else { throw e; }
}

Prevention

When it happens

Trigger: acquire() -> getBinary(): fs.existsSync(getBinaryPath()) is false, downloadBinaryFromRelease() completes without throwing (e.g. download reported OK but extraction produced nothing, or a partially-failed download left no executable), and the post-download fs.existsSync check still fails.

Common situations: Antivirus/endpoint security quarantining cubestored.exe right after extraction; corrupted or interrupted tar.gz extraction into the download dir; disk-permission issues preventing write into the package's downloaded/ folder (read-only node_modules, CI caches); running in a container where the previous failed run left an empty downloaded/latest directory that confuses path resolution; network middleboxes returning HTML error pages that pass non-404 checks.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/96356db49166949b. Report an issue: GitHub.

Appendix: source

Thrown at rust/cubestore/js-wrapper/src/process.ts:128

  // Promise that works as mutex, but can be rejected
  protected cubeStoreStarting: Promise<ChildProcess> | null = null;

  // Flag when release was requested, in this state, we skip restart on exit
  protected releaseRequested: boolean = false;

  public constructor(
    protected readonly config: Readonly<CubeStoreHandlerOptions>
  ) {}

  protected async getBinary() {
    const pathToExecutable = getBinaryPath();

    if (!fs.existsSync(pathToExecutable)) {
      await downloadBinaryFromRelease();

      if (!fs.existsSync(pathToExecutable)) {
        throw new Error('Something wrong with downloading Cube Store before running it.');
      }
    }

    return pathToExecutable;
  }

  public async acquire() {
    if (this.cubeStore) {
      return this.cubeStore;
    }

    if (this.cubeStoreStarting) {
      return this.cubeStoreStarting;
    }

    const onExit = (code: number | null) => {
      if (this.releaseRequested) {
        return;

View on GitHub (pinned to 7d981676b3)