[BUG] Import connections crash the WAC
Upgraded to Windows Admin Center 1910 and imported connections using the Import-Connection powershell module.
WAC will no longer load with error
500 - ArgumentException: An item with the same key has already been added.
Stack trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)
2 arguments, CancellationToken cancellationToken)
at Microsoft.ManagementExperience.FrontEnd.Controllers.NodeController.GetConnections()
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ManagementExperience.FrontEnd.Handlers.ImpersonationActionInvoker.<InvokeActionAsync>d1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d1.MoveNext()
Running WAC in HA on Windows Server 2019. Upgraded using the MSFT powershell script for HA installation etc.
Checked import CSV and there were no duplicate servers in the file.

4 comments
-
Ryan commented
same issue here after upgrading to 1910 on server 2019
-
James Iversen commented
I was excited to "show it off" after Ignite... Now I have egg on my face. WAC failing all over the place on every machine I try to touch. From regular workstation, stuck at Initializing application screen, from red forest DA workstation WRM errors to all devices including local host... Way to make an impression guys. I know it was working before Ignite.
-
AS commented
Same issue here. After reseting the content of the folder "C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\ServerManagementExperience" it works until we click on a server connection. After that it stays working until we relaunch the browser.
-
Ben commented
We are also encountering this issue. Upgraded from 1904.1 (and have since done a clean install). Shortly after importing a list of connections using Import-Connections from ConnectionTools.psm1 we've found that if we fully refresh the page, we get:
msft.sme.shell -- ConnectionManager
message: Couldn't retrieve saved server list:An item with the same key has already been added..HTTP500: SERVER ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request.
(XHR)GET - https://wac.{{DOMAIN}}.com/api/connectionsThe only fix that I've found is to uninstall WAC completely and then delete "C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\ServerManagementExperience"
Mode: Gateway
Gateway OS: Windows 2016
Applied Hotfixes: KB3199986,KB4132216,KB4465659,KB4485447,KB4498947,KB4503537,KB4509091,KB4512574,KB4524152
Browsers Used: Chrome, Firefox, Edge
Connections list contains approximately 80 entries. Confirmed there are no duplicate entries. All connections are Windows Servers (2012R2, 2016 or 2019)