winget-create icon indicating copy to clipboard operation
winget-create copied to clipboard

Bug - Fork Sync Issue

Open PckgrBot opened this issue 1 year ago • 8 comments

Brief description of your issue

Started getting the following error - Unable to create a reference to the forked repository. This can be caused when the forked repository is behind by too many commits. Sync your fork and try again.

Steps to reproduce

Attempt to submit an update using WingetCreate

Expected behavior

Update should complete successfully

Actual behavior

Fork is not automatically syncing which is blocking the submission. It works after a manual sync has been completed from GitHub.

Environment

Windows Package Manager Manifest Creator v1.5.7.0

PckgrBot avatar Jan 09 '24 02:01 PckgrBot

Same, this happens on latest. I have to delete the forked repo and then it works again only to fail on a next release.

JanDeDobbeleer avatar Jan 11 '24 09:01 JanDeDobbeleer

This looks related to:

  • https://github.com/microsoft/winget-create/issues/282

The comment in the source code where syncing occurs explains the reason:

await retryPolicy.ExecuteAsync(async () =>
{
  // Related issue: https://github.com/microsoft/winget-create/issues/282
  // There is a known issue where a reference is unable to be created if the fork is behind by too many commits.
  // Always attempt to sync fork during first execution in order to mitigate the possibility of this scenario occurring.
  // If the fork is behind by too many commits, syncing will also fail with a NotFoundException.
  // Updating the fork can fail if it is a non-fast forward update, but this should not be blocking as pull request submission can still proceed.
  // If creating a reference fails, that means syncing the fork also failed, therefore the user will need to manually sync their repo regardless.
  if (!forkSyncAttempted && submitToFork)
  {
      forkSyncAttempted = true;
      await this.UpdateForkedRepoWithUpstreamCommits(repo);
  }

  await this.github.Git.Reference.Create(repo.Id, new NewReference($"refs/{newBranchNameHeads}", upstreamMasterSha));
});

Looking at how we can do things differently, I can only find this issue (which recommends the same method wingetcreate uses already) in the library's repo

I also doubt that it's only occurring on the latest version (1.5.7.0 currently) of wingetcreate, since there hasn't been any notable changes to the GitHub flow in this release 👀

mdanish-kh avatar Jan 11 '24 12:01 mdanish-kh

Can you try and get any logs when this occurs? You can use wingetcreate info command to see the logs directory

mdanish-kh avatar Jan 11 '24 12:01 mdanish-kh

@mdanish-kh this is running inside a GitHub runner so that won't be possible I'm afraid.

JanDeDobbeleer avatar Jan 11 '24 12:01 JanDeDobbeleer

Are there any recommendations or steps we can follow to fix this?

Ideally it should not happen.

matifali avatar Jan 26 '24 19:01 matifali

@matifali You can take a look at PR https://www.github.com/microsoft/devhome/pull/2167/files (how the guys over at devhome are attempting to fix this)

mdanish-kh avatar Jan 26 '24 19:01 mdanish-kh

This seems to be a more cleaner solution, as no configuration is required - https://github.com/apps/pull

vedantmgoyal9 avatar Jan 27 '24 02:01 vedantmgoyal9

@mdanish-kh I have the same problem, in case you still need logs.

Logs
2024-02-23 17:26:32.3262|TRACE|Microsoft.WingetCreateCLI.Program.Main|Command line args: C:\Program Files\WindowsApps\Microsoft.WindowsPackageManagerManifestCreator_1.6.1.0_x64__8wekyb3d8bbwe\WingetCreateCLI\WingetCreateCLI.dll new https://us.download.nvidia.com/nvapp/client/10.0.0.499/NVIDIA_app_beta_v10.0.0.499.exe
2024-02-23 17:26:32.4086|TRACE|Microsoft.WingetCreateCLI.Commands.BaseCommand.LoadGitHubClient|No token parameter, reading cached token
2024-02-23 17:26:32.4468|TRACE|Microsoft.WingetCreateCLI.Commands.BaseCommand.CheckGitHubTokenAndSetClient|Checking repo access using provided token
2024-02-23 17:26:33.0580|TRACE|Microsoft.WingetCreateCLI.Commands.BaseCommand.CheckGitHubTokenAndSetClient|Access check was successful, proceeding
2024-02-23 17:26:33.3359|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.DownloadPackageFile|Downloading and parsing: https://us.download.nvidia.com/nvapp/client/10.0.0.499/NVIDIA_app_beta_v10.0.0.499.exe...
2024-02-23 17:26:45.9422|INFO|Microsoft.WingetCreateCLI.Commands.NewCommand+<Execute>d__15.MoveNext|For information about the restrictions for each field, visit https://aka.ms/winget-manifest-schema
2024-02-23 17:26:45.9434|DEBUG|Microsoft.WingetCreateCLI.Commands.NewCommand+<Execute>d__15.MoveNext|Please enter values for the following fields:
2024-02-23 17:27:00.1968|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [PackageVersion] set to the value [1.0.14.0]
2024-02-23 17:27:05.6928|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [DefaultLocale] set to the value [en-US]
2024-02-23 17:27:07.9730|DEBUG|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptInstallerProperties|Additional metadata needed for installer from https://us.download.nvidia.com/nvapp/client/10.0.0.499/NVIDIA_app_beta_v10.0.0.499.exe
2024-02-23 17:41:48.5954|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [Publisher] set to the value [NVIDIA Corporation]
2024-02-23 17:41:49.2968|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [PackageName] set to the value [NVIDIA app]
2024-02-23 17:41:55.7283|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [License] set to the value [Proprietary]
2024-02-23 17:42:00.5710|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [ShortDescription] set to the value [NVIDIA app]
2024-02-23 17:42:04.2180|DEBUG|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Generating a preview of your manifests...
2024-02-23 17:42:04.2180|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Version manifest preview:
2024-02-23 17:42:04.2848|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Installer manifest preview:
2024-02-23 17:42:04.2956|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Default locale manifest preview:
2024-02-23 17:42:04.3483|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.ValidateManifest|Manifest validation succeeded: True
2024-02-23 17:42:23.0236|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [PackageVersion] set to the value [1.0.14.0]
2024-02-23 17:42:23.9335|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [DefaultLocale] set to the value [en-US]
2024-02-23 17:42:30.0717|DEBUG|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptInstallerProperties|Additional metadata needed for installer from https://us.download.nvidia.com/nvapp/client/10.0.0.499/NVIDIA_app_beta_v10.0.0.499.exe
2024-02-23 17:42:35.6865|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [Publisher] set to the value [NVIDIA Corporation]
2024-02-23 17:42:36.2595|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [PackageName] set to the value [NVIDIA app]
2024-02-23 17:42:36.9722|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [License] set to the value [Proprietary]
2024-02-23 17:42:37.4217|TRACE|Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties|Property [ShortDescription] set to the value [NVIDIA app]
2024-02-23 17:42:39.5921|DEBUG|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Generating a preview of your manifests...
2024-02-23 17:42:39.5921|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Version manifest preview:
2024-02-23 17:42:39.6013|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Installer manifest preview:
2024-02-23 17:42:39.6142|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.DisplayManifestPreview|Default locale manifest preview:
2024-02-23 17:42:39.6467|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.ValidateManifest|Manifest validation succeeded: True
2024-02-23 17:42:42.3094|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.SaveManifestDirToLocalPath|Manifest saved to %USERPROFILE%\manifests\n\Nvidia\NvidiaApp\Beta\1.0.14.0
2024-02-23 17:42:45.0147|TRACE|Microsoft.WingetCreateCLI.Commands.BaseCommand.CheckGitHubTokenAndSetClient|Checking repo access using provided token
2024-02-23 17:42:45.4197|TRACE|Microsoft.WingetCreateCLI.Commands.BaseCommand.CheckGitHubTokenAndSetClient|Access check was successful, proceeding
2024-02-23 17:42:45.4197|INFO|Microsoft.WingetCreateCLI.Commands.BaseCommand.GitHubSubmitManifests|Submitting pull request for manifest...
2024-02-23 17:42:53.8397|ERROR|Microsoft.WingetCreateCLI.Commands.BaseCommand.GitHubSubmitManifests|Unable to create a reference to the forked repository. This can be caused when the forked repository is behind by too many commits. Sync your fork and try again.

rakleed avatar Feb 23 '24 15:02 rakleed

I could only repro the error when I use a GitHub token that doesn't have the public_repo scope set. Did anyone repro with a token with the correct scope?

Image

mdanish-kh avatar Jan 04 '25 20:01 mdanish-kh

@mdanish-kh I don't create GitHub Token manually. The first time, after creating a manifest and agreement to create a PR, it is suggested to authorize WingetCreate as an OAuth application on https://github.com/login/device with access to "Full control of private repositories".

Image

rakleed avatar Jan 06 '25 22:01 rakleed

@rakleed WingetCreate v1.9.4.0 contains changes that should address this issue. Can you try with version v1.9.4.0 and check if you're still able to repro?

mdanish-kh avatar Jan 15 '25 02:01 mdanish-kh

Just chiming in here as I was having the same problem with wingetcreate 1.9.4.0.

2025-03-16T18:45:55.5947495Z Current runner version: '2.322.0'
2025-03-16T18:45:55.5977813Z ##[group]Operating System
2025-03-16T18:45:55.5978628Z Microsoft Windows Server 2022
2025-03-16T18:45:55.5979207Z 10.0.20348
2025-03-16T18:45:55.5979681Z Datacenter
2025-03-16T18:45:55.5980147Z ##[endgroup]
2025-03-16T18:45:55.5980637Z ##[group]Runner Image
2025-03-16T18:45:55.5981169Z Image: windows-2022
2025-03-16T18:45:55.5981647Z Version: 20250309.1.0
2025-03-16T18:45:55.5982717Z Included Software: https://github.com/actions/runner-images/blob/win22/20250309.1/images/windows/Windows2022-Readme.md
2025-03-16T18:45:55.5984147Z Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20250309.1
2025-03-16T18:45:55.5985013Z ##[endgroup]
2025-03-16T18:45:55.5985558Z ##[group]Runner Image Provisioner
2025-03-16T18:45:55.5986116Z 2.0.422.1
2025-03-16T18:45:55.5986519Z ##[endgroup]
2025-03-16T18:45:55.5989034Z ##[group]GITHUB_TOKEN Permissions
2025-03-16T18:45:55.5991323Z Actions: write
2025-03-16T18:45:55.5991966Z Attestations: write
2025-03-16T18:45:55.5992455Z Checks: write
2025-03-16T18:45:55.5992955Z Contents: write
2025-03-16T18:45:55.5993409Z Deployments: write
2025-03-16T18:45:55.5993917Z Discussions: write
2025-03-16T18:45:55.5994420Z Issues: write
2025-03-16T18:45:55.5994861Z Metadata: read
2025-03-16T18:45:55.5995329Z Packages: write
2025-03-16T18:45:55.5995783Z Pages: write
2025-03-16T18:45:55.5996247Z PullRequests: write
2025-03-16T18:45:55.5996747Z RepositoryProjects: write
2025-03-16T18:45:55.5997266Z SecurityEvents: write
2025-03-16T18:45:55.5997782Z Statuses: write
2025-03-16T18:45:55.5998268Z ##[endgroup]
2025-03-16T18:45:55.6000666Z Secret source: Actions
2025-03-16T18:45:55.6001490Z Prepare workflow directory
2025-03-16T18:45:55.6569368Z Prepare all required actions
2025-03-16T18:45:55.6624608Z Complete job name: Publish release to WinGet
2025-03-16T18:45:55.7908794Z ##[group]Run iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
2025-03-16T18:45:55.7910091Z [36;1miwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe[0m
2025-03-16T18:45:55.7950289Z shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
2025-03-16T18:45:55.7951301Z env:
2025-03-16T18:45:55.7952085Z   WINGET_TOKEN: ***
2025-03-16T18:45:55.7952532Z ##[endgroup]
2025-03-16T18:45:59.0125529Z ##[group]Run $releases = Invoke-RestMethod -uri "https://api.github.com/repos/srwi/EverythingToolbar/releases"
2025-03-16T18:45:59.0126620Z [36;1m$releases = Invoke-RestMethod -uri "https://api.github.com/repos/srwi/EverythingToolbar/releases"[0m
2025-03-16T18:45:59.0127342Z [36;1m$stableRelease = $releases | Where-Object { $_.prerelease -eq $false } | Select -First 1[0m
2025-03-16T18:45:59.0128278Z [36;1m$installerUrl = $stableRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match "EverythingToolbar.*msi" | Select -ExpandProperty browser_download_url[0m
2025-03-16T18:45:59.0129435Z [36;1m.\wingetcreate.exe update stnkl.EverythingToolbar -s -v $stableRelease.tag_name -d $stableRelease.tag_name -u $installerUrl -t $env:WINGET_TOKEN[0m
2025-03-16T18:45:59.0164945Z shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
2025-03-16T18:45:59.0165391Z env:
2025-03-16T18:45:59.0165990Z   WINGET_TOKEN: ***
2025-03-16T18:45:59.0166390Z ##[endgroup]
2025-03-16T18:46:07.9757953Z Telemetry Settings
2025-03-16T18:46:07.9758721Z ------------------
2025-03-16T18:46:07.9759590Z The Windows Package Manager Manifest Creator collects usage data in order to improve your experience.
2025-03-16T18:46:07.9760560Z The data is anonymous and collected only by Microsoft.
2025-03-16T18:46:07.9761668Z By default, telemetry is enabled but can be disabled by running `wingetcreate settings` and editing your settings file.
2025-03-16T18:46:07.9762452Z 
2025-03-16T18:46:16.1934948Z Retrieving latest manifest for stnkl.EverythingToolbar
2025-03-16T18:46:18.4371128Z Downloading and parsing: https://github.com/srwi/EverythingToolbar/releases/download/1.5.2/EverythingToolbar-1.5.2.msi...
2025-03-16T18:46:19.9718253Z GitHub URL detected. The CLI has automatically filled some manifest fields.
2025-03-16T18:46:19.9784165Z Generating a preview of your manifests...
2025-03-16T18:46:19.9786638Z Version manifest preview:
2025-03-16T18:46:20.0144269Z # Created using wingetcreate 1.9.4.0
2025-03-16T18:46:20.0145131Z # yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.9.0.schema.json
2025-03-16T18:46:20.0145787Z 
2025-03-16T18:46:20.0145977Z PackageIdentifier: stnkl.EverythingToolbar
2025-03-16T18:46:20.0146421Z PackageVersion: 1.5.2
2025-03-16T18:46:20.0146789Z DefaultLocale: en-US
2025-03-16T18:46:20.0147133Z ManifestType: version
2025-03-16T18:46:20.0147527Z ManifestVersion: 1.9.0
2025-03-16T18:46:20.0147729Z 
2025-03-16T18:46:20.0147869Z Installer manifest preview:
2025-03-16T18:46:20.0349927Z # Created using wingetcreate 1.9.4.0
2025-03-16T18:46:20.0350837Z # yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.9.0.schema.json
2025-03-16T18:46:20.0351418Z 
2025-03-16T18:46:20.0351561Z PackageIdentifier: stnkl.EverythingToolbar
2025-03-16T18:46:20.0351940Z PackageVersion: 1.5.2
2025-03-16T18:46:20.0352188Z InstallerLocale: en-US
2025-03-16T18:46:20.0352493Z Platform:
2025-03-16T18:46:20.0352813Z - Windows.Desktop
2025-03-16T18:46:20.0353189Z InstallerType: wix
2025-03-16T18:46:20.0353425Z Scope: machine
2025-03-16T18:46:20.0353693Z InstallModes:
2025-03-16T18:46:20.0353960Z - interactive
2025-03-16T18:46:20.0354165Z - silent
2025-03-16T18:46:20.0354384Z - silentWithProgress
2025-03-16T18:46:20.0354684Z UpgradeBehavior: install
2025-03-16T18:46:20.0354975Z Dependencies:
2025-03-16T18:46:20.0355209Z   PackageDependencies:
2025-03-16T18:46:20.0355510Z   - PackageIdentifier: voidtools.Everything
2025-03-16T18:46:20.0355937Z ProductCode: '{0B0076BB-DE90-4A46-99EA-B11FF507EE87}'
2025-03-16T18:46:20.0356327Z AppsAndFeaturesEntries:
2025-03-16T18:46:20.0356664Z - UpgradeCode: '{744F23C4-7ADB-42FA-A781-AC940DC4B454}'
2025-03-16T18:46:20.0357037Z Installers:
2025-03-16T18:46:20.0357244Z - Architecture: x64
2025-03-16T18:46:20.0357872Z   InstallerUrl: https://github.com/srwi/EverythingToolbar/releases/download/1.5.2/EverythingToolbar-1.5.2.msi
2025-03-16T18:46:20.0361093Z   InstallerSha256: F464F5234324BF4D3EDE40016571C201BAF152A412C0CBC296D23F478AF41962
2025-03-16T18:46:20.0361754Z ManifestType: installer
2025-03-16T18:46:20.0362032Z ManifestVersion: 1.9.0
2025-03-16T18:46:20.0362290Z ReleaseDate: 2025-03-16
2025-03-16T18:46:20.0362449Z 
2025-03-16T18:46:20.0362593Z Default locale manifest preview:
2025-03-16T18:46:20.0506915Z # Created using wingetcreate 1.9.4.0
2025-03-16T18:46:20.0507809Z # yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.9.0.schema.json
2025-03-16T18:46:20.0508481Z 
2025-03-16T18:46:20.0508692Z PackageIdentifier: stnkl.EverythingToolbar
2025-03-16T18:46:20.0509094Z PackageVersion: 1.5.2
2025-03-16T18:46:20.0509426Z PackageLocale: en-US
2025-03-16T18:46:20.0509766Z Publisher: Stephan Rumswinkel
2025-03-16T18:46:20.0510333Z PublisherUrl: https://github.com/srwi/EverythingToolbar
2025-03-16T18:46:20.0511210Z PublisherSupportUrl: https://github.com/srwi/EverythingToolbar/issues
2025-03-16T18:46:20.0511876Z Author: Stephan Rumswinkel
2025-03-16T18:46:20.0512268Z PackageName: EverythingToolbar
2025-03-16T18:46:20.0512624Z PackageUrl: https://github.com/srwi/EverythingToolbar
2025-03-16T18:46:20.0512971Z License: MIT License
2025-03-16T18:46:20.0513407Z LicenseUrl: https://raw.githubusercontent.com/srwi/EverythingToolbar/master/LICENSE
2025-03-16T18:46:20.0513945Z Copyright: Copyright (c) 2024 Stephan Rumswinkel
2025-03-16T18:46:20.0514495Z CopyrightUrl: https://raw.githubusercontent.com/srwi/EverythingToolbar/master/LICENSE
2025-03-16T18:46:20.0515247Z ShortDescription: Everything integration for the Windows taskbar.
2025-03-16T18:46:20.0515659Z Description: |-
2025-03-16T18:46:20.0516250Z   With EverythingToolbar you can instantly search files and folders by name directly in the Windows taskbar with Everything.
2025-03-16T18:46:20.0517794Z   It allows quick and easy file indexing and fast searches.
2025-03-16T18:46:20.0518166Z Moniker: everythingtoolbar
2025-03-16T18:46:20.0518403Z Tags:
2025-03-16T18:46:20.0518578Z - everything
2025-03-16T18:46:20.0518796Z - everything-search
2025-03-16T18:46:20.0519005Z - taskbar
2025-03-16T18:46:20.0519194Z - taskbar-application
2025-03-16T18:46:20.0519431Z - taskbar-launcher
2025-03-16T18:46:20.0519630Z - toolbar
2025-03-16T18:46:20.0519822Z - windows-taskbar
2025-03-16T18:46:20.0520234Z ReleaseNotesUrl: https://github.com/srwi/EverythingToolbar/releases/tag/1.5.2
2025-03-16T18:46:20.0520699Z Documentations:
2025-03-16T18:46:20.0520914Z - DocumentLabel: Wiki
2025-03-16T18:46:20.0521244Z   DocumentUrl: https://github.com/srwi/EverythingToolbar/wiki
2025-03-16T18:46:20.0521646Z ManifestType: defaultLocale
2025-03-16T18:46:20.0521904Z ManifestVersion: 1.9.0
2025-03-16T18:46:20.0522053Z 
2025-03-16T18:46:20.0936024Z 
2025-03-16T18:46:20.0950461Z Manifest saved to D:\a\EverythingToolbar\EverythingToolbar\manifests\s\stnkl\EverythingToolbar\1.5.2
2025-03-16T18:46:20.0950911Z 
2025-03-16T18:46:20.1186998Z Manifest validation succeeded: True
2025-03-16T18:46:20.1187383Z 
2025-03-16T18:46:20.5585848Z Submitting pull request for manifest...
2025-03-16T18:46:20.5586282Z 
2025-03-16T18:46:22.8299753Z System.Net.Http.HttpRequestException: Response status code does not indicate success: 422 (Unprocessable Entity).
2025-03-16T18:46:22.8300966Z    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
2025-03-16T18:46:22.8302123Z    at Microsoft.WingetCreateCore.Common.GitHub.UpdateForkedRepoWithUpstreamCommits(Repository forkedRepo)
2025-03-16T18:46:22.8303559Z    at Microsoft.WingetCreateCore.Common.GitHub.<>c__DisplayClass20_0.<<SubmitPRAsync>b__1>d.MoveNext()
2025-03-16T18:46:22.8304425Z --- End of stack trace from previous location ---
2025-03-16T18:46:22.8305086Z    at Polly.AsyncPolicy.<>c__DisplayClass40_0.<<ImplementationAsync>b__0>d.MoveNext()
2025-03-16T18:46:22.8305782Z --- End of stack trace from previous location ---
2025-03-16T18:46:22.8309583Z    at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext)
2025-03-16T18:46:22.8314479Z    at Polly.AsyncPolicy.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
2025-03-16T18:46:22.8317210Z    at Microsoft.WingetCreateCore.Common.GitHub.SubmitPRAsync(String packageId, String version, Dictionary`2 contents, Boolean submitToFork, String prTitle, Boolean shouldReplace, String replaceVersion)
2025-03-16T18:46:22.8320203Z    at Microsoft.WingetCreateCore.Common.GitHub.SubmitPRAsync(String packageId, String version, Dictionary`2 contents, Boolean submitToFork, String prTitle, Boolean shouldReplace, String replaceVersion)
2025-03-16T18:46:22.8321907Z    at Microsoft.WingetCreateCLI.Commands.BaseCommand.GitHubSubmitManifests(Manifests manifests, String prTitle, Boolean shouldReplace, String replaceVersion)
2025-03-16T18:46:22.8323356Z    at Microsoft.WingetCreateCLI.Commands.UpdateCommand.ExecuteManifestUpdate(List`1 latestManifestContent, CommandExecutedEvent commandEvent)
2025-03-16T18:46:22.8324116Z    at Microsoft.WingetCreateCLI.Commands.UpdateCommand.Execute()
2025-03-16T18:46:22.8324507Z    at Microsoft.WingetCreateCLI.Program.Main(String[] args)
2025-03-16T18:46:22.9923915Z ##[error]Process completed with exit code 1.
2025-03-16T18:46:23.0068981Z Cleaning up orphan processes

At the time of failure my fork was roughly 55k commits behind. After manually syncing the fork it worked without a problem.

srwi avatar Mar 19 '25 19:03 srwi

I've had the exact same issue, just to add another log: https://github.com/SteamRE/DepotDownloader/actions/runs/14030845520/job/39277931911

I logged into the bot account and pressed sync fork in the github ui.

xPaw avatar Mar 24 '25 08:03 xPaw

Can winget-create do the same thing as "sync fork" github ui button? This button succeeds when winget-create fails with 422 (Unprocessable Entity)

slonopotamus avatar Apr 25 '25 07:04 slonopotamus

@slonopotamus WinGet-Create does try to do the same thing by attempting to sync the fork with upstream commits via an API call

https://github.com/microsoft/winget-create/blob/1e78f07d72249c28cff23dfcb2f5ba0db565f3d5/src/WingetCreateCore/Common/GitHub.cs#L475-L523

Unfortunately, the API call (even when we retry) fails sometimes if the fork is behind way too many commits, causing a failure in PR creation and winget-create having to return a 422 error back to the user

mdanish-kh avatar Apr 25 '25 09:04 mdanish-kh

If the error can be clearly associated with this and there is no proper way to handle it, a more descriptive error message might be a good start.

srwi avatar Apr 25 '25 10:04 srwi

@srwi - yep, that's gonna be part of the next release

  • #591

mdanish-kh avatar Apr 25 '25 10:04 mdanish-kh

@srwi - yep, that's gonna be part of the next release

Oh, that's great to hear. Thanks for that!

srwi avatar Apr 25 '25 10:04 srwi

API call (even when we retry) fails sometimes if the fork is behind way too many commits

I don't quite understand the difference between API call (that fails) and UI button (that doesn't) on the same repo and the same number of commits. Maybe someone should raise a ticket with GitHub support...

slonopotamus avatar Apr 25 '25 10:04 slonopotamus

The experience should be improved once 1.10 release of winget-create goes out. We will perform re-tries to the GitHub API to sync fork in case of failure, and if it still fails you'll get a message to manually sync your winget-pkgs instead of a generic exception or 422 HTTP error code

Related PRs:

  • #597
  • #591

mdanish-kh avatar Jul 09 '25 16:07 mdanish-kh