Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh pr merge can't be merged right now; try again in a few seconds #2544

Closed
AndrewCS149 opened this issue Dec 3, 2020 · 8 comments
Closed
Labels
bug Something isn't working good first issue help wanted Contributions welcome p3 Affects a small number of users or is largely cosmetic

Comments

@AndrewCS149
Copy link

For some reason when I try to merge a pr with gh pr merge from my development branch into master I get the following error:

Pull request #1 (Initial Commit.) can't be merged right now; try again in a few seconds

I am able to create and merge pr's from any other branch except into master. I have to go into the Github each time to commit the merge. My master did have a protection rule on it, but I took it off to see if that had any effect and it did not. I'm fairly certain that I have been able to merge into master before but I started having this issue more recently.

@AndrewCS149 AndrewCS149 added the bug Something isn't working label Dec 3, 2020
@mislav
Copy link
Contributor

mislav commented Dec 4, 2020

@AndrewCS149 Thank you for reporting!

We show this error message when the merge status of the PR as reported by the API is UNKNOWN. If you try later with gh pr merge for the same PR, does it start working? Or do you eventually have to go to the web interface to merge it? When you do go to the web interface for a PR that's not mergeable by gh, what does the web merge box say?

@AndrewCS149
Copy link
Author

Even if I wait and try to merge later through the CLI I get the same error. I end up having to merge through the web app every time. The web app merge goes over smoothly as if there nothing wrong.

@mislav mislav added p3 Affects a small number of users or is largely cosmetic and removed needs-user-input labels Dec 4, 2020
@mislav
Copy link
Contributor

mislav commented Dec 4, 2020

Thanks, @AndrewCS149. I guess the solution would be to avoid erroring out on UNKNOWN merge status and just allow the merge to proceed— based on your experience, it's likely that it would succeed.

@mislav mislav added good first issue help wanted Contributions welcome labels Dec 4, 2020
@AndrewCS149
Copy link
Author

I'm not exactly sure what you mean. If I try to merge it through the CLI, I immediately get the error.

@mislav
Copy link
Contributor

mislav commented Dec 7, 2020

@AndrewCS149 Sorry that I wasn't more clear— I meant to say that we could try removing the condition in CLI source code that tests for UNKNOWN merge status and errors out immediately. Due to aborting early, CLI does not even attempt the API merge. I'm thinking that if it did, the merge may be successful. If it's not, then the user will get an equivalent error message from the API.

@justAnotherDev
Copy link

I am also experiencing this issue, is this a recent introduction? Is it possible to downgrade gh to bypass this error until fixed?

@justAnotherDev
Copy link

also you had this exact idea when the original PR was created @mislav 😄 :

"UNKNOWN" usually means that mergeability is currently still being calculated. Instead of presenting this as an error, we could be optimistic and assume that the PR is OK to merge and allow the API merge operation to proceed—it has a chance of succeeding, and if it fails the API error message should let us know why.

https://github.com/cli/cli/pull/899/files/28d8a9e7819eaf33c9ea0ae2ed35c5a636b38d3f#r429839747

@mislav
Copy link
Contributor

mislav commented Dec 15, 2020

Fixed in trunk 🤘

@mislav mislav closed this as completed Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue help wanted Contributions welcome p3 Affects a small number of users or is largely cosmetic
Projects
None yet
Development

No branches or pull requests

3 participants