hcengineering/platform · error · Error

Unable to determine the required version of Rush from

Error message

Unable to determine the required version of Rush from ${RUSH_JSON_FILENAME} (${rushJsonFolder}). The 'rushVersion' field is either not assigned in ${RUSH_JSON_FILENAME} or was specified using an unexpected syntax.

What it means

writeTo in foundations/server/packages/client/src/blob.ts gives up after emptyChunkRetries consecutive empty chunks while downloading a blob and throws `Empty chunk received N times for blob <name> at offset <written>/<size>`. During the retry loop it logs ctx.warn('Empty chunk received, retrying') and backs off 100ms per attempt; this Error indicates the storage backend kept returning zero bytes so the transfer aborted partway, leaving the blob at 'written' of 'size' bytes.

Solutions

  1. Verify the blob in the storage backend — check its actual size/etag against the expected size; re-upload if truncated.
  2. Retry the blob transfer; transient storage glitches can produce empty reads that succeed on a later attempt.
  3. Delete the broken blob and regenerate it from source data, since the stored content is shorter than the advertised size.
  4. Check storage backend health/configuration (credentials, endpoint, consistency) if multiple blobs are affected.
Defensive patterns

Strategy: retry

Try / catch

try {
  await blob.writeTo(writable)
} catch (err) {
  if (String(err).startsWith('Empty chunk received')) {
    // verify blob integrity, then retry the transfer from offset 0 with backoff
    await retry(() => blob.writeTo(writable), { retries: 3, backoffMs: 500 })
  } else throw err
}

Prevention

When it happens

Trigger: Reading a blob whose reported size is larger than the actual data available in storage — each read at the current offset returns an empty chunk until the retry budget is exhausted (default consecutive empty reads).

Common situations: Truncated or corrupted blob in the storage backend (upload failed mid-write); size metadata out of sync with stored content; misconfigured/inconsistent object storage (S3/MinIO) returning empty bodies; concurrent deletion of the blob mid-read.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/b1a10ad76d878802. Report an issue: GitHub.

Appendix: source

Thrown at foundations/communication/common/scripts/install-run-rush.js:143

const RUSH_PREVIEW_VERSION = 'RUSH_PREVIEW_VERSION';
const INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE = 'INSTALL_RUN_RUSH_LOCKFILE_PATH';
function _getRushVersion(logger) {
    const rushPreviewVersion = process.env[RUSH_PREVIEW_VERSION];
    if (rushPreviewVersion !== undefined) {
        logger.info(`Using Rush version from environment variable ${RUSH_PREVIEW_VERSION}=${rushPreviewVersion}`);
        return rushPreviewVersion;
    }
    const rushJsonFolder = findRushJsonFolder();
    const rushJsonPath = path__WEBPACK_IMPORTED_MODULE_0__.join(rushJsonFolder, RUSH_JSON_FILENAME);
    try {
        const rushJsonContents = fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync(rushJsonPath, 'utf-8');
        // Use a regular expression to parse out the rushVersion value because rush.json supports comments,
        // but JSON.parse does not and we don't want to pull in more dependencies than we need to in this script.
        const rushJsonMatches = rushJsonContents.match(/\"rushVersion\"\s*\:\s*\"([0-9a-zA-Z.+\-]+)\"/);
        return rushJsonMatches[1];
    }
    catch (e) {
        throw new Error(`Unable to determine the required version of Rush from ${RUSH_JSON_FILENAME} (${rushJsonFolder}). ` +
            `The 'rushVersion' field is either not assigned in ${RUSH_JSON_FILENAME} or was specified ` +
            'using an unexpected syntax.');
    }
}
function _getBin(scriptName) {
    switch (scriptName.toLowerCase()) {
        case 'install-run-rush-pnpm.js':
            return 'rush-pnpm';
        case 'install-run-rushx.js':
            return 'rushx';
        default:
            return 'rush';
    }
}
function _run() {
    const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, ...packageBinArgs /* [build, --to, myproject] */] = process.argv;
    // Detect if this script was directly invoked, or if the install-run-rushx script was invokved to select the
    // appropriate binary inside the rush package to run

View on GitHub (pinned to 63e28dc964)