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

[Package Issue]: Spotify.Spotify installation fails with exit code 23 #83517

Closed
2 tasks done
lackovic opened this issue Oct 14, 2022 · 20 comments
Closed
2 tasks done

[Package Issue]: Spotify.Spotify installation fails with exit code 23 #83517

lackovic opened this issue Oct 14, 2022 · 20 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@lackovic
Copy link

lackovic commented Oct 14, 2022

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue

Installation issue.

Brief description of your issue

When I run winget install -e --id Spotify.Spotify the installation fails with exit code 23.

Steps to reproduce

Run winget install -e --id Spotify.Spotify in an elevated PowerShell terminal.

Actual behavior

The installation fails with exit code 23.

Expected behavior

The application gets installed.

Environment

Windows Package Manager v1.2.10691
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.674
Package: Microsoft.DesktopAppInstaller v1.17.10691.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Screenshots and Logs

> winget install -e --id Spotify.Spotify --force
Found Spotify [Spotify.Spotify] Version 1.1.95.893.g6cf4d40c
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
Starting package install...
Installer failed with exit code: 23
@lackovic lackovic added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Oct 14, 2022
@ghost ghost added the Needs-Triage This work item needs to be triaged by a member of the core team. label Oct 14, 2022
@OfficialEsco
Copy link
Contributor

Spotify does not install elevated.
Please update your WinGet Client so it respects the ElevationRequirement field.

@denelon denelon removed the Needs-Triage This work item needs to be triaged by a member of the core team. label Oct 14, 2022
@lackovic
Copy link
Author

Thanks! I ran the command in a non-admin shell and it worked!

Spotify does not install elevated.

Would it be possible to change the error message to reflect that?

@OfficialEsco
Copy link
Contributor

Spotify does not install elevated.

Would it be possible to change the error message to reflect that?

If you update WinGet to the latest release (1.3) you'll get a error message that reflects that.

@lackovic
Copy link
Author

If you update WinGet to the latest release (1.3)

Do you know a way how to do that? I looked in the project README and googled it but didn't find anything.

@OfficialEsco
Copy link
Contributor

Microsoft Store -> Update App Installer. https://www.microsoft.com/p/app-installer/9nblggh4nns1
To manually install or update a version of WinGet you can download the msixbundle from the GitHub Releases.
https://github.com/microsoft/winget-cli/releases/tag/v1.3.2691

It is the same as the Installation in the README.
https://github.com/microsoft/winget-cli#installing-the-client

@lackovic
Copy link
Author

lackovic commented Oct 16, 2022

Microsoft Store -> Update App Installer. https://www.microsoft.com/p/app-installer/9nblggh4nns1

Thanks! I had installed the App Installer with:

winget install "App Installer" -s msstore

which I found from this issue, but winget did not get updated until I opened the Store App on the App Installer page which in turn started to update itself automatically. I now have Windows Package Manager v1.3.2691 👍

@Trenly
Copy link
Contributor

Trenly commented Nov 5, 2022

Close with reason: Newer version of winget displays better error message, user issue resolved;

@ghost ghost closed this as completed Nov 5, 2022
@Trollwut
Copy link

Did this change in the recent version? I inly get the error code 23 and not an description that it fails beause elevation issues.

Of course, I can update as intended in an non-elevated shell.

Output:

 winget upgrade --include-unknown --all
Name    ID              Version              Verfügbar            Quelle
------------------------------------------------------------------------
Spotify Spotify.Spotify 1.2.0.1165.gabf054ab 1.2.3.1115.gd61a8f5c winget
1 Aktualisierungen verfügbar.

(1/1) Gefunden Spotify [Spotify.Spotify] Version 1.2.3.1115.gd61a8f5c
Diese Anwendung wird von ihrem Besitzer an Sie lizenziert.
Microsoft ist nicht verantwortlich und erteilt keine Lizenzen für Pakete von Drittanbietern.
Der Installer-Hash wurde erfolgreich überprüft
Paketinstallation wird gestartet...
Installieren fehlgeschlagen mit Exitcode: 23


Administrator  ~  ♥ 15:16  winget --version
v1.4.10173

@OfficialEsco
Copy link
Contributor

Weird, i cannot replicate your issue..

PS C:\Users\user> winget install Spotify.Spotify
The installer cannot be run from an administrator context.
PS C:\Users\user> winget --version
v1.4.2161-preview
PS C:\Users\user> winget --version
v1.4.10173
PS C:\Users\user> winget install Spotify.Spotify
The installer cannot be run from an administrator context.
PS C:\Users\user> winget update Spotify.Spotify
The installer cannot be run from an administrator context.
PS C:\Users\user> winget update
Name                            Id                                        Version              Available
-------------------------------------------------------------------------------------------------------------------
Spotify                         Spotify.Spotify                           1.2.2.1115.gd61a8f5c 1.2.3.1115.gd61a8f5c

@ImJoakim
Copy link
Contributor

ImJoakim commented Jan 29, 2023

Weird, i cannot replicate your issue..

I haven't tested it, but could it have something to do with winget upgrade --all? Perhaps the behavior is different compared to winget upgrade Spotify.Spotify

@Trollwut
Copy link

That could be it.

I already updated the software non-elevated, so I have to wait for the next upgrade to see if this would be it.

@ImJoakim
Copy link
Contributor

It seems that way. Running winget upgrade Spotify.Spotify in an elevated PowerShell window does not work - it respects the ElevationRequirement field.

PS C:\Users\WDAGUtilityAccount> winget upgrade
Name           Id              Version                                Available
------------------------------------------------------------------------------------------
Spotify        Spotify.Spotify 1.2.0.1165.gabf054ab                   1.2.3.1115.gd61a8f5c
1 upgrades available.
PS C:\Users\WDAGUtilityAccount> winget upgrade Spotify.Spotify
The installer cannot be run from an administrator context.

However, running winget upgrade --all in an elevated PowerShell window does work and does not respect the ElevationRequirement field it seems.

PS C:\Users\WDAGUtilityAccount> winget upgrade --all
Name           Id              Version                                Available
------------------------------------------------------------------------------------------
Spotify        Spotify.Spotify 1.2.0.1165.gabf054ab                   1.2.3.1115.gd61a8f5c
1 upgrades available.

(1/1) Found Spotify [Spotify.Spotify] Version 1.2.3.1115.gd61a8f5c
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://download.scdn.co/SpotifyFullSetup.exe
  ██████████████████████████████  76.8 MB / 76.8 MB
Successfully verified installer hash
Starting package install...
Successfully installed

PS C:\Users\WDAGUtilityAccount> winget -v
v1.4.10173

@lackovic
Copy link
Author

Spotify does not install elevated.
If you update WinGet to the latest release (1.3) you'll get a error message that reflects that.

I forgot about this and have tried to upgrade Spotify in an elevated shell.
However I didn't get the message to reflect that, just a Installer failed with exit code: 23.

> winget upgrade -h --all --verbose-logs
Name                                Id                         Version              Available           Source
--------------------------------------------------------------------------------------------------------------
Spotify                             Spotify.Spotify            1.2.3.1115.gd61a8f5c 1.2.4.912.g949d5fd0 winget
1 upgrade available.

(1/1) Found Spotify [Spotify.Spotify] Version 1.2.4.912.g949d5fd0
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
Starting package install...
Installer failed with exit code: 23

> winget --info
Windows Package Manager v1.4.10173
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.1194
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

@denelon
Copy link
Contributor

denelon commented Feb 17, 2023

Spotify had the "prohibitsElevation" key which gave the user a message that it didn't work elevated. Unfortunately, we have had to do a bunch of gymnastics in our validation environment to switch to a "user" context for the install. Work is in progress.

Additionally, I've added a feature to add it to the expected return codes enumeration so that error can also be mapped when the key isn't present. The community removed the key to enable it to pass validation.

Add your 👍 to raise priority.

@felipog
Copy link

felipog commented Mar 17, 2023

Hello! So I was also having the issues for installing via winget.
Then I first removed the pre-installed version that came with Windows 11 , just right click on the app on the Windows menu, and unisntall. Then, winget install spotify.spotify worked. So it needs admin rights for replacing probably.

Cheers

@aetonsi
Copy link

aetonsi commented Mar 21, 2023

Weird, i cannot replicate your issue..

I haven't tested it, but could it have something to do with winget upgrade --all? Perhaps the behavior is different compared to winget upgrade Spotify.Spotify

@ImJoakim Yes that's the exact problem, as you verified later.
It seems that winget upgrade --all ignores the ElevationRequirement, tries to install, then reports a generic Installer failed with exit code: 23.

@denelon if it can be of help for the "switch to user context", the gerardog/gsudo tool can do it with the integrity flag:

gsudo --integrity Medium -- any command /and /arguments
# for example
gsudo --integrity Medium -- winget upgrade spotify.spotify

this will "de-elevate" any given command (i haven't actually tried it with spotify because i have already updated spotify at this point).
I'll let you guys judge if it can be useful

@esters
Copy link

esters commented May 12, 2023

Morning. I had the same issue but the reason was that Spotify was running in the background. After exiting it and running winget upgrade Spotify.Spotify from an non-elevated shell it upgraded without issues.

> winget upgrade Spotify.Spotify
Found Spotify [Spotify.Spotify] Version 1.2.11.914.gd3175972
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
Starting package install...
Successfully installed
> winget -v
v1.4.10173

@aetonsi
Copy link

aetonsi commented May 12, 2023

Same thing for me, this morning.
As i wrote last time, without using a new shell, via gsudo it's possible to de-elevate.
I even tried a clean install in an elevated shell:

C:\Windows\System32 (errorlevel -1978335210) # winget install spotify.spotify
The installer cannot be run from an administrator context.

C:\Windows\System32 (errorlevel -1978335146) # gsudo --direct --integrity medium -- winget install spotify.spotify
Found Spotify [Spotify.Spotify] Version 1.2.11.914.gd3175972
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://upgrade.scdn.co/upgrade/client/win32-x86/spotify_installer-1.2.11.914.gd3175972-2210.exe
  ██████████████████████████████  84.3 MB / 84.3 MB
Successfully verified installer hash
Starting package install...
Successfully installed

@gaia
Copy link

gaia commented Sep 16, 2023

Still happening on Winget v1.5.2201, the current release as of today. Non elevated it works fine.

@lackovic
Copy link
Author

Still happening on Winget v1.5.2201, the current release as of today. Non elevated it works fine.

As per @denelon previous comment, this problem (the uninformative error message Installer failed with exit code: 23) will not be solved until the following issue will be resolved:

Rather than commenting this issue I suggest to add your 👍 to the issue above and subscribe to raise its priority. At the moment it has only two 👍.

@denelon denelon added this to the 1.7 Packages milestone Nov 1, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

10 participants