can1357/oh-my-pi · error · Error

Could not make omp executable: ${chmod.stderr.trim()}

Error message

Could not make omp executable: ${chmod.stderr.trim()}

What it means

After copying the omp binary to /opt/omp/omp, installAgent runs `chmod 755` on it inside the VM. A non-zero exit means the binary could not be made executable, and this error is thrown with the guest's stderr.

Source

Thrown at packages/metaharness/src/tb/agent.ts:98

		}
	}

	const binaries: AgentBinaries = { version: manifest.version };
	for (const arch of arches) binaries[arch] = cached[arch];
	return binaries;
}

/** Install omp and gateway-only configuration into one running trial microVM. */
export async function installAgent(vm: TrialVm, binaries: AgentBinaries, gateway: GatewayConfig): Promise<string> {
	const binary = binaries[vm.arch];
	if (!binary) throw new Error(`No omp binary available for guest architecture ${vm.arch}`);

	const entrypoint = "/opt/omp/omp";
	const mkdir = await vm.exec("mkdir -p /opt/omp");
	if (mkdir.exitCode !== 0) throw new Error(`Could not create /opt/omp: ${mkdir.stderr.trim()}`);
	await vm.copyTo(binary, entrypoint);
	const chmod = await vm.exec(`chmod 755 ${shellQuote(entrypoint)}`);
	if (chmod.exitCode !== 0) throw new Error(`Could not make omp executable: ${chmod.stderr.trim()}`);
	const warmup = await vm.exec(`${shellQuote(entrypoint)} --version`);
	if (warmup.exitCode !== 0) throw new Error(`omp --version failed: ${warmup.stderr.trim()}`);

	const providers = [...new Set(gateway.providers)];
	const modelLines = ["# Generated by metaharness — auth via host pm2 gateway.", "providers:"];
	for (const provider of providers) {
		modelLines.push(`  ${provider}:`);
		modelLines.push(`    baseUrl: ${gateway.url}`);
		modelLines.push("    auth: oauth");
		modelLines.push("    transport: pi-native");
		modelLines.push(`    apiKey: ${gateway.token}`);
	}
	const modelsYaml = `${modelLines.join("\n")}\n`;
	const configYaml = `providers:
  openrouterVariant: ${gateway.openrouterVariant}
modelRoles:
  vision: openrouter/qwen/qwen3.7-flash
edit:

View on GitHub (pinned to 9690622007)

Solutions

  1. Check stderr: 'No such file' means copyTo failed — verify the source binary and copy path
  2. Ensure the guest filesystem supports POSIX permissions (use ext4/overlayfs, not a shared vfat mount)
  3. Confirm the exec user owns /opt/omp/omp or is root
  4. Re-run installAgent after fixing; the chmod is idempotent

Example fix

// before: copy lands on a perms-ignoring shared mount
await vm.copyTo(binary, entrypoint);
// after: copy into a native guest path
const entrypoint = "/opt/omp/omp";
await vm.exec("mkdir -p /opt/omp");
await vm.copyTo(binary, entrypoint);
await vm.exec("chmod 755 /opt/omp/omp || (chown root:root /opt/omp/omp && chmod 755 /opt/omp/omp)");
Defensive patterns

Strategy: validation

Validate before calling

const probe = await vm.exec("touch /opt/omp/.wtest && rm /opt/omp/.wtest && chmod +x /opt/omp/.wtest 2>/dev/null; echo ok");
if (probe.exitCode !== 0) throw new Error("guest fs does not support exec permissions");

Try / catch

try {
  await installAgent(vm, binaries, gateway);
} catch (err) {
  if (String(err.message).includes("Could not make omp executable")) {
    // verify copyTo path and guest filesystem type
  }
  throw err;
}

Prevention

When it happens

Trigger: vm.exec(`chmod 755 ${shellQuote(entrypoint)}`) exits non-zero — binary not present at the path (copyTo silently failed or wrong path), chmod unsupported by the guest filesystem (e.g. FAT/9p mount), or permission denied on /opt/omp/omp ownership.

Common situations: Guest mounts /opt from a filesystem that ignores/forbids permission bits; copyTo wrote the binary to a different path than expected; running as an unprivileged user without ownership of the file.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/bba6f903ef19ac39. Report an issue: GitHub.