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

Bug - Fork Sync Issue #502

Open
PckgrBot opened this issue Jan 9, 2024 · 8 comments
Open

Bug - Fork Sync Issue #502

PckgrBot opened this issue Jan 9, 2024 · 8 comments

Comments

@PckgrBot
Copy link

PckgrBot commented Jan 9, 2024

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
@JanDeDobbeleer
Copy link
Contributor

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

@mdanish-kh
Copy link
Contributor

This looks related to:

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
Copy link
Contributor

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

@JanDeDobbeleer
Copy link
Contributor

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

@matifali
Copy link

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

Ideally it should not happen.

@mdanish-kh
Copy link
Contributor

@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)

@vedantmgoyal9
Copy link
Contributor

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

@rakleed
Copy link

rakleed commented Feb 23, 2024

@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.

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

7 participants