UniGetUI icon indicating copy to clipboard operation
UniGetUI copied to clipboard

[BUG] MS connection when powershell module disabled

Open Uj947nXmRqV2nRaWshKtHzTvckUUpD opened this issue 1 year ago • 11 comments

Please confirm these before moving forward

  • [X] I have searched for my issue and have not found a work-in-progress/duplicate/resolved issue.
  • [X] I have tested that this issue has not been fixed in the latest (beta or stable) release.
  • [X] I have checked the FAQ section for solutions
  • [X] This issue is about a bug (if it is not, please use the correct template)

Describe your issue

connects to microsoft domain even if powershell module disabled see command used below:

Steps to reproduce the issue

settings > powershell: disabled quit app reopen app => app attempts connection to go.microsoft.com by querying repos (Get-PSRepository)

WingetUI Log

N/A

Package Managers Logs

█▀▀▀▀▀▀▀▀▀ [28 March 2024 12:12:44] PowerShell ▀▀▀▀▀▀▀▀▀▀▀
█  Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█  Arguments:  -NoProfile -Command Get-PSRepository

Relevant information

expectation: app shouldn't connect to MS to query powershell modules repos if powershell is disabled in settings

Screenshots and videos

No response

Please share your entire logs

marticliment avatar Mar 27 '24 22:03 marticliment

it's nothing else relevant to this issue in the logs. that is the only command issued that triggers the connection attempt.

connection is easily reproductible by running that command in windows terminal:

powershell.exe -NoProfile -Command Get-PSRepository 

=> MS connection packets captured towards go.microsoft.com (92.122.18.57; alternate dns: e11290.dspg.akamaiedge.net), then to onegetcdn.azureedge.net (152.199.19.161 ; alternate dns: cs9.wpc.v0cdn.net)

I intercept the packets with an interactive firewall, but can be seen in any other network monitor tool

Afaik, go.microsoft.com is used for redirects to other MS links such as the above

it's nothing else relevant to this issue in the logs. that is the only command issued that triggers the connection attempt.

I insist. There is relevant information on the logs about the state of WingetUI and all the managers, information that will help me identify the flaw and fix it. I would appreciate you shared the logs so I can investigate the issue

marticliment avatar Mar 27 '24 22:03 marticliment

This is the most i can give you, because it's too much to redact about the software i have installed (I kinda care about my online privacy). Sorry, i hope it helps. It should be easily reproductible though.

  1. in wingetui log, only thing relevant is: (rest are related to other package managers) ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ █ Name: PowerShell █ Enabled: False █ THE MANAGER IS DISABLED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  2. in package manager logs, it's what i pasted above: ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ █▀▀▀▀▀▀▀▀▀ [28 March 2024 12:12:44] PowerShell ▀▀▀▀▀▀▀▀▀▀▀ █ Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe █ Arguments: -NoProfile -Command Get-PSRepository WARNING: Unable to find module repositories. [28 March 2024 12:12:44] Exit Code: 0 ..... ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ █▀▀▀▀▀▀▀▀▀ [28 March 2024 12:12:48] PowerShell ▀▀▀▀▀▀▀▀▀▀▀ █ Executable: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe █ Arguments: -NoProfile -Command Get-PSRepository WARNING: Unable to find module repositories. [28 March 2024 12:12:48] Exit Code: 0

the second attempt 4 seconds later, looks like a retry, since i blocked it in firewall. Rest of the logs are not related to powershell (are related to scoop, chocolatey, winget, npm, pip which I have enabled and working fine). however for my other disabled package manager '.NET tool', i don't see any log

  1. operation history log seems irelevant

because it's too much to redact about the software i have installed (I kinda care about my online privacy). Sorry, i hope it helps. It should be easily reproductible though.

Then please redact it all, but I need to know which managers are running and which commands are they calling with which frequency, as well as the WingetUI logs, so I can see the base state of each manager and other useful info.

If not, the issue cannot be debugged

marticliment avatar Mar 27 '24 23:03 marticliment

i only have disabled powershell and .net tool. rest are enabled. it should be easily reproductible on your side as well. I don't have time to redact it all. i am sorry

At least share WingetUI Logs, there shouldn't be much to redact there, and I will be able to get advanced details about the manager status

marticliment avatar Mar 27 '24 23:03 marticliment

I was able to reproduce the behavior without any more logs aswell

Bluscream avatar Mar 28 '24 04:03 Bluscream

Hello,

I am not trying to annoy anyone by asking for logs. I have tons of issues to debug and fix, as well as other features, and I obviously have to do other things in my life. The time I have available to build WingetUI is very limited, and I don't want to waste it tweaking my pc to recreate an issue I haven't succeeded to recreate, because no one wanted to upload their logs.

I understand your concerns with privacy, but the things shown on the logs, especially WingetUI logs, will not destroy your privacy. The shown API token, which is used for WingetUI Widgets, is generated each time WingetUI is restarted. And the next big issue are paths, from which you easily can remove your username.

I am sorry, but I will not invest more time on this issue until you share your logs.

I understand that your time is precious, but so is mine. You are facing an issue you want to get fixed, and trust me, I am willing to fix it, but I will need your collaboration to do so.

If you choose to not share your logs, I will close this issue. As said, I did not manage to recreate the issue locally.

marticliment avatar Mar 28 '24 07:03 marticliment

wingetui log. ignore the errors related to www.marticliment.com and announcements (i have blocked the domain in firewall) I didn't know you cannot reproduce it until now.

Welcome to WingetUI Version 3.0.1
               Version Code 3.01
C:\Users\<User>\AppData\Local\WingetUI\CachedLangFiles\lang_en.json
Loaded language locale: en
Api auth token: ****9x4j2ly (REDACTED)
Starting update check
Lang files were updated successfully
System.Net.Http.HttpRequestException: The requested name is valid, but no data of the requested type was found. (www.marticliment.com:443)
 ---> System.Net.Sockets.SocketException (11004): The requested name is valid, but no data of the requested type was found.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at ModernWindow.Structures.AppTools.UpdateWingetUIIfPossible(Int32 round) in Y:\WingetUI-Store\src\wingetui\Core\Tools.cs:line 328
Downloaded icons and screenshots successfully!
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: .NET Tool
█ Enabled: False
█ THE MANAGER IS DISABLED
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Starting scoop cleanup...
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Pip
█ Enabled: True
█ Found: True
█ Fancye exe name: pip
█ Executable path: C:\Users\<User>\AppData\Local\Programs\Python\Python312\python.exe
█ Call arguments:  -m pip
█ Version: 
█   pip 24.0 from C:\Users\<User>\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Npm
█ Enabled: True
█ Found: True
█ Fancye exe name: npm
█ Executable path: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█ Call arguments:  -NoProfile -ExecutionPolicy Bypass -Command npm
█ Version: 
█   10.5.0
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: PowerShell
█ Enabled: False
█ THE MANAGER IS DISABLED
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Scoop
█ Enabled: True
█ Found: True
█ Fancye exe name: scoop
█ Executable path: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
█ Call arguments:  -NoProfile -ExecutionPolicy Bypass -Command scoop
█ Version: 
█   Current Scoop version:
█   v0.3.1 - Released at 2022-11-15
█   
█   '.oki' bucket:
█   5b126ae oh-my-posh_plus_themes: Update to version 19.17.2
█   
█   'extras' bucket:
█   79ccdbe41 spyder: Update to version 5.5.3
█   
█   'main' bucket:
█   0830c5567 [email protected]: Fix hash (Closes #5616)
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Winget
█ Enabled: True
█ Found: True
█ Fancye exe name: winget.exe
█ Executable path: C:\Users\<User>\AppData\Local\Microsoft\WindowsApps\winget.exe
█ Call arguments: 
█ Version: 
█   v1.8.532-preview
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Chocolatey
█ Enabled: True
█ Found: True
█ Fancye exe name: choco.exe
█ Executable path: C:\ProgramData\chocolatey\bin\choco.exe
█ Call arguments: 
█ Version: 
█   2.2.2
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
LoadComponentsAsync finished executing. All managers loaded. Proceeding to interface.
Could not load announcements: System.Runtime.InteropServices.COMException (0x80072EE7): The text associated with this error code could not be found.
The server name or address could not be resolved
   at ModernWindow.Interface.Widgets.Announcer.LoadAnnouncements(Boolean retry) in Y:\WingetUI-Store\src\wingetui\Interface\Widgets\Announcer.xaml.cs:line 60
Error finding installed packages on manager Npm: 
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ModernWindow.PackageEngine.Managers.Npm.GetInstalledPackages_UnSafe()
   at ModernWindow.PackageEngine.Classes.PackageManager.GetInstalledPackages() in Y:\WingetUI-Store\src\wingetui\PackageEngine\Classes\Manager.cs:line 192
Starting check for updates wait interval with waitTime=28800

Thanks!

marticliment avatar Mar 28 '24 08:03 marticliment