Skip to content

Failed to write file - Permission denied (os error 13) #1829

Closed

Description

@kelso

What version of Codex is running?

codex-cli 0.11.0

Which model were you using?

codex-mini-latest

What platform is your computer?

Linux 5.15.167.4-microsoft-standard-WSL2 aarch64 aarch64

What steps can reproduce the bug?

  1. run codex as codex -a never
  2. enter any prompt that will modify project files

What is the expected behavior?

Files are modified/created,

What do you see instead?

applying patch
(...)

event
PatchApplyEnd(PatchApplyEndEvent { call_id: "call_pNSNkpWbKeW6yIryVZNy1aiw", stdout: "", stderr: "Failed to write file app/views/dashboard/media_items/_media_item.html.erb\n\nCaused by:\n    Permission denied (os error 13)\n", success: true })

And btw the result is taking too much time - like minutes for basic question, i.e. "create new file example.txt"

Additional information

No response

Activity

  1. added
    bug
    on Aug 4, 2025
  2. slimndap commented on Aug 7, 2025

    @slimndap

    Is this on the radar? I am still seeing this in v0.14.0. It was introduced in v0.11.0. The only way to keep using Codex CLI is by reverting back to 0.10.0.

    I am on macOs Monterey 12.7.6.

    Output in codex-cli 0.14.0:

    ✏️ Applying patch to 1 file (+13 -2)
      ⎿ /Users/[...].php (+13 -2)
    
    ✘ Failed to apply patch
      ⎿ Failed to write file [...].php
    
  3. kelso commented on Aug 11, 2025

    @kelso
    Author

    Interesting, after updating to the v0.14.0 on my platform (Linux 5.15.167.4-microsoft-standard-WSL2 aarch64 aarch64) it runs fine.

  4. added
    windows-os
    on Aug 12, 2025
  5. slimndap commented on Aug 14, 2025

    @slimndap

    The problem is still present in 0.21.0 - codex-x86_64-apple-darwin:

    ✘ Failed to apply patch
      ⎿ Failed to write file includes/[...].php
    
    codex
    I can’t modify files directly in read-only mode, but here’s the exact patch you 
    can apply to `[...].php` to replace the AI call with simple structured‐data handling:
    

    Again, the problem was introduced in v0.11.0 and remained present in all release after that.
    If I downgrade to 0.10.0, the problem is gone.

  6. slimndap commented on Aug 14, 2025

    @slimndap

    If files a follow-up issue #2295 since this one was closed.

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

    bugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions