Search Unity

Editor fails to open when a VPN client is active (shader compiler socket connection failed)

Discussion in 'Editor & General Support' started by bac9-flcl, Apr 22, 2018.

  1. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I'm unable to launch Unity whenever NordVPN client on Windows takes over outbound connections. No idea how that manages to affect local socket connections, but Unity hangs on startup with the following message being spammed in the Editor log:

    Code (csharp):
    1. Failed to get socket connection from UnityShaderCompiler.exe shader compiler! C:/Work/Unity/Unity 2017.4.0f1/Editor/Data/Tools/UnityShaderCompiler.exe
    2. UnityEngine.GUIStyle:INTERNAL_CALL_Internal_Draw2(IntPtr, Rect&, GUIContent, Int32, Boolean)
    3. UnityEngine.GUIStyle:Internal_Draw2(IntPtr, Rect, GUIContent, Int32, Boolean) (at C:\buildslave\unity\build\artifacts\generated\common\modules\IMGUI\GUIStyleBindings.gen.cs:321)
    4. UnityEngine.GUIStyle:Draw(Rect, GUIContent, Int32, Boolean) (at C:\buildslave\unity\build\Runtime\IMGUI\Managed\GUIStyle.cs:427)
    5. UnityEngine.GUIStyle:Draw(Rect, GUIContent, Int32) (at C:\buildslave\unity\build\Runtime\IMGUI\Managed\GUIStyle.cs:413)
    6. UnityEditor.DockArea:OldOnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:361)
    7. UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:182)
    8. UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:338)
    9. UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint(IStylePainter) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:69)
    10. UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:532)
    11. UnityEngine.Experimental.UIElements.Panel:PaintSubTreeChildren(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:547)
    12. UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:536)
    13. UnityEngine.Experimental.UIElements.Panel:Repaint(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:564)
    14. UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:241)
    15. UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:78)
    16. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\IMGUI\Managed\GUIUtility.cs:175)
    17.  
    18. [C:\buildslave\unity\build\Tools/UnityShaderCompiler/ShaderCompilerClient.cpp line 226]
    19. (Filename: C:/buildslave/unity/build/artifacts/generated/common/modules/IMGUI/GUIStyleBindings.gen.cs Line: 321)
    I have contacted NordVPN support too, in case they are aware of some weird side effect on local connections, but I'm not sure what that would be. I'd really appreciate some ideas on fixing this. VPN service became crucial to my work in the past week (my country is playing whack-a-mole with millions of AWS IP addresses in an attempt to block an app, which leads to issues when you rely on Slack and other cloud services etc.), so I can't really drop it easily.
     
  2. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    I have the same problem, what you need to do is allow private connections for UnityShaderCompiler.exe, Unity Editor, Unity Package Manager in Windows firewall or your custom firewall. Just find those .exes in your Unity installation folder and add them to Windows Firewall.

    Or connect to VPN via your router instead
     
  3. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Hey, thanks for the advice, I'll try that immediately! I have one question, though - how do you clear the package manager for local connections? The package manager has no executable file, and Windows Firewall permissions only work on executables. Maybe I'm missing something and it's auto-installed somewhere outside of the Editor folder, though?
     
  4. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    Package Manager should be added automatically to Windows Firewall when you install Unity, then you just tick the box on for Private connections only. At least that's how it worked for me.
    Maybe try reinstalling Unity with admin rights for Unity installer if it doesn't show up
     
  5. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Just to be sure that we're talking about exact same service - you are referring to allowing private connections in this window, right?



    You are right, package manager is in there, with private connections prohibited by default. I have changed that, enabling private and public connections on every single versioned package manager and Unity Editor entry here:



    Below those entries, I have also enabled private/public connections for every non-versioned "Unity Editor" entry, and finally, for the "Unity Shader Compiler" entry:



    Just in case, I'm running Unity 2017.4.1f1 in "Run as Administrator" mode. Unfortunately, none of those changes in Windows firewall seem to have any effect on the issue - whenever a VPN application takes over the Internet connection, any Editor project fails to load. That happens even if you don't have any shaders in need of compiling in the project itself, since the Editor UI requires the shader compiler to draw itself. You're left with a white screen and compiler connection errors spammed in the editor log:

    Code (csharp):
    1. D3D11: Failed to create RenderTexture (360 x 789 fmt 23 aa 1), error 0x887a0005
    2.  
    3. (Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/RenderTextureD3D11.cpp Line: 366)
    4.  
    5. Failed to get socket connection from UnityShaderCompiler.exe shader compiler! C:/Work/Unity/Unity 2017.4.0f1/Editor/Data/Tools/UnityShaderCompiler.exe
    6. UnityEditor.Handles:Internal_DrawCameraWithGrid(Camera, Int32, DrawGridParameters&)
    7. UnityEditor.Handles:DrawCameraImpl(Rect, Camera, DrawCameraMode, Boolean, DrawGridParameters, Boolean, Boolean) (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorHandlesBindings.gen.cs:933)
    8. UnityEditor.Handles:DrawCameraImpl(Rect, Camera, DrawCameraMode, Boolean, DrawGridParameters, Boolean) (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorHandlesBindings.gen.cs:903)
    9. UnityEditor.Handles:DrawCameraStep1(Rect, Camera, DrawCameraMode, DrawGridParameters) (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorHandlesBindings.gen.cs:955)
    10. UnityEditor.SceneView:DoDrawCamera(Rect, Boolean&) (at C:\buildslave\unity\build\Editor\Mono\SceneView\SceneView.cs:1146)
    11. UnityEditor.SceneView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\SceneView\SceneView.cs:1634)
    12. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    13. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    14. System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    15. UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:295)
    16. UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:288)
    17. UnityEditor.HostView:InvokeOnGUI(Rect) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:255)
    18. UnityEditor.DockArea:OldOnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:398)
    19. UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:182)
    20. UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:338)
    21. UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint(IStylePainter) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:69)
    22. UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:532)
    23. UnityEngine.Experimental.UIElements.Panel:PaintSubTreeChildren(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:547)
    24. UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:536)
    25. UnityEngine.Experimental.UIElements.Panel:Repaint(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:564)
    26. UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:241)
    27. UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:78)
    28. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\IMGUI\Managed\GUIUtility.cs:175)
    29.  
    30. [C:\buildslave\unity\build\Tools/UnityShaderCompiler/ShaderCompilerClient.cpp line 226]
    31. (Filename: /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs Line: 222)
    I'm not sure what else I can do at this point, unfortunately. Maybe I missed something, and there is another firewall interface where I have to set another set of permissions?

    Connecting to the VPN through the router seems to be the cleanest route, but I'm on an ISP that mandates use of their custom routers with proprietary firmware, so this doesn't seem to be an option for me.

    ______

    On another note, NordVPN support got back to me with this:

    I have already installed new release 6.13, which includes that option. It's labeled "Invisibility on LAN: Your computer will be invisible to others on a local area network (LAN)". I'm not sure whether support suggested it to be on or off to solve my issue. Unfortunately, neither on nor off state seem to do anything for it, Unity Editor still fails to connect to the shader compiler.
     
    Last edited: Apr 30, 2018
  6. hateflowswithyou

    hateflowswithyou

    Joined:
    Apr 3, 2018
    Posts:
    1
    That sounds good but it's better to read few articles before installing anything. Here's a good one Team-gizka.org.
     
  7. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    @bac9-flcl
    Frankly, it seems the best solution is to have a VPN set up on your router/switch/separate pc and then connect your workstation to that. Get a router that supports DD-WRT firmware where you can easily set up VPN including NordVPN, without messing with finicky NordVPN app on your workstation. Which is probably what I'm going to do, because it only sort of works on my machine too - it seems that it starts working after a while after connecting, but not straight away, when all Unity services in firewall are set to private, but it's a mess. And of course Unity creates dozens of duplicate entries in Windows firewall (you should deactivate all those and just leave one for every Unity service, set everything to Private, deselect Public, that's my setup).

    Either way, separate router with a VPN connection is probably the best solution.
     

    Attached Files:

    • fw.jpg
      fw.jpg
      File size:
      22.3 KB
      Views:
      804
  8. redwyre

    redwyre

    Joined:
    Oct 14, 2018
    Posts:
    29
    This problem was causing my project load to take hours before crashing. I added firewall rules but disabling the VPN was the only way to get it to work. I have the "Invisability on LAN" turned off so that doesn't help.
     
  9. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Same issue here with NordVPN.
     
  10. clamum

    clamum

    Joined:
    May 14, 2017
    Posts:
    61
    Same issue with NordVPN. I was about to pull out what little is left of my hair due to this issue (it manifests itself as a white screen when trying to open a project, it's just frozen there and never loads). I finally looked at the log a bit ago and it has the same errors as the OP.

    Well I'm uninstalling NordVPN on my desktop and Surface Pro. I'd rather not, but this is ridiculous (it screws with Steam connectivity too, and some websites). I use it on my mobile phone but f it, I'm done with it on my desktops.
     
  11. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I'd just use the browser plugin. The best alternative would've been to install it on my router, but I don't have an option of installing custom firmware on mine.
     
  12. ecker00

    ecker00

    Joined:
    Oct 22, 2013
    Posts:
    2
    I've been stuck on this for hours, endless loading and crashes. Turning my antivirus on and off with no luck. Finally turned NordVPN off and it worked! Sad it's not possible to use NordVPN with Unity, that is quite a deal breaker.

    In the editor log
    C:\Users\_user_\AppData\Local\Unity\Editor\Editor.log
    I see lots of these:

    Code (bash):
    1. Failed to get socket connection from UnityShaderCompiler.exe shader compiler! C:/Program Files/Unity/Hub/Editor/2019.1.1f1/Editor/Data/Tools/UnityShaderCompiler.exe
    2. (Filename: C:\buildslave\unity\build\Tools/UnityShaderCompiler/ShaderCompilerClient.cpp Line: 293)
     
    usbuildpro likes this.
  13. Alunny

    Alunny

    Joined:
    May 17, 2020
    Posts:
    5
    Has anyone fixed this? I'm not using Nord at the same time as Unity, nor did I install it while it was on....but I'm wondering if this is why I can't launch anything through hub.
     
  14. I switched Private Internet Access.

    But they say if you uninstall the Nord client and install OpenVPN or through windows network it does not cause the problem, only Nord's client. They have the necessary settings on their website somewhere. It may worth a try.
     
  15. Alunny

    Alunny

    Joined:
    May 17, 2020
    Posts:
    5
    I did follow that tutorial and it is not working, it says the server can't resolve on Nords end.
     
  16. jeberl

    jeberl

    Joined:
    Feb 6, 2019
    Posts:
    2
    We had a similar issue with OpenVPN and Editor hangups on Project load (usually it hangs on the first interaction with either the scene hierarchy or the Project hierarchy) We couldn't track it down to the shader compiler, but I share our solution anyway, it might help someone.

    However, we are using a private Package Repo and Plastic SCM server, and are somewhat forced to be on the VPN when working with Unity. I have tried everything like allowing UnityEditor, PackageManager and ShaderCompiler through my firewall explicitly, without much success.

    I found a temporary workaround however. We just started removing standard Unity packages we don't really use (such as Ads, Purchase and the like), and I found the culprit to be a package named Collab-Proxy. I did not experience another hang after removing this package. So try removing it if you don't use it, and see if it works for you.
     
  17. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    Another solution would be to use split tunneling function in your VPN client - use VPN only for browsing or whatever you need, but disable it for Unity. Also, WireGuard protocol instead of OpenVPN generally causes less compatibility issues and is a lot faster.