Symptoms:
- I cannot open my Unity Project.
- Whenever I open Unity, I get an error saying “Could not establish a connection with the Unity Package Manager local server process".
Cause:
This error occurs when the Unity Editor starts the Unity Package Manager process, but is not able to communicate with it over the address http://127.0.0.1.
There could be a number of causes, such as HTTP traffic being blocked on this address by a firewall or that HTTP traffic is being re-routed from this address by a proxy.
Resolution:
Proxy Suggestions
A proxy server (for example on a corporate network) may be redirecting HTTP traffic from your machine. If the proxy is intercepting traffic on http://127.0.0.1, then the Unity Editor may be unable to communicate with UPM. For this reason, Unity automatically bypasses the proxy for Unity Package Manager requests.
However, in previous Unity versions, the proxy bypass could be overridden using the environment variable NO_PROXY or UNITY_NOPROXY. If you have these variables set, please ensure that their values include 127.0.0.1. For example:
Important: Some users have reported that even without setting the UNITY_NOPROXY variable, Unity could not communicate with UPM and that explicitly setting the variable as below fixed their issue:
UNITY_NOPROXY=localhost,127.0.0.1
Important: Some users have said to ensure both localhost and 127.0.0.1 are present, and localhost is listed first.
For instructions on setting environment variables, see the article, 'I need to start Unity with an environment variable(s) set, how can I do that?'
As of the following Unity versions, the proxy bypass behavior can no longer be overridden using environment variables. Unity will always bypass a proxy for connections with UPM:
Unity 2020 - 2020.1.0a24 and up
Unity 2019 - 2019.3.4f1 and up
Unity 2018 - 2018.4.18f1 and up
If you are on an earlier Unity version, please consider upgrading to one of the above versions. This way you can set UNITY_NOPROXY; how you like without worrying about interfering with connections to UPM.
Firewall Suggestions
On Windows, there is often a firewall enabled by default called Windows Defender Firewall. This firewall can prevent inbound and outbound HTTP connections for specific applications. For this reason, when installing a Unity Editor via the Unity Hub, the Hub automatically adds a rule to Windows Defender Firewall which allows inbound connections to the Unity Editor:
To view your inbound rules:
1) Control Panel > Windows Defender Firewall > Advanced settings > Inbound Rules
If you see your Unity Editor version is blocked (red circle icon), click “Properties” in the right-hand pane and under “Action”, select “Allow the connection”.
If you do not see a rule for your Unity Editor version, try creating one with the steps below:
- Click New Rule…
- For Rule Type, select Program.
- For the program path, enter the complete path to the Unity Editor installation.
- For Action, select Allow the connection.
- For Profile, select all rules (Domain, Private, Public)
- Give the rule a name, for example “Unity 2019.3.0a1 Editor”
Important: Some users have reported that even with an existing rule for their Unity Editor version, it appears that Windows Defender Firewall is still preventing inbound connections coming from UPM. Some users have found that deleting the existing rule and re-creating it has fixed this.
Unity Hub Suggestions
Unity Hub version 2.2.0 changed the way that environment variables were passed to the Unity Editor. This caused issues for some users since the user's own environment variable values might get overridden. If these were proxy-related environment variables, this may have prevented Unity from connecting to UPM.
Unity Hub version 2.2.2 fixed this issue so that user and system environment variables were preserved when starting the Unity Editor.
If you have an older version of the Unity Hub, please upgrade to version 2.2.2 or greater.
More Information:
Comments
0 comments
Article is closed for comments.