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

Network error #22628

Closed
ionisz opened this issue Dec 8, 2022 · 14 comments
Closed

Network error #22628

ionisz opened this issue Dec 8, 2022 · 14 comments
Assignees
Labels
Issue-Bug Something isn't working Needs-Team-Response An issue author responded so the team needs to follow up Product-Settings The standalone PowerToys Settings application Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@ionisz
Copy link

ionisz commented Dec 8, 2022

Microsoft PowerToys version

0.65.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Settings

Steps to reproduce

Just updated. Went to 'General' Settings, hit "Check for updates" button, got error message "Network error. Please try again later". Have not rebooted since update. Will try that.

✔️ Expected Behavior

For it to check and tell me that I have the latest update.

❌ Actual Behavior

Got the error message.

Other Software

No response

@ionisz ionisz added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Dec 8, 2022
@ionisz
Copy link
Author

ionisz commented Dec 8, 2022

Problem persisted after reboot

@jaimecbernardo jaimecbernardo added the Product-Settings The standalone PowerToys Settings application label Dec 9, 2022
@jaimecbernardo
Copy link
Collaborator

That was a recent change. PowerToys can't seem to access the network from your machine, that's why we've got that message.
Can you see the "What's New?" tab in "Welcome To PowerToys?" Or does it error out as well? /needinfo

image

image

@donlaci , what's the technique we're using for checking network connection?

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Dec 9, 2022
@ionisz
Copy link
Author

ionisz commented Dec 9, 2022

Yes, I can see the 'what's new' tab. Problem has occurred on both my laptop (wireless) and my desktop (wired connections).

@ghost ghost added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Dec 9, 2022
@donlaci
Copy link
Collaborator

donlaci commented Dec 9, 2022

Hi! @jaimecbernardo
We use NetworkInterface.GetIsNetworkAvailable().
The available network connections we get from NetworkInterface.GetAllNetworkInterfaces(). The list has to be filtered.
Below you can find the detailed method.

   public static bool IsNetworkAvailable()
    {
        if (!NetworkInterface.GetIsNetworkAvailable())
        {
            return false;
        }

        foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
        {
            // discard because of standard reasons
            if ((ni.OperationalStatus != OperationalStatus.Up) ||
                (ni.NetworkInterfaceType == NetworkInterfaceType.Loopback) ||
                (ni.NetworkInterfaceType == NetworkInterfaceType.Tunnel))
            {
                continue;
            }

            // discard virtual cards (virtual box, virtual pc, etc.)
            if (ni.Description.Contains("virtual", StringComparison.OrdinalIgnoreCase) ||
                ni.Name.Contains("virtual", StringComparison.OrdinalIgnoreCase))
            {
                continue;
            }

            // discard "Microsoft Loopback Adapter", it will not show as NetworkInterfaceType.Loopback but as Ethernet Card.
            if (ni.Description.Equals("Microsoft Loopback Adapter", StringComparison.OrdinalIgnoreCase))
            {
                continue;
            }

            return true;
        }

        return false;
    }

@ionisz
Copy link
Author

ionisz commented Dec 9, 2022

not 100% sure, but I think the mistake is discarding the virtual interfaces. On my computer, the virtual interface (created by Hyper-V) is the active interface, and the underlying physical interfaces are (I believe) only accessible by it).

@jaimecbernardo
Copy link
Collaborator

So this is inside a Hyper-V machine. That's useful information. @donlaci , can you please give it a test and replace the method for something that works there as well? "What's new" is working for the user, so it's clear there's a usable connection there.

@ionisz
Copy link
Author

ionisz commented Dec 12, 2022 via email

@jrbreunig
Copy link

I am running into the same network issue too where Hyper-V's virtual switch is connected to the physical wired network adapter. When I disconnect the wired network and switch over to the wireless network adapter, I can check for updates in PowerToys v0.65.0.

@donlaci
Copy link
Collaborator

donlaci commented Dec 13, 2022

Hi!@ionisz @jrbreunig
Thanks for your feedback!
I invite you to a short collaboration to solve the issue.
On my laptop, when unplagged from the net and wifi switched off, I got 9 internet collections. (debugging the IsNetworkAvailable() method, which you can find above).

"Realtek PCIe GbE Family Controller" down
"Realtek USB GbE Family Controller" down
"Microsoft Wi-Fi Direct Virtual Adapter" down
"Microsoft Wi-Fi Direct Virtual Adapter #2" down
"VMware Virtual Ethernet Adapter for VMnet1" up, virtual
"VMware Virtual Ethernet Adapter for VMnet8" up, virtual
"MediaTek Wi-Fi 6 MT7921 Wireless LAN Card" down
"Bluetooth Device (Personal Area Network)" down
"Software Loopback Interface 1" up, loopback

Could you please also send me a feedback about your internet connections (when up and runing) to see the difference.
Thanks a lot!

@ionisz
Copy link
Author

ionisz commented Dec 13, 2022

Using Powershell, while connected:
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed


vEthernet (vLan) Hyper-V Virtual Ethernet Adapter #2 46 Disconnected 00-FF-E3-20-0A-85 10 Gbps
Ethernet 7 TAP-Windows Adapter V9 44 Disconnected 00-FF-E3-20-0A-85 1.1 Gbps
Wi-Fi Intel(R) Dual Band Wireless-AC 3160 42 Up 30-3A-64-9A-A4-C5 390 Mbps
Bluetooth Network Con...2 Bluetooth Device (Personal Area Netw... 41 Disconnected 30-3A-64-9A-A4-C9 3 Mbps
vEthernet (vWan) Hyper-V Virtual Ethernet Adapter 35 Up 30-3A-64-9A-A4-C5 390 Mbps
vEthernet (Default Swi... Hyper-V Virtual Ethernet Adapter #3 51 Up 00-15-5D-9E-10-C4 10 Gbps
vEthernet (vEthernet (... Hyper-V Virtual Ethernet Adapter #4 69 Up 00-15-5D-A6-55-12 10 Gbps
Network Bridge Microsoft Network Adapter Multiplexo... 30 Up 30-3A-64-9A-A4-C5 390 Mbps
vEthernet (vEthernet (... Hyper-V Virtual Ethernet Adapter #5 84 Up 00-15-5D-C3-3D-27 10 Gbps

Using PowerShell, while disconnected
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed


vEthernet (vLan) Hyper-V Virtual Ethernet Adapter #2 46 Disconnected 00-FF-E3-20-0A-85 10 Gbps
Ethernet 7 TAP-Windows Adapter V9 44 Disconnected 00-FF-E3-20-0A-85 1.1 Gbps
Wi-Fi Intel(R) Dual Band Wireless-AC 3160 42 Disconnected 30-3A-64-9A-A4-C5 6 Mbps
Bluetooth Network Con...2 Bluetooth Device (Personal Area Netw... 41 Disconnected 30-3A-64-9A-A4-C9 3 Mbps
vEthernet (vWan) Hyper-V Virtual Ethernet Adapter 35 Disconnected 30-3A-64-9A-A4-C5 0 bps
vEthernet (Default Swi... Hyper-V Virtual Ethernet Adapter #3 51 Up 00-15-5D-9E-10-C4 10 Gbps
vEthernet (vEthernet (... Hyper-V Virtual Ethernet Adapter #4 69 Up 00-15-5D-A6-55-12 10 Gbps
Network Bridge Microsoft Network Adapter Multiplexo... 30 Disconnected 30-3A-64-9A-A4-C5 0 bps
vEthernet (vEthernet (... Hyper-V Virtual Ethernet Adapter #5 84 Up 00-15-5D-C3-3D-27 10 Gbps

@ionisz
Copy link
Author

ionisz commented Dec 13, 2022

Used PowerShell as I don't have C or C+ Programming languages installed.

@Cmdr-Keene
Copy link

Cmdr-Keene commented May 19, 2023

I just started experiencing this issue and same cause as you have found. This issue exists on the host hardware computer, not the virtual machines (ironically they can check for updates just fine).

The issue is with how the virtual switch is configured. The default switch would let PowerToys check for updates. Recently (but for valid yet unrelated reasons) I implemented an External Switch instead (example of my host machine below). Now PowerToys can no longer check for updates.

image

here's the v-switch I'm using:
image

PS. If I install PowerToys through the store instead would it receive updates from there?

@Jay-o-Way Jay-o-Way added Status-In progress This issue or work-item is under development and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jun 8, 2023
@jaimecbernardo jaimecbernardo added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels Jun 14, 2023
@crutkas
Copy link
Member

crutkas commented Jul 14, 2023

Fixed in 0.71 release of PowerToys. aka.ms/installpowertoys

@crutkas crutkas closed this as completed Jul 14, 2023
@ionisz
Copy link
Author

ionisz commented Jul 16, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Needs-Team-Response An issue author responded so the team needs to follow up Product-Settings The standalone PowerToys Settings application Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

7 participants