PowerShell Universal - 4.2.18

PowerShell Universal - 4.2.18

Release Notes

APIs

  • Fixed an issue where the endpoint doc page didn’t have an authorize button (#3262)

Automation

  • Fixed an issue viewing job log files.
  • Changed the language of the Jobs run stat on the homepage (#3235)
  • Fixed an issue where Wait-PSUJob could throw an error based on job output (#3260)
  • Fixed an issue where the Get-PSJobOutput cmdlet returned a different data format in v4.2.16 (#3259)

PowerShell Apps

  • Fixed an issue with how memory usage was reported (#3217)
  • Fixed an issue with $Query scoping (#3267)
  • Fixed an issue with New-UDTextbox object result formats (#2838)

Platform

  • Fixed an issue with variables stored in the database (#3250)
  • New PSU versions are now automatically published to WinGet
  • Fixed Set-PSUCache example (#3265)
  • Fixed a display issue with app token expiration (#3097)
  • Fixed an issue where $UserInfo was not defined in role scripts when using Okta (#3241)

Downloads

1 Like

4.2.18 is broken i have no data and found the following errors so far

[ERR] Connection ID “0”, Request ID “00000000-0000-0000-b63f-84710c7967bb”: An unhandled exception was thrown by the application.

[ERR] An unhandled exception has occurred while executing the request.
System.IO.IOException: The process cannot access the file ‘C:\ProgramData\UniversalAutomation\log.db’ because it is being used by another process.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at LiteDB.Engine.FileStreamFactory.GetStream(Boolean canWrite, Boolean sequencial)
at LiteDB.Engine.StreamPool.<>c__DisplayClass3_0.<.ctor>b__0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at LiteDB.Engine.DiskService..ctor(EngineSettings settings, Int32[] memorySegmentSizes) at LiteDB.Engine.LiteEngine..ctor(EngineSettings settings) at LiteDB.ConnectionString.CreateEngine() at LiteDB.LiteDatabase..ctor(ConnectionString connectionString, BsonMapper mapper) at LiteDB.LiteDatabase..ctor(String connectionString, BsonMapper mapper) at LiteDB.LiteRepository..ctor(String connectionString, BsonMapper mapper) at UniversalAutomation.LiteDBv5Database.Count(Expression1 query) in C:\actions-runner_work\universal\universal\src\UniversalAutomation.LiteDBv5\LiteDBDatabase.cs:line 472
at UniversalAutomation.ViewModels.LogEntryPagedViewModel.PopulatePage(IDatabase _database, Expression1 filter) in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal\Models\LogEntryPagedViewModel.cs:line 161 at PowerShellProTools.UniversalDashboard.Controllers.LoggingController.Get(LogEntryPagedViewModel viewModel) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Controllers\LoggingController.cs:line 82 at lambda_method3598(Closure, Object, Object[]) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- 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 --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_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 --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) 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.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at PowerShellUniversal.FeatureMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Middleware\FeatureMiddleware.cs:line 43 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at PowerShellUniversal.DisallowedModeMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Middleware\ModeMiddleware.cs:line 47 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at PowerShellUniversal.CspMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Middleware\CspMiddleware.cs:line 21 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 197 at PowerShellUniversal.PSUMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Middleware\PowerShellMiddleware.cs:line 44 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Universal.Server.Middleware.SwaggerAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Middleware\SwaggerAuthMiddleware.cs:line 28 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at AspNetCoreRateLimit.RateLimitMiddleware1.Invoke(HttpContext context) in C:\actions-runner_work\universal\universal\src\AspNetCoreRateLimit\Middleware\RateLimitMiddleware.cs:line 110
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
2024-04-15 16:14:28.952 +00:00 [INF] Request finished HTTP/1.1 GET https://skycloud.ips.stage.inforcloudsuite.com/api/v1/logging/log?skip=0&take=1000&orderBy=timestamp&orderDirection=0&level=&scope=User&feature=App&message=&resource=SkyCloud&nodeName=&timezone=America%2FNew_York - - - 500 - text/plain 14.6353ms
2024-04-15 16:14:29.377 +00:00 [INF] Request starting HTTP/1.1 GET Sign in to your account - -
2024-04-15 16:14:29.380 +00:00 [INF] Executing endpoint ‘UniversalDashboard.Controllers.SessionController.Index (Universal.Server)’
2024-04-15 16:14:29.380 +00:00 [INF] Route matched with {action = “Index”, controller = “Session”}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index(System.String) on controller UniversalDashboard.Controllers.SessionController (Universal.Server).
2024-04-15 16:14:29.381 +00:00 [INF] Executing StatusCodeResult, setting HTTP status code 200
2024-04-15 16:14:29.381 +00:00 [INF] Executed action UniversalDashboard.Controllers.SessionController.Index (Universal.Server) in 1.164ms
2024-04-15 16:14:29.381 +00:00 [INF] Executed endpoint ‘UniversalDashboard.Controllers.SessionController.Index (Universal.Server)’
2024-04-15 16:14:29.382 +00:00 [INF] Request finished HTTP/1.1 GET Sign in to your account - - - 200 - - 4.2004ms
2024-04-15 16:14:30.017 +00:00 [INF] Request starting HTTP/1.1 GET https://skycloud.ips.stage.inforcloudsuite.com/api/v1/logging/log?skip=0&take=1000&orderBy=timestamp&orderDirection=0&level=&scope=User&feature=App&message=&resource=SkyCloud&nodeName=&timezone=America%2FNew_York - -
2024-04-15 16:14:30.020 +00:00 [INF] Executing endpoint ‘PowerShellProTools.UniversalDashboard.Controllers.LoggingController.Get (Universal.Server)’
2024-04-15 16:14:30.020 +00:00 [INF] Route matched with {action = “Get”, controller = “Logging”}. Executing controller action with signature Microsoft.AspNetCore.Mvc.IActionResult Get(UniversalAutomation.ViewModels.LogEntryPagedViewModel) on controller PowerShellProTools.UniversalDashboard.Controllers.LoggingController (Universal.Server).
2024-04-15 16:14:30.022 +00:00 [INF] Executing JsonResult, writing value of type ‘UniversalAutomation.ViewModels.LogEntryPagedViewModel’.
2024-04-15 16:14:30.027 +00:00 [INF] Executed action PowerShellProTools.UniversalDashboard.Controllers.LoggingController.Get (Universal.Server) in 7.399ms
2024-04-15 16:14:30.027 +00:00 [INF] Executed endpoint ‘PowerShellProTools.UniversalDashboard.Controllers.LoggingController.Get (Universal.Server)’
2024-04-15 16:14:30.028 +00:00 [INF] Request finished HTTP/1.1 GET

Interesting. My upgrade of the MSI version, from 4.2.17 to 4.2.18, went seamless and I have no errors at all. What version did you upgrade from, and what type of install are you running?

i found the problem is with $Cache
i have an endpoint to collect servers names and everything is working fine on 4.2.17 but with 4.2.18 it seems that $Cache:computernames is an empty string now and thats why i have no data in my table

am using PSU with IIS

1 Like

Did your endpoint collect the data since updating? When PSU is restarted the cache is also cleared, so if you don’t populate the cache at startup it will remain empty until populated.

Joblog working again. And scripts producing a lot of output run twice as fast!

Adam confirmed the issue that sceduled endpoints are not running correctly and a fix has been already added to 4.2.19.

1 Like