Codex Started Failing to Create new PR

Hi,

I started using CODEX, and initially, everything was working fine apart from some minor bugs during the login process. However, today, it suddenly began giving me the error Failed to create PR each time I attempted to push changes.

Initially, I thought I might have reached a usage limit, but when I created a new conversation and repeated the same task, CODEX worked perfectly, modified files, and displayed the results correctly. However, as soon as I tried pushing the changes again, it returned the same Failed to create PR error.

Why is this happening? Does it mean I’ve reached a limit specifically on pushing to Git, even though I can continue creating new conversations and making changes, or is this a bug?

3 Likes

Same, worked for a day, the next day, errors

1 Like

Just started using today and I can’t even get my fist PR to work, it keeps failing.

Did you make the Pull Request more than once? This happened to me yesterday - but it was because there was already a branch with the same name.

It finally worked after trying multiple times. Now I am working on another task and it is not working again.

1 Like

I think the issue on the subsequent issues after it worked was that the branch that was set on the new task was main, and not the new branch I created to test. I didn’t think to check the branch again when I made the new task.

I found for me at least, If i refresh the main Codex page I find it disconnected from my GitHub. I reconnect and it works correctly again.

I am having the same issue. It was working great before, as of today it’s giving me that failed to create PR message every time. I can’t even use it at all anymore.

I even tried deleting the repository and reconnecting Git and starting the entire process over again.

1 Like

After failing for hours, I started a fresh context and it started working again.

First, delete the ChatGPT Connector from GitHub. Then, disconnect from CODEX and reconnect. If no window pops up at that point, click ā€˜Manage’ and create a new one. I just did this and it worked.

1 Like

I’m getting a ā€œBinary files are not supportedā€ error when trying to create a PR (attached). Most likely, this is due to Codex creating a __init__.pyc file in the PR. I don’t know if/how I can remove that __init__.pyc from the ~30 files in the PR.

Any suggestions?

2 Likes

No, try the following.

  1. Delete all enviroments, disconnect Github, then reconnect github and readd enviroment.
  2. If it’s an empty repository, then manually put something in it (readme.md) is fine, in the root. Then try again. Last time I checked Codex had issues with empty repositories, at least to stop worth.
  3. It sometimes has an issue with creating folders in the root, renaming folders and things like that. It’s kind of random. But if you try to get it to create new folders in root, or rename folders it gets hung up a lot sometimes. At least when creating a new one in root.

Try these. From experience.

Was able to get 2 PRs merged when I first signed up, but I’m now consistently having the same problem as others: ā€œFailed to create PRā€. Have already tried all the suggestions in this thread.. deleted environments, disconnected github, deleted all existing PRs, etc.. No luck, it is stuck with the error now it seems. All the PR is trying to do is editing a couple lines and renaming some files. What it does do is create a new branch for it’s changes (which I can see on github), but it does not commit any of it’s changes to the branch.

Hope they fix this soon. Would be nice if it at least gave some information as to why it could not create the PR.

I am also getting this error. Pretty much every project I start that has any code to begin with ends up with this issue. I started one with some stubs and framework that 4o put together for me and then uploaded that to a repo and built it out from there using codex and it worked well. However, when i fork a repo or add code from an existing local project to a repo and then try to use codex on it I get this error.

Does anyone else having the issue have .gitignore set up in their repo? Wondering if this is part of the issue?

I also had that problem. Using git LFS solved it.

Same issue happening to me. Unfortunately this is making Codex unusable for me :frowning:

1 Like

This most likely because your agent is pushing a binary file eg a sql database to the repo, might help to check the individual files the agent is attempting to push before generating a PR.

After trying several things, I discovered that some files were encoded in UTF-16LE with BOM. Re-encoding them to UTF-8 fixed the issue for me. Hope that helps!

i had about 5 prompts give that error, do you have to abandon the task?