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

Uninstall via SSH: "A specified logon session does not exist. It may already hav e been terminated." error with several products #2537

Closed
ClementDelannoySlateDigital opened this issue Sep 21, 2022 · 10 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate Issue is a duplicate
Milestone

Comments

@ClementDelannoySlateDigital

Brief description of your issue

Using winget via ssh (Open SSH), I cannot uninstall most of the builtin apps.
For instance, running 'winget uninstall "Phone Link"' will fail via ssh, but not in a graphical session.

Steps to reproduce

Run
winget uninstall "Phone Link"

via an ssh session

Expected behavior

The product is uninstalled

Actual behavior

>winget uninstall "Phone Link" Failed in attempting to update the source: winget Found Phone Link [Microsoft.YourPhone_8wekyb3d8bbwe] Starting package uninstall... Uninstall failed with exit code: 0x80070520 : A specified logon session does not exist. It may already have been terminated.

Environment

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

Windows: Windows.Desktop v10.0.19044.2006
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2091.0
@ghost ghost added the Needs-Triage Issue need to be triaged label Sep 21, 2022
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Sep 21, 2022
@denelon
Copy link
Contributor

denelon commented Sep 21, 2022

When you are using ssh, are you connecting to a specific user/Windows account that has winget provisioned, or are you connecting to the system account?

The Windows Package Manager is distributed with the App Installer which is an MSIX package. The package needs to be registered for an "interactive" account that has been logged into. If you are using the "system" context, the package is not registered.

@ClementDelannoySlateDigital
Copy link
Author

Thanks for your answer.
Yes, this is the only user account, with Administrator rights. I am still not sure to understand what "interactive account" means, but I can launch winget to install, for instance, Python, Java and Visual Studio without any issue.

@denelon
Copy link
Contributor

denelon commented Sep 22, 2022

I should have stated "interactive session". The Windows Package Manager doesn't get registered for an account until a user has "logged in" to an account on the local machine. If you log on as "system" then you can use winget in that account. If you're just remoting in, it may not be registered.

Using my AAD account, I was able to:

winget uninstall "Phone Link"                                               
Found Phone Link [Microsoft.YourPhone_8wekyb3d8bbwe]
Starting package uninstall...
  ██████████████████████████████  100%
Successfully uninstalled

and subsequently:

winget install "Phone Link" -s msstore                                      
Found Phone Link [9NMPJ99VJBWV] Version Unknown
This package is provided through Microsoft Store. winget may need to acquire the package from Microsoft Store on behalf of the current user.
Version: Unknown
Publisher: Microsoft Corporation
Description:
  You love your phone. So does your PC. Get instant access to everything you love on your phone, right from your PC.

  Link your Android phone and PC to view and reply to text messages, make and receive calls*, view your notifications, and more.

  Make emailing yourself photos a thing of the past as you share your favorite images between your phone and PC. Copy, edit, and even drag and drop photos without ever touching your phone.

  For select** Microsoft Duo, Samsung, and HONOR phones access your favorite mobile apps on your PC. Continue working by wirelessly dragging and dropping your files from your phone to your PC (and vice versa).

  Let us know what features you’d like to see next by selecting “Send feedback” in the Phone Link app settings.

  For cross-device experiences to work, you must link your Android phone (running Android 7 or later) with your PC, through the Phone Link app.

  *Calls requires a Windows 10 PC with Bluetooth capability.

  **Drag and drop, Phone screen and Apps all require a compatible Android device (aka.ms/phonelinkdevices). The multiple apps experience requires a Windows 10 PC running the May 2020 Update or later and has at least 8GB of RAM, and your Android device must be running Android 11.0.​
License: https://go.microsoft.com/fwlink/?LinkId=529064
Privacy Url: https://go.microsoft.com/fwlink/?LinkId=521839
Copyright: © 2022 Microsoft
Agreements:
Category: Productivity
Pricing: Free
Free Trial: No
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
Seizure Warning: https://aka.ms/microsoft-store-seizure-warning
Store License Terms: https://aka.ms/microsoft-store-license


The publisher requires that you view the above information and accept the agreements before installing.
Do you agree to the terms?
[Y] Yes  [N] No: Y
Verifying/Requesting package acquisition...
Verifying/Requesting package acquisition success
Starting package install...
  ██████████████████████████████  100%
Successfully installed

@ClementDelannoySlateDigital
Copy link
Author

I am not sure to understand, but I think I have to insist on the fact that everything work (install apps from both msstore and winget sources, list apps, uninstall apps installed via winget...) EXCEPT uninstall some apps, like for instance Phone Link, Edge, Xbox Bar...

@eosfor
Copy link

eosfor commented Nov 16, 2022

having the same issue

@idontsov
Copy link

Same issue here.

@denelon denelon added this to WinGet Feb 14, 2023
@denelon denelon added this to the v1.5-Client milestone Feb 14, 2023
@microsoft-github-policy-service
Copy link
Contributor

@ClementDelannoySlateDigital we've identified this Issue as a duplicate of another one that already exists. This specific instance is being closed in favor of tracking the concern over on the referenced Issue. Thanks for your report! Be sure to add your 👍 to the other issue to help raise the priority.

@microsoft-github-policy-service microsoft-github-policy-service bot removed this from the v1.5-Client milestone Feb 21, 2023
@github-project-automation github-project-automation bot moved this to Done in WinGet Feb 21, 2023
@denelon denelon added this to the v1.5-Client milestone Feb 22, 2023
@ClementDelannoySlateDigital
Copy link
Author

Hello,
I'm still not sure that my issue is a duplicate of the one you linked, but I will continue to check the solutions for the other ticket.
Thanks

@denelon denelon removed this from WinGet Jul 6, 2023
@Stiverton
Copy link

Stiverton commented Oct 16, 2023

I should have stated "interactive session". The Windows Package Manager doesn't get registered for an account until a user has "logged in" to an account on the local machine. If you log on as "system" then you can use winget in that account. If you're just remoting in, it may not be registered.

This is a bit troublesome considering that I am trying to remotely administer a bunch of VMs and winget commands are unable to resolve remotely.

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. Resolution-Duplicate Issue is a duplicate
Projects
None yet
Development

No branches or pull requests

5 participants