stablyai/orca · error · AggregateError
Failed to invalidate Codex session backfill marker
Error message
Failed to invalidate Codex session backfill marker
What it means
Thrown as AggregateError when invalidating the Codex session backfill completion marker fails twice: first rmSync(markerPath, {force:true}) threw, then the fallback writeFileAtomically to overwrite the marker with {version:0, invalidatedAt} also threw. Both original errors are aggregated so the caller sees both causes. A stuck marker would suppress the next backfill opt-in, so this is surfaced rather than swallowed.
Source
Thrown at src/main/codex/codex-session-backfill-marker.ts:85
)}\n`
)
}
export function invalidateCodexSessionBackfillMarker(markerPath: string): void {
markerInvalidationGeneration += 1
try {
// Why: a managed-lane system-default launch can create new source
// rollouts, so a prior one-time marker must not suppress the next opt-in.
rmSync(markerPath, { force: true })
} catch (error) {
console.warn('[codex-session-backfill] Failed to invalidate completion marker:', error)
try {
writeFileAtomically(
markerPath,
`${JSON.stringify({ version: 0, invalidatedAt: Date.now() })}\n`
)
} catch (fallbackError) {
throw new AggregateError(
[error, fallbackError],
'Failed to invalidate Codex session backfill marker'
)
}
}
}
View on GitHub (pinned to 1136503c6a)
Solutions
- Check permissions on dirname(markerPath) — the Orca process needs write/delete access.
- Free disk space if full.
- On Windows, ensure no process holds an exclusive lock on the marker file.
- Verify the marker path is still valid after any CODEX_HOME / userData relocation.
- Manually delete the marker file if the process cannot, then let Orca recreate it.
Defensive patterns
Strategy: try-catch
Validate before calling
import { access, constants } from 'node:fs/promises'
import { dirname } from 'node:path'
try {
await access(dirname(markerPath), constants.W_OK | constants.X_OK)
} catch {
// marker dir not writable; skip invalidation or fix permissions first
} Type guard
function isBackfillMarkerInvalidationError(error: unknown): boolean {
return error instanceof AggregateError && error.message === 'Failed to invalidate Codex session backfill marker'
} Try / catch
try {
invalidateCodexSessionBackfillMarker(markerPath)
} catch (error) {
if (error instanceof AggregateError) {
// both rm and overwrite failed; log and continue — a stale marker only suppresses one backfill opt-in
console.warn('marker invalidation failed; will retry on next launch', error.errors)
} else throw error
} Prevention
- Keep the Orca state directory writable by the process.
- Ensure adequate disk space and stable mount for the state dir.
- On Windows, exclude the state dir from antivirus locking.
- A failed invalidation is not fatal — the backfill re-runs on the next version bump.
When it happens
Trigger: The marker file's directory has restrictive permissions (rm and write both denied); the marker path is on a read-only filesystem; the parent directory was deleted; an OS file lock (Windows) blocks both delete and write; disk is full so the atomic temp write fails.
Common situations: Permissions on the Orca state directory were tightened; the state dir is on a read-only mount; antivirus locking on Windows; disk-full; the path is invalid after a home-directory change.
Related errors
- Computer screenshot temp path is not owned by the current us
- Orca could not safely move this legacy Codex session into yo
- Legacy rollout source is not a regular file.
- The target filesystem cannot safely install this rollout.
- A different rollout already occupies the real-home target pa
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/6d71afe10b6e3cbc.
Report an issue: GitHub.