Can't Create New UA Folder

I’m just beginning to create a PoC here and trying to use the New-UAFolder cmdlet but finding that there is some sort of underlying error (Pwsh 7.0.3).
image
image

I’ve also tried doing this without any of the extraneous parts, but always get a 404. It seems this errors out even in the swagger ‘try it out’

Additionally, I’m seeing this in the logs fairly frequently:

2020-08-28T13:16:48.1318449-04:00  [ERR] Failed to read configuration file. folders.ps1 (4b60bc16)
System.NullReferenceException: Object reference not set to an instance of an object.
   at UniversalAutomation.Folder.Equals(Object obj) in D:\a\universal\universal\src\UniversalAutomation.Common\Models\Folder.cs:line 26
   at System.Collections.Generic.ObjectEqualityComparer`1.IndexOf(T[] array, T value, Int32 startIndex, Int32 count)
   at System.Array.IndexOf[T](T[] array, T value, Int32 startIndex, Int32 count)
   at System.Collections.Generic.List`1.IndexOf(T item)
   at System.Collections.Generic.List`1.Contains(T item)
   at System.Collections.ObjectModel.Collection`1.Contains(T item)
   at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value)
   at UniversalAutomation.Services.UniversalConfigurationService.<>c__DisplayClass23_0`1.<Read>b__0(T m) in D:\a\universal\universal\src\UniversalAutomation\Services\UniversalConfigurationService.cs:line 286
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at UniversalAutomation.Services.UniversalConfigurationService.Read[T](Func`2 includes) in D:\a\universal\universal\src\UniversalAutomation\Services\UniversalConfigurationService.cs:line 290

Additionally, when I try to manually create a folder from the shell, I see this in the logs:

2020-08-28T13:37:21.1510344-04:00 0HM2BF2U863RE:00000005 [INF] Authorization was successful. (0d575a54)
2020-08-28T13:37:21.1510703-04:00 0HM2BF2U863RE:00000005 [INF] Executing endpoint '"UniversalAutomation.FolderController.Post (UniversalAutomation)"' (500cc934)
2020-08-28T13:37:21.1511137-04:00 0HM2BF2U863RE:00000005 [INF] Route matched with "{action = \"Post\", controller = \"Folder\"}". Executing controller action with signature "System.Threading.Tasks.Task`1[UniversalAutomation.Folder] Post(UniversalAutomation.Folder)" on controller "UniversalAutomation.FolderController" ("UniversalAutomation"). (122b2fdf)
2020-08-28T13:37:21.1518483-04:00 0HM2BF2U863RE:00000005 [INF] Executed action "UniversalAutomation.FolderController.Post (UniversalAutomation)" in 0.7138ms (afa2e885)
2020-08-28T13:37:21.1519070-04:00 0HM2BF2U863RE:00000005 [INF] Executed endpoint '"UniversalAutomation.FolderController.Post (UniversalAutomation)"' (99874f2b)
2020-08-28T13:37:21.1532967-04:00 0HM2BF2U863RE:00000005 [ERR] An unhandled exception has occurred while executing the request. (48a46595)
System.NullReferenceException: Object reference not set to an instance of an object.
   at UniversalAutomation.FolderController.Post(Folder folder) in D:\a\universal\universal\src\UniversalAutomation\Controllers\FolderController.cs:line 48
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in D:\a\universal\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 88
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
2020-08-28T13:37:21.2205894-04:00 0HM2BF2U863RE:00000005 [INF] Request finished in 296.1224ms 404  (791a596a)

Hmmm. The folder stuff seems busted. I’ve open an internal issue in our GH repo and will take a look at whats wrong for 1.3.2.

1 Like