Skip to content

bug: No such file or directory #121

Closed

Description

@jayshrivastava

I'm getting this bug on Macos 15.2. The program is unable to edit files. It's likely a permissions issue.

export OPENAI_API_KEY=XXXXX && codex -m gpt-4o --full-auto
    command

    $ ls

    command.stdout (code: 0, duration: 0s)

    CONTRIBUTING.md
    LICENSE.md
    README.md
    app
    ... (18 more lines)

    codex
    The directory contains the following files and folders:

        * `CONTRIBUTING.md`
        * `LICENSE.md`
        * `README.md`

(truncated)

    If you need to modify or access any specific files, feel free to let me know!
user
add any line to README.md

    codex
    Let's add a comment line to the README.md. I'll proceed with that.

    command

    $ "echo '
    <\!-- This is a sample comment added for demonstration purposes. -->
    ' >> README.md"

    command.stdout (code: 71, duration: 0s)

    sandbox-exec: execvp() of 'echo '
    <!-- This is a sample comment added for demonstration purposes. -->
    ' >> README.md' failed: No such file or directory


    codex
    I encountered an issue with the execution environment. Let's modify the README.md directly using a patch.

    command

    $ 'cat README.md'

    command.stdout (code: 71, duration: 0s)

    sandbox-exec: execvp() of 'cat README.md' failed: No such file or directory


    codex
    It seems there's a consistent error accessing the file. Could you please confirm if I need special permissions or a specific method to modify README.md in this environment?

Activity

  1. changed the title [-]bug: getting `No such file or directory`[/-] [+]bug: No such file or directory[/+] on Apr 16, 2025
  2. Abhijrathod commented on Apr 16, 2025

    @Abhijrathod

    Open System Settings and select Privacy & Security > Full Disk Access.

    Click the Add button and select your preferred terminal app.

    To ensure that the changed permissions are applied, restart your terminal.

    Now, if you're still encountering roadblocks, let's troubleshoot like experts:
    SIP might be acting as a gatekeeper. If you try to access files in protected locations such as /System or /Applications, System Integrity Protection (SIP) will prohibit you. To avoid the drama, stick to your home folder (~/Documents, ~/Desktop).

    Sandbox issues? If you’re on a local dev machine and you’re sure it’s safe, you can temporarily disable the sandbox for testing (but don’t make this a habit, it’s like leaving your front door unlocked):
    bash

    sudo spctl --master-disable

    Or if you’re running codex in a script, try bypassing the sandbox entirely:

    /usr/bin/env codex ...

    Check your codex setup. If it’s acting funky, it might be sandboxed or calling the shell wrong (especially if you installed it with some janky script). Test if your system’s cool by running:

    echo "Test line" >> README.md

  3. added
    bug
    on Apr 16, 2025
  4. MovGP0 commented on Apr 18, 2025

    @MovGP0

    I encountered a similar issue where I gave codex the full path to a file and it was unable to find the file.

    Windows 11
    PowerShell

  5. codex-maintainers commented on Aug 7, 2025

    @codex-maintainers

    Thank you for the feedback! Please try again with the latest version of Codex CLI. If the issue persists, feel free to let us know.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions