Skip to content

[Bug][Windows] Remote Link enrollment fails (EPERM) when .codex/opencodex-catalog.json is read-only #8358

Closed

Description

@lidge-jun

Summary

On Windows, linking a Child fails with Remote Link failed during Child enrollment when %USERPROFILE%\.codex\opencodex-catalog.json has the read-only attribute. The Child's catalog write uses temp-file + rename, and the rename fails with EPERM.

Observed (Home 2.99.0 macOS → Child 2.99.0 Windows 11)

  • Child service.log on start:
    catalog sync skipped: EPERM: operation not permitted, rename 'C:\Users\<user>\.codex\opencodex-catalog.json.ocx.16776.8.tmp' -> 'C:\Users\<user>\.codex\opencodex-catalog.json'
    
  • attrib showed A R on the catalog (file dated 2026-09-16; how it became read-only is unknown — possibly an older ocx/Codex version or an external tool).
  • ocx link add failed twice at the enrollment phase in ~16 s. Child afterwards: state: disconnected, token: missing, rotation: clean.
  • After attrib -R on the file, the same ocx link add succeeded immediately; readiness ready, codex exec through the link returned the expected reply.

In standalone mode this is only a "skipped" log line, so the stale (Sept) catalog silently stayed in use for weeks.

Suggested fix

  • When the rename fails with EPERM on Windows and the target is read-only, clear the attribute (or replace via ReplaceFileW/unlink-then-rename) since OpenCodex owns this file, or
  • at least fail with a specific message (Codex catalog is read-only: <path>), and surface it through ocx link add, ocx connect status, and ocx doctor.
  • Consider treating "catalog sync skipped" as a health warning rather than an info line.

Acceptance

A Windows Child with a read-only opencodex-catalog.json either links successfully or fails with an error naming the file and attribute.

Activity

  1. added
    catalog
    platform
    on Nov 8, 2026
  2. added a commit that references this issue on Nov 9, 2026
    a72c522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    catalogplatform

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions