microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.56k stars 4.45k forks source link

[Package Issue]: yt-dlp.yt-dlp does not complete the update to version 2024.07.01 #161349

Open yolamoon opened 3 months ago

yolamoon commented 3 months ago

Please confirm these before moving forward

Category of the issue

Other

Brief description of your issue

When the yt-dlp.yt-dlp package is updated, it attempts to extract a version of Gyan.FFmpeg already present on the computer, installed via WinGet, and fails to complete the update, entering an extraction loop.

Steps to reproduce

  1. Attempt to update the yt-dlp.yt-dlp package using WinGet.
  2. Observe that the update process enters an extraction loop and does not complete.

Actual behavior

  1. The updater tries to extract a version of Gyan.FFmpeg already installed on the computer.
  2. The process tries to extract an already existing version on the PC and does not complete the update.

Expected behavior

The update process for the yt-dlp.yt-dlp package should complete successfully without entering an extraction loop. It should correctly detect if Gyan.FFmpeg is already installed and proceed with the update without attempting to extract the existing version again.

Environment

Gerenciador de Pacotes do Windows v1.8.1791
Copyright (c) Microsoft Corporation. Todos os direitos reservados.

Windows: Windows.Desktop v10.0.22631.3810
Arquitetura do Sistema: X64
Pacote: Microsoft.DesktopAppInstaller v1.23.1791.0

Diretórios Winget
--------------------------------------------------------------------------------------------------------------------------------------
Registros                                 %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Configurações do Usuário                  %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Diretório de Links Portáteis (Usuário)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Diretório de Links Portáteis (Computador) C:\Program Files\WinGet\Links
Raiz do Pacote Portátil (Usuário)         %LOCALAPPDATA%\Microsoft\WinGet\Packages
Raiz do Pacote Portátil                   C:\Program Files\WinGet\Packages
Raiz do Pacote Portátil (x86)             C:\Program Files (x86)\WinGet\Packages
Downloads do Instalador                   %USERPROFILE%\Downloads

Links
-------------------------------------------------------------------------------
Política de Privacidade https://aka.ms/winget-privacy
Contrato de Licença     https://aka.ms/winget-license
Avisos de Terceiros     https://aka.ms/winget-3rdPartyNotice
Home page               https://aka.ms/winget
Termos da Windows Store https://www.microsoft.com/en-us/storedocs/terms-of-sale

Configuração do Administrador             Estado
------------------------------------------------------
LocalManifestFiles                        Desabilitado
BypassCertificatePinningForMicrosoftStore Desabilitado
InstallerHashOverride                     Desabilitado
LocalArchiveMalwareScanOverride           Desabilitado
ProxyCommandLineOptions                   Desabilitado
DefaultProxy                              Desabilitado

Screenshots and Logs

image WinGet-2024-07-03-11-06-21.945.log

Dragon1573 commented 3 months ago

How did you previously installed Gyan.FFmpeg? Did you install it manually without using winget.exe? It seems winget.exe can't detect those portable packages if they're not installed via itself directly.

aisgbnok commented 3 months ago

I have noticed this too when upgrading using winget. Only recently. I suspect it is something in winget-cli. I don't believe it's package related. From a brief look at my logs it seems to just stop when extracting the ffmpeg dependency.

2024-07-02 11:29:23.490 [CLI ] Manifest fields: Name [yt-dlp], Version [2024.07.01]
2024-07-02 11:29:23.501 [REPO] Creating new SQLite Index with version [Latest] at ':memory:'
2024-07-02 11:29:23.507 [REPO] Reading MSI UpgradeCodes
2024-07-02 11:29:23.548 [REPO] Reading MSI UpgradeCodes
2024-07-02 11:29:24.128 [REPO] Opening database for ReadWrite at 'C:\Users\Anthony\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2024-07-02 11:29:24.129 [REPO] Opened SQLite Index with version [1.7], last write [2024-07-02 11:25:03.000]
2024-07-02 11:29:24.166 [REPO] Found multiple results for Id [Gyan.FFmpeg] in tracking catalog for: winget
2024-07-02 11:29:24.173 [REPO] Attempting to open pinning database: C:\Users\Anthony\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db
2024-07-02 11:29:24.189 [CLI ] Manifest fields: Name [FFmpeg], Version [7.0.1]
2024-07-02 11:29:24.201 [CLI ] Found existing installer file at 'C:\Users\Anthony\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\ffmpeg-7.0.1-full_build.zip'. Verifying file hash.
2024-07-02 11:29:24.457 [CLI ] Existing installer file hash matches. Will use existing installer.
2024-07-02 11:29:24.457 [CLI ] Installer hash verified
2024-07-02 11:29:24.458 [CORE] Started applying motw to C:\Users\Anthony\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\ffmpeg-7.0.1-full_build.zip with zone: 2
2024-07-02 11:29:24.460 [CORE] Finished applying motw
2024-07-02 11:29:24.575 [CLI ] Extracting archive to: C:\Users\Anthony\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\extracted
2024-07-02 11:29:33.263 [CLI ] Successfully extracted archive
Windows Package Manager (Preview) v1.9.1792-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22635.3858
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.24.1792.0
aisgbnok commented 3 months ago

For now, uninstalling and reinstalling works.

winget uninstall yt-dlp.yt-dlp
winget install yt-dlp.yt-dlp

FYI, 2024.07.02 should be published later today so you'll have to do this again when that update hits.

Dragon1573 commented 3 months ago

Seems reproduced in Windows Sandbox instance ...

Console logs in Windows Sandbox ```text --> Installing WinGet --> Disabling safety warning when running installer Tip: you can type 'Update-EnvironmentVariables' to update your environment variables, such as after installing a new software. PS C:\Users\WDAGUtilityAccount\Desktop\winget-pkgs> winget install -e --id Gyan.FFmpeg The `msstore` source requires that you view the following agreements before using. Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction The source requires the current machine's 2-letter geographic region to be sent to the backend service to function properly (ex. "US"). Do you agree to all the source agreements terms? [Y] Yes [N] No: Y Found FFmpeg [Gyan.FFmpeg] Version 7.0.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://github.com/GyanD/codexffmpeg/releases/download/7.0.1/ffmpeg-7.0.1-full_build.zip ██████████████████████████████ 162 MB / 162 MB Successfully verified installer hash Extracting archive... Successfully extracted archive Starting package install... Command line alias added: "ffmpeg" Command line alias added: "ffplay" Command line alias added: "ffprobe" Path environment variable modified; restart your shell to use the new value. Successfully installed PS C:\Users\WDAGUtilityAccount\Desktop\winget-pkgs> winget install -e --id yt-dlp.yt-dlp --version 2024.05.27 Found yt-dlp [yt-dlp.yt-dlp] Version 2024.05.27 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. This package requires the following dependencies: - Packages Gyan.FFmpeg (1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Successfully verified installer hash Extracting archive... Successfully extracted archive Starting package install... Command line alias added: "ffmpeg" Command line alias added: "ffplay" Command line alias added: "ffprobe" Successfully installed Downloading https://github.com/yt-dlp/yt-dlp/releases/download/2024.05.27/yt-dlp.exe ██████████████████████████████ 17.7 MB / 17.7 MB Successfully verified installer hash Starting package install... Command line alias added: "yt-dlp" Successfully installed PS C:\Users\WDAGUtilityAccount\Desktop\winget-pkgs> winget upgrade -e --id yt-dlp.yt-dlp Found yt-dlp [yt-dlp.yt-dlp] Version 2024.07.01 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. This package requires the following dependencies: - Packages Gyan.FFmpeg (1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Successfully verified installer hash Extracting archive... Successfully extracted archive ```
yolamoon commented 3 months ago

How did you previously installed Gyan.FFmpeg? Did you install it manually without using winget.exe? It seems winget.exe can't detect those portable packages if they're not installed via itself directly.

It was installed using winget.exe.

Dragon1573 commented 3 months ago

Reproduced ...

Seems it's related to the implementation of winget.exe. Maybe this issue should be investigated by moderators ...

PS C:\Users\WDAGUtilityAccount\Desktop\winget-pkgs> winget install -e --id Gyan.FFmpeg
Found FFmpeg [Gyan.FFmpeg] Version 7.0.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "ffmpeg"
Command line alias added: "ffplay"
Command line alias added: "ffprobe"
Successfully installed
PS C:\Users\WDAGUtilityAccount\Desktop\winget-pkgs> winget install -e --id Gyan.FFmpeg
Found FFmpeg [Gyan.FFmpeg] Version 7.0.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "ffmpeg"
Command line alias added: "ffplay"
Command line alias added: "ffprobe"
Successfully installed
DL444 commented 2 months ago

image

The reason is that winget-cli crashed during installation.

image

Debugging reveals that it can't get the installed package version for Gyan.FFmpeg from local installed source stored in SQLite and dereferences the resulting null pointer. Not sure exactly why though, as I'm not familiar with its implementation. But I suspect problems with CompositeSource::SearchInstalled(const SearchRequest&) at CompositeSource.cpp:1455.

DL444 commented 2 months ago

It seems weird but I cannot reproduce the issue anymore. I used the same client code, and package manifests for both yt-dlp.yt-dlp and Gyan.FFmpeg seem unchanged to me.

9034725985 commented 2 months ago

I could not update yt-dlp using winget. Uninstalling winget and installing it again worked for me.

cmd because I also needed to update powershell ```cmd Microsoft Windows [Version 10.0.22631.3880] (c) Microsoft Corporation. All rights reserved. C:\Windows\System32>yt-dlp --version 2024.07.07 C:\Windows\System32>winget upgrade Name Id Version Available Source ------------------------------------------------------------------------------------------- PowerShell 7.4.2.0-x64 Microsoft.PowerShell 7.4.2.0 7.4.3.0 winget yt-dlp yt-dlp.yt-dlp 2024.07.07 2024.07.09 winget Microsoft Visual Studio Code (User) Microsoft.VisualStudioCode 1.91.0 1.91.1 winget 3 upgrades available. C:\Windows\System32>winget upgrade --all --include-unknown Name Id Version Available Source ------------------------------------------------------------------------------------------- PowerShell 7.4.2.0-x64 Microsoft.PowerShell 7.4.2.0 7.4.3.0 winget yt-dlp yt-dlp.yt-dlp 2024.07.07 2024.07.09 winget Microsoft Visual Studio Code (User) Microsoft.VisualStudioCode 1.91.0 1.91.1 winget 3 upgrades available. Installing dependencies: This package requires the following dependencies: - Packages Gyan.FFmpeg (1/2) Found yt-dlp [yt-dlp.yt-dlp] Version 2024.07.09 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. (1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Successfully verified installer hash Extracting archive... Successfully extracted archive C:\Windows\System32> C:\Windows\System32>winget upgrade Name Id Version Available Source ------------------------------------------------------------------------------------------- PowerShell 7.4.2.0-x64 Microsoft.PowerShell 7.4.2.0 7.4.3.0 winget yt-dlp yt-dlp.yt-dlp 2024.07.07 2024.07.09 winget Microsoft Visual Studio Code (User) Microsoft.VisualStudioCode 1.91.0 1.91.1 winget 3 upgrades available. C:\Windows\System32>winget uninstall yt-dlp.yt-dlp Found yt-dlp [yt-dlp.yt-dlp] Starting package uninstall... Successfully uninstalled C:\Windows\System32>winget install yt-dlp.yt-dlp Found yt-dlp [yt-dlp.yt-dlp] Version 2024.07.09 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. This package requires the following dependencies: - Packages Gyan.FFmpeg (1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Successfully verified installer hash Extracting archive... Successfully extracted archive Starting package install... Command line alias added: "ffmpeg" Command line alias added: "ffplay" Command line alias added: "ffprobe" Successfully installed Downloading https://github.com/yt-dlp/yt-dlp/releases/download/2024.07.09/yt-dlp.exe ██████████████████████████████ 17.8 MB / 17.8 MB Successfully verified installer hash Starting package install... Command line alias added: "yt-dlp" Path environment variable modified; restart your shell to use the new value. Successfully installed C:\Windows\System32>winget upgrade Name Id Version Available Source --------------------------------------------------------------------------------------- PowerShell 7.4.2.0-x64 Microsoft.PowerShell 7.4.2.0 7.4.3.0 winget Microsoft Visual Studio Code (User) Microsoft.VisualStudioCode 1.91.0 1.91.1 winget 2 upgrades available. C:\Windows\System32>winget upgrade --all --include-unknown Name Id Version Available Source --------------------------------------------------------------------------------------- PowerShell 7.4.2.0-x64 Microsoft.PowerShell 7.4.2.0 7.4.3.0 winget Microsoft Visual Studio Code (User) Microsoft.VisualStudioCode 1.91.0 1.91.1 winget 2 upgrades available. (1/1) Found Microsoft Visual Studio Code [Microsoft.VisualStudioCode] Version 1.91.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://vscode.download.prss.microsoft.com/dbazure/download/stable/f1e16e1e6214d7c44d078b1f0607b2388f29d729/VSCodeUserSetup-x64-1.91.1.exe ██████████████████████████████ 94.9 MB / 94.9 MB Successfully verified installer hash Starting package install... Successfully installed C:\Windows\System32>yt-dlp --version 2024.07.09 C:\Windows\System32>winget upgrade Name Id Version Available Source -------------------------------------------------------------------- PowerShell 7.4.2.0-x64 Microsoft.PowerShell 7.4.2.0 7.4.3.0 winget 1 upgrades available. C:\Windows\System32>winget upgrade --all --include-unknown Name Id Version Available Source -------------------------------------------------------------------- PowerShell 7.4.2.0-x64 Microsoft.PowerShell 7.4.2.0 7.4.3.0 winget 1 upgrades available. C:\Windows\System32>winget upgrade --id Microsoft.Winget.Source No installed package found matching input criteria. C:\Windows\System32>winget install Microsoft.PowerShell --version 7.4.3.0 Found PowerShell [Microsoft.PowerShell] Version 7.4.3.0 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.4.3/PowerShell-7.4.3-win-x64.msi ██████████████████████████████ 103 MB / 103 MB Successfully verified installer hash Starting package install... Successfully installed C:\Windows\System32>winget source update Updating all sources... Updating source: msstore... Done Updating source: winget... Done C:\Windows\System32>winget upgrade --id Microsoft.Winget.Source No installed package found matching input criteria. C:\Windows\System32>
MagicAndre1981 commented 2 months ago

for me winget also crashes while trying to update Gyan.FFmpeg during upgrade of yt-dlp

HunterZ commented 2 months ago

This is also happening to me. My log ends suddenly after extraction of FFmpeg to a temporary directory. Almost seems like it's forgetting that yt-dlp was the package to be updated and then goes down a broken path with FFmpeg instead (which isn't even in the update list):

2024-07-26 09:49:44.235 [CLI ] Manifest fields: Name [FFmpeg], Version [7.0.1]
2024-07-26 09:49:44.283 [CLI ] Found existing installer file at 'C:\Users\bensh\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\ffmpeg-7.0.1-full_build.zip'. Verifying file hash.
2024-07-26 09:49:44.416 [CLI ] Existing installer file hash matches. Will use existing installer.
2024-07-26 09:49:44.416 [CLI ] Installer hash verified
2024-07-26 09:49:44.417 [CORE] Started applying motw to C:\Users\bensh\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\ffmpeg-7.0.1-full_build.zip with zone: 2
2024-07-26 09:49:44.419 [CORE] Finished applying motw
2024-07-26 09:49:44.530 [CLI ] Extracting archive to: C:\Users\bensh\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\extracted
2024-07-26 09:49:51.126 [CLI ] Successfully extracted archive

Edit: Also, winget install Gyan.FFmpeg gets further, but winget seems to then immediately forget that it was installed.

Possibly caused by #120360?

seangibbz commented 1 month ago

For now, uninstalling and reinstalling works.

winget uninstall yt-dlp.yt-dlp
winget install yt-dlp.yt-dlp

FYI, 2024.07.02 should be published later today so you'll have to do this again when that update hits.

* [New version: yt-dlp.yt-dlp version 2024.07.02 #161200](https://github.com/microsoft/winget-pkgs/pull/161200)

This has been my go-to method for the past several yt-dlp updates

Silun commented 1 month ago

Since apparently others don't have the issue any more, I'll let you know that the problem is alive and well! Fingers crossed for a fix. I need to uninstall and then reinstall, or just forgo winget and do yt-dlp -U.

Edit: I will give some more info. Starting with neither yt-dlp nor ffmpeg installed, I do winget install -e Gyan.FFmpeg --scope machine to install ffmpeg system-wide. Thus, yt-dlp need not worry about ffmpeg any more. However, when I then do winget install -e yt-dlp.yt-dlp --scope machine to install yt-dlp system-wide as well, it will first install another, second, copy of ffmpeg into local appdata. This has the effect that I cannot uninstall it any more, i.e. the command winget uninstall -e Gyan.FFmpeg --all-versions results in winget telling me there is no ffmpeg at all, and if I try to uninstall via windows control panel, neither version will uninstall. To fix this, I need to go to the registry and delete one of the two uninstallers, after which the other one will uninstall nicely when asked to.

Long story short: Please stop whatever you are doing with ffmpeg.

Scavy commented 1 month ago

The problem is still there.


Installing dependencies:
This package requires the following dependencies:
  - Packages
      Gyan.FFmpeg
(1/2) Found yt-dlp [yt-dlp.yt-dlp] Version 2024.08.06
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
(1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.2
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
HunterZ commented 1 month ago

The problem is still there.

Have you tried uninstall + reinstall per https://github.com/microsoft/winget-pkgs/issues/161349#issuecomment-2270453374 ?

That worked for me, at least for now.

seangibbz commented 1 month ago

This should be fixed with the additional flag

UpgradeBehavior: uninstallPrevious

in the installer manifest. https://github.com/microsoft/winget-pkgs/pull/167474

MagicAndre1981 commented 1 month ago

This should be fixed with the additional flag

UpgradeBehavior: uninstallPrevious

in the installer manifest. #167474

nope, I still see a winget crash and winget still shows yt-dlp.yt-dlp and Gyan.FFmpeg as available updates

lackovic commented 1 month ago

I am facing the same problem. It is worth noticing that after running winget upgrade -h --all, when it gets to updating yt-dlp and the update fails (weirdly with no error message), all the other following updates are skipped.

The workaround of uninstalling and reinstalling it worked.

elreymon commented 1 day ago

Hi there. October 1st and I confirme the bug persists. Is there anyone doing anything to solve it? How can we know it? The status of this issue says: No one assigned.