Package Manager : Cannot connect to 'api.unity.com'

When I open Package Manger, the following error message is displayed.

[Package Manager Window] Error searching for packages.
Unable to perform online search:
Cannot connect to ‘api.unity.com’ (error code: ECONNRESET). Verify your environment firewall policies allow connection to this host name. If your system is behind a proxy, verify your proxy environment variables (HTTP_PROXY and HTTPS_PROXY) are properly set.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

When I trying to refresh Unity Rigistry, the same error message is displayed, but I can refresh My Assets successfully.
I tried to do these things:

  • switched between several different versions of Unity (2022.3/2021.4/2019.4).
  • checked the environment variables for correct configuration of HTTP_PROXY and HTTPS_PROXY.
  • checked the firewall settings, and I even tried turning off the firewall, but it didn’t work.
  • turn on/off the VPN.
  • reinstall Unity Hub and Unity Editor.

however, the problem still exists.

i tried to run ‘RunUnityPackageManagerDiagnostics’:

then i got the log

[2024-09-09T12:58:35.725Z][INFO] Opened report file 'C:\Users\AiUU\upm-diagnostic-report.txt'
[2024-09-09T12:58:35.726Z][INFO] Starting diagnostics
[2024-09-09T12:58:35.727Z][INFO][UpmRegistryReachable] Sending HEAD request to
https://packages.unity.com
[2024-09-09T12:58:38.424Z][ERROR][UpmRegistryReachable] Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 7890
[2024-09-09T12:58:38.425Z][INFO][PingUpmRegistry] Starting ping test on 'http://packages.unity.com/com.unity.package-manager.metadata'
[2024-09-09T12:58:38.426Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.427Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.427Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.427Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.428Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.428Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.428Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.429Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.429Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.429Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.429Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.430Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.430Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.430Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.430Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.430Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.431Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.431Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.431Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.431Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.431Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.431Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.432Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.432Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.432Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.432Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.432Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.432Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.433Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.433Z][ERROR][PingUpmRegistry] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.433Z][INFO][PingUpmDownload] Starting ping test on 'http://download.packages.unity.com/com.unity.package-manager.metadata/-/com.unity.package-manager.metadata-0.0.1.tgz'
[2024-09-09T12:58:38.433Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.435Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.435Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.435Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.436Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.436Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.436Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.436Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.436Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.436Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.436Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.437Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.437Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.437Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.437Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.437Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.437Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.437Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.438Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.438Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.438Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.438Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.438Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.438Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.439Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.439Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.439Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.439Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.439Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.439Z][ERROR][PingUpmDownload] Error: Invalid protocol: 127.0.0.1:
[2024-09-09T12:58:38.440Z][INFO][UpmRegistryDownloadSpeed] Starting speed test with UPM registry

this is really annoying me, can anyone help ?

Looks like you’ve set your proxy as 127.0.0.1:[…] and Unity thinks “127.0.0.1” is the protocol instead of the address. Try setting it as http://127.0.0.1:[…] instead.

this worked! thank you !!!