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

Pull request creation fails #282

Closed
JanDeDobbeleer opened this issue Jul 15, 2022 · 13 comments
Closed

Pull request creation fails #282

JanDeDobbeleer opened this issue Jul 15, 2022 · 13 comments

Comments

@JanDeDobbeleer
Copy link
Contributor

Brief description of your issue

Submitting a PR fails with the following error:

Octokit.NotFoundException: Not Found
   at Octokit.Connection.HandleErrors(IResponse response)
   at Octokit.Connection.RunRequest(IRequest request, CancellationToken cancellationToken)
   at Octokit.Connection.Run[T](IRequest request, CancellationToken cancellationToken)
   at Octokit.ApiConnection.Patch[T](Uri uri, Object data)
   at Microsoft.WingetCreateCore.Common.GitHub.UpdateForkedRepoWithUpstreamCommits(Repository forkedRepo)
   at Microsoft.WingetCreateCore.Common.GitHub.<>c__DisplayClass19_0.<<SubmitPRAsync>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Polly.AsyncPolicy.<>c__DisplayClass40_0.<<ImplementationAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int[32](https://github.com/JanDeDobbeleer/oh-my-posh/runs/7357897751?check_suite_focus=true#step:3:33) permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext)
   at Polly.AsyncPolicy.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
   at Microsoft.WingetCreateCore.Common.GitHub.SubmitPRAsync(String packageId, String version, Dictionary`2 contents, Boolean submitToFork)
   at Microsoft.WingetCreateCore.Common.GitHub.SubmitPRAsync(String packageId, String version, Dictionary`2 contents, Boolean submitToFork)
   at Microsoft.WingetCreateCLI.Commands.BaseCommand.GitHubSubmitManifests(Manifests manifests)
   at Microsoft.WingetCreateCLI.Commands.SubmitCommand.SubmitManifest()
   at Microsoft.WingetCreateCLI.Commands.SubmitCommand.Execute()
   at Microsoft.WingetCreateCLI.Program.Main(String[] args)
{"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/git#update-a-reference"}

Steps to reproduce

Submit a PR ;-)

Expected behavior

It submits the PR

Actual behavior

It fails at submitting the PR

Environment

took https://aka.ms/wingetcreate/latest/self-contained
@ghost ghost added the Needs-Triage label Jul 15, 2022
@JanDeDobbeleer
Copy link
Contributor Author

I have the impression Azure is having issues so it can be related.

@ldennington
Copy link

My team is also seeing this issue in our winget workflows.

@ryfu-msft
Copy link
Contributor

@JanDeDobbeleer, I just tried submitting a manifest and it was successful. Could you try again and let me know? We haven't made any changes or pushed out any recent releases so I'm thinking it could be a one-off.

@matbech
Copy link

matbech commented Jul 15, 2022

I'm still seeing the same issue here.

@JanDeDobbeleer
Copy link
Contributor Author

@ryfu-msft the problem persists.

@ryfu-msft
Copy link
Contributor

@JanDeDobbeleer, have you already tried fetching new commits and merging them into your fork's master branch? I suspect you are possibly encountering issue #234 again.

@JanDeDobbeleer
Copy link
Contributor Author

@ryfu-msft correct, updating my master branch makes everything work again. That does mean that the previous fix on your end no longer works, right?

For anyone else, how to update your master branch:

git remote add upstream git@github.com:microsoft/winget-pkgs.git
git switch master
git reset upstream/master --hard 
git push

On another note, can we rename master to main one day? It's 2022 after all ;-)

@kevinoid
Copy link

I suspect you are possibly encountering issue #234 again.

@ryfu-msft Is there an open issue for this? Expecting users to know to update their master branch when they get an Octokit.NotFoundException: Not Found error message doesn't seem like acceptable UX.

@ryfu-msft
Copy link
Contributor

@kevinoid, yes, you are correct. I will address that in a bug fix soon and report an appropriate error message. I will also need to take another look at my previous fix from #235. I verified this multiple times during implementation, but it seems like after a certain number of commits behind, it fails to perform the update.

@kevinoid
Copy link

Thanks @ryfu-msft, I appreciate it!

@mar10
Copy link

mar10 commented Jul 23, 2022

I came accross the same problem.
Shouldn't this issue be kept 'open' until #289 is merged and confirmed to fix it?

FWIW: 'Fetch and Merge' is a workaround, that worked for me:

image

@Masamune3210
Copy link

Unfortunately, fetch and merge wont work if its too far behind or if there are conflicts that require manual intervention

@RunTheBot
Copy link

I have the same issue, did anyone have a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants