Yeachan-Heo/oh-my-codex · error · Error

[native-assets] cache publication verification failed for ${

Error message

[native-assets] cache publication verification failed for ${cachedBinaryPath}

What it means

publishManagedNativeBinary returned undefined while trying to publish the extracted platform binary into the cache at cachedBinaryPath, i.e. the atomic publish path bailed out and the post-publish verification could not be satisfied for that path. The thrown wrapper names the exact cached binary path that failed.

Source

Thrown at src/cli/native-assets.ts:748

      );
      try {
        await downloadFile(asset.download_url, archivePath);
        const archiveStat = await stat(archivePath);
        if (typeof asset.size === 'number' && asset.size > 0 && archiveStat.size !== asset.size) {
          throw new Error(`[native-assets] downloaded archive size mismatch for ${asset.archive}`);
        }
        const digest = await sha256ForFile(archivePath);
        if (digest !== asset.sha256) {
          throw new Error(`[native-assets] checksum mismatch for ${asset.archive}`);
        }

        const archiveEntries = await inspectNativeArchive(archivePath);
        const archiveBinary = selectNativeArchiveBinary(archiveEntries, asset.binary_path);
        await writeSelectedNativeArchiveMember(archivePath, archiveBinary.path, extractedBinaryPath);

        const published = await publishManagedNativeBinary(extractedBinaryPath, cachedBinaryPath, platform, env);
        if (published) return published;
        throw new Error(`[native-assets] cache publication verification failed for ${cachedBinaryPath}`);
      } catch (error) {
        if (index < assets.length - 1 && isUnavailableArchiveError(error)) {
          await rm(archivePath, { force: true });
          await rm(extractedBinaryPath, { force: true });
          continue;
        }
        throw error;
      }
    }
    return undefined;
  } finally {
    await rm(tempRoot, { recursive: true, force: true });
  }
}

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Check writability and permissions of the cache root; fix like errors 293/295.
  2. Ensure no other hydration process is active for the same cache key.
  3. Set the cache-root env override to a writable local path and retry.
Defensive patterns

Strategy: fallback

Validate before calling

import { access, constants } from 'node:fs/promises';
async function canPublish(root: string): Promise<boolean> { try { await access(root, constants.W_OK | constants.X_OK); return true; } catch { return false; } }

Try / catch

try { await hydrateNativeBinary(); } catch (e) { if (/cache publication verification failed for/.test(String(e))) { /* fix cache writability/locks (see 292-295), then retry */ } throw e; }

Prevention

When it happens

Trigger: hydrateNativeBinary after successfully extracting the archive, when the publish step cannot complete — e.g. cache root unwritable, lock issues, or verification failing on the destination; the loop then only retries on isUnavailableArchiveError for earlier assets.

Common situations: Unwritable/read-only cache roots in containers; concurrent hydration holding locks; antivirus interfering with freshly published executables.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/62d99358c2e25ce5. Report an issue: GitHub.