Continuing the discussion from Authentication through API:
EDIT: I’m dumb, and the original topic was user error. however the Sign-out error is not.
@adam I know I’m looking at nightly builds here, and I’m looking to explore your new upload/download functionality in the API as to not have to use workarounds.
I am also experiencing completely blank pages (most of the time) when trying to load the dashboard. I’ve grabbed the console output if that helps:
Utils.js?7ed1:204 [2020-07-10T18:06:03.365Z] Information: Normalizing 'api/v1/notificationhub' to 'https://dummydomain.com/admin/api/v1/notificationhub'.
DevTools failed to load SourceMap: Could not load content for chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/sourcemaps/onloadwff.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
react-dom.production.min.js?2d14:209 TypeError: Cannot read property 'call' of undefined
at R (index.99ab4cea43725130ed92.bundle.js:1)
at t (index.99ab4cea43725130ed92.bundle.js:1)
Ci @ react-dom.production.min.js?2d14:209
Xi.c.callback @ react-dom.production.min.js?2d14:226
Cg @ react-dom.production.min.js?2d14:131
Ji @ react-dom.production.min.js?2d14:212
Sj @ react-dom.production.min.js?2d14:255
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
Jj @ react-dom.production.min.js?2d14:248
yj @ react-dom.production.min.js?2d14:239
eval @ react-dom.production.min.js?2d14:123
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
fg @ react-dom.production.min.js?2d14:123
X @ scheduler.production.min.js?fd35:17
H.port1.onmessage @ scheduler.production.min.js?fd35:14
scheduler.production.min.js?fd35:14 Uncaught TypeError: Cannot read property 'call' of undefined
at R (index.99ab4cea43725130ed92.bundle.js:1)
at t (index.99ab4cea43725130ed92.bundle.js:1)
R @ index.99ab4cea43725130ed92.bundle.js:1
t @ index.99ab4cea43725130ed92.bundle.js:1
I’m not sure what the deal is, but on some pages (/admin/api/v1 or v2) I get a mostly loaded dashboard with a constantly refreshing… whatever those “still loading content” artifacts are called…
The output from v1 is below:
DevTools failed to load SourceMap: Could not load content for chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/sourcemaps/onloadwff.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
Utils.js?7ed1:204 [2020-07-10T18:11:12.157Z] Information: Normalizing 'api/v1/notificationhub' to 'https://dummydomain.com/admin/api/v1/notificationhub'.
VM13291:1 GET https://dummydomain.com/api/v1/endpoint/v1 404 (Not Found)
(anonymous) @ VM13291:1
dispatchXhrRequest @ xhr.js?b50d:178
xhrAdapter @ xhr.js?b50d:12
dispatchRequest @ dispatchRequest.js?5270:52
Promise.then (async)
request @ Axios.js?0a06:61
Axios.<computed> @ Axios.js?0a06:76
wrap @ bind.js?1d2b:9
eval @ service.tsx?ecce:619
eval @ 468:14
__awaiter @ 468:10
getEndpoint @ service.tsx?ecce:619
loadData @ api.tsx?bfbf:22
eval @ api.tsx?bfbf:52
Ii @ react-dom.production.min.js?2d14:211
Vj @ react-dom.production.min.js?2d14:257
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
Dj @ react-dom.production.min.js?2d14:257
eval @ react-dom.production.min.js?2d14:256
X @ scheduler.production.min.js?fd35:17
H.port1.onmessage @ scheduler.production.min.js?fd35:14
react-dom.production.min.js?2d14:209 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=Error%3A%20Request%20failed%20with%20status%20code%20404&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at Qg (react-dom.production.min.js?2d14:139)
at eval (react-dom.production.min.js?2d14:149)
at R (react-dom.production.min.js?2d14:173)
at Rj (react-dom.production.min.js?2d14:265)
at Qj (react-dom.production.min.js?2d14:246)
at Kj (react-dom.production.min.js?2d14:246)
at yj (react-dom.production.min.js?2d14:239)
at eval (react-dom.production.min.js?2d14:123)
at exports.unstable_runWithPriority (scheduler.production.min.js?fd35:19)
at cg (react-dom.production.min.js?2d14:122)
Ci @ react-dom.production.min.js?2d14:209
Xi.c.callback @ react-dom.production.min.js?2d14:226
Cg @ react-dom.production.min.js?2d14:131
Ji @ react-dom.production.min.js?2d14:212
Sj @ react-dom.production.min.js?2d14:255
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
Jj @ react-dom.production.min.js?2d14:248
yj @ react-dom.production.min.js?2d14:239
eval @ react-dom.production.min.js?2d14:123
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
fg @ react-dom.production.min.js?2d14:123
gg @ react-dom.production.min.js?2d14:122
Nj @ react-dom.production.min.js?2d14:240
ik @ react-dom.production.min.js?2d14:284
exports.render @ react-dom.production.min.js?2d14:290
newNotificationInstance @ Notification.js?fc18:241
getMessageInstance @ index.js?b6ca:29
eval @ index.js?b6ca:72
notice @ index.js?b6ca:63
api.<computed> @ index.js?b6ca:158
eval @ api.tsx?bfbf:26
Promise.catch (async)
loadData @ api.tsx?bfbf:26
eval @ api.tsx?bfbf:52
Ii @ react-dom.production.min.js?2d14:211
Vj @ react-dom.production.min.js?2d14:257
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
Dj @ react-dom.production.min.js?2d14:257
eval @ react-dom.production.min.js?2d14:256
X @ scheduler.production.min.js?fd35:17
H.port1.onmessage @ scheduler.production.min.js?fd35:14
react-dom.production.min.js?2d14:139 Uncaught (in promise) Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=Error%3A%20Request%20failed%20with%20status%20code%20404&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at Qg (react-dom.production.min.js?2d14:139)
at eval (react-dom.production.min.js?2d14:149)
at R (react-dom.production.min.js?2d14:173)
at Rj (react-dom.production.min.js?2d14:265)
at Qj (react-dom.production.min.js?2d14:246)
at Kj (react-dom.production.min.js?2d14:246)
at yj (react-dom.production.min.js?2d14:239)
at eval (react-dom.production.min.js?2d14:123)
at exports.unstable_runWithPriority (scheduler.production.min.js?fd35:19)
at cg (react-dom.production.min.js?2d14:122)
Qg @ react-dom.production.min.js?2d14:139
eval @ react-dom.production.min.js?2d14:149
R @ react-dom.production.min.js?2d14:173
Rj @ react-dom.production.min.js?2d14:265
Qj @ react-dom.production.min.js?2d14:246
Kj @ react-dom.production.min.js?2d14:246
yj @ react-dom.production.min.js?2d14:239
eval @ react-dom.production.min.js?2d14:123
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
fg @ react-dom.production.min.js?2d14:123
gg @ react-dom.production.min.js?2d14:122
Nj @ react-dom.production.min.js?2d14:240
ik @ react-dom.production.min.js?2d14:284
exports.render @ react-dom.production.min.js?2d14:290
newNotificationInstance @ Notification.js?fc18:241
getMessageInstance @ index.js?b6ca:29
eval @ index.js?b6ca:72
notice @ index.js?b6ca:63
api.<computed> @ index.js?b6ca:158
eval @ api.tsx?bfbf:26
Promise.then (async)
result.then @ index.js?b6ca:93
XMLHttpRequest.send (async)
(anonymous) @ VM13291:1
dispatchXhrRequest @ xhr.js?b50d:178
xhrAdapter @ xhr.js?b50d:12
dispatchRequest @ dispatchRequest.js?5270:52
Promise.then (async)
request @ Axios.js?0a06:61
Axios.<computed> @ Axios.js?0a06:76
wrap @ bind.js?1d2b:9
eval @ service.tsx?ecce:619
eval @ 468:14
__awaiter @ 468:10
getEndpoint @ service.tsx?ecce:619
loadData @ api.tsx?bfbf:22
eval @ api.tsx?bfbf:52
Ii @ react-dom.production.min.js?2d14:211
Vj @ react-dom.production.min.js?2d14:257
exports.unstable_runWithPriority @ scheduler.production.min.js?fd35:19
cg @ react-dom.production.min.js?2d14:122
Dj @ react-dom.production.min.js?2d14:257
eval @ react-dom.production.min.js?2d14:256
X @ scheduler.production.min.js?fd35:17
H.port1.onmessage @ scheduler.production.min.js?fd35:14
The only obvious errors in the logs in ProgramData are related to Signing out, which I thought was interesting (I tried using the sign out button on the v1 or v2 page):
2020-07-10T13:23:22.2253467-05:00 0HM14VDFFVESE:0000000F [INF] Executing endpoint '"UniversalDashboard.Controllers.AuthenticationController.SignOut (Universal.Server)"' (500cc934)
2020-07-10T13:23:22.2255544-05:00 0HM14VDFFVESE:0000000F [INF] Route matched with "{action = \"SignOut\", controller = \"Authentication\"}". Executing controller action with signature "System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] SignOut()" on controller "UniversalDashboard.Controllers.AuthenticationController" ("Universal.Server"). (122b2fdf)
2020-07-10T13:23:22.2270377-05:00 0HM14VDFFVESE:0000000F [INF] Executed action "UniversalDashboard.Controllers.AuthenticationController.SignOut (Universal.Server)" in 1.3619ms (afa2e885)
2020-07-10T13:23:22.2272710-05:00 0HM14VDFFVESE:0000000F [INF] Executed endpoint '"UniversalDashboard.Controllers.AuthenticationController.SignOut (Universal.Server)"' (99874f2b)
2020-07-10T13:23:22.2336827-05:00 0HM14VDFFVESE:0000000F [ERR] An unhandled exception has occurred while executing the request. (48a46595)
System.InvalidOperationException: The authentication handler registered for scheme 'Windows' is 'AuthenticationHandler' which cannot be used for SignOutAsync. The registered sign-out schemes are: Cookies.
at Microsoft.AspNetCore.Authentication.AuthenticationService.SignOutAsync(HttpContext context, String scheme, AuthenticationProperties properties)
at UniversalDashboard.Controllers.AuthenticationController.SignOut() in E:\src\universal\src\Universal.Server\Controllers\AuthenticationController.cs:line 126
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.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 E:\src\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)
I saw nothing pressing in the IIS logs aside from a 404 when hitting api/v2 and a couple of 400 errors when I was fooling around trying to see if I could get it to work.
I made sure to unblock all the files in the directory, and the only files I kept from the previous version (aside from those in ProgramData\UniversalAutomation\Repository.universal) were appsettings.json and web.config. I even went so far as to delete the folders in ProgramData for good measure - no bones.