Release: 2.0.9.106 (Canary) 2024-09-03

2.0.9.107 is out, but before that, I got 2.0.9.106 Connection lost (with some logs) not at wake.

A tab got 401 Unauthorized to a refresh with a RefreshToken_8200 from a seemingly closed tab.

The set which I can't find in the two tabs with logging, so might be closed:

POST /api/v1/auth/refresh HTTP/1.1
Host: localhost:8200
Connection: keep-alive
Content-Length: 0
sec-ch-ua: "Not)A;Brand";v="99", "Microsoft Edge";v="127", "Chromium";v="127"
Accept: application/json, text/plain, */*
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
sec-ch-ua-platform: "Windows"
Origin: http://localhost:8200
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:8200/ngax/index.html
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie:
...

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 10 Sep 2024 11:40:30 GMT
Server: Kestrel
Set-Cookie: RefreshToken_8200=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXAiOiJSZWZyZXNoVG9rZW4iLCJzaWQiOiJ3ZWJzZXJ2ZXIiLCJmYW0iOiJEQ0VGODlCQzM5MTMwODE5IiwiY250IjoiMjE1IiwiaWF0IjoiLTE3MjU5Njg0MzEuMTc3Njk0IiwibmJmIjoxNzI1OTY4NDMxLCJleHAiOjE3Mjg1NjA0MzEsImlzcyI6Imh0dHBzOi8vZHVwbGljYXRpIiwiYXVkIjoiaHR0cHM6Ly9kdXBsaWNhdGkifQ.Jn3IubMLqUgyvqnl135zC2A_YdZ-H9-8wNGPI_xptWI; expires=Thu, 10 Oct 2024 11:40:31 GMT; domain=localhost; path=/api/v1/auth/refresh; samesite=strict; httponly
Transfer-Encoding: chunked

12b
{"AccessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXAiOiJBY2Nlc3NUb2tlbiIsInNpZCI6IndlYnNlcnZlciIsImZhbSI6IkRDRUY4OUJDMzkxMzA4MTkiLCJuYmYiOjE3MjU5Njg0MzEsImV4cCI6MTcyNTk2OTMzMSwiaXNzIjoiaHR0cHM6Ly9kdXBsaWNhdGkiLCJhdWQiOiJodHRwczovL2R1cGxpY2F0aSJ9.jCuNLe8gf1re9UQgTazLA9HuLWMBEAUumYTfChNIjiY"}
0

The use:

POST /api/v1/auth/refresh HTTP/1.1
Host: localhost:8200
Connection: keep-alive
Content-Length: 0
sec-ch-ua: "Not)A;Brand";v="99", "Microsoft Edge";v="127", "Chromium";v="127"
Accept: application/json, text/plain, */*
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
sec-ch-ua-platform: "Windows"
Origin: http://localhost:8200
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:8200/ngax/index.html
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: ...
RefreshToken_8200=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXAiOiJSZWZyZXNoVG9rZW4iLCJzaWQiOiJ3ZWJzZXJ2ZXIiLCJmYW0iOiJEQ0VGODlCQzM5MTMwODE5IiwiY250IjoiMjE1IiwiaWF0IjoiLTE3MjU5Njg0MzEuMTc3Njk0IiwibmJmIjoxNzI1OTY4NDMxLCJleHAiOjE3Mjg1NjA0MzEsImlzcyI6Imh0dHBzOi8vZHVwbGljYXRpIiwiYXVkIjoiaHR0cHM6Ly9kdXBsaWNhdGkifQ.Jn3IubMLqUgyvqnl135zC2A_YdZ-H9-8wNGPI_xptWI; default-theme=ngax

HTTP/1.1 401 Unauthorized
Content-Type: application/json
Date: Tue, 10 Sep 2024 13:09:25 GMT
Server: Kestrel
Cache-Control: no-cache,no-store
Expires: -1
Pragma: no-cache
Transfer-Encoding: chunked

{"Error":"Failed to refresh token","Code":401}

After playing around with the other tab with logging, which survived, I tried the Reload button on Duplicati’s blue Connection lost screen. This has sometimes worked before, and is less of a nuisance than the Log in button. It worked, but I wondered about how much tabs share a login.

Sharing is somewhat familiar from Internet web site logins, and it does seem that doing Log out from one tab logs out the other. It’s not always noticed, for example during a backup it makes the below, but the visual appearance is that the screen just stops updating without raising any errors:

image

and TrayIcon output (if one is making it visible)

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      Duplicati.WebserverCore.Exceptions.UnauthorizedException: Failed to refresh token
         at Duplicati.WebserverCore.Endpoints.V1.Auth.<>c.<<Map>b__3_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Http.RequestDelegateFactory.<TaskOfTToValueTaskOfObject>g__ExecuteAwaited|92_0[T](Task`1 task)
         at Duplicati.WebserverCore.Middlewares.HostnameFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
         at Duplicati.WebserverCore.Middlewares.LanguageFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
         at Microsoft.AspNetCore.Http.RequestDelegateFactory.<ExecuteValueTaskOfObject>g__ExecuteAwaited|129_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)
         at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.<>c__DisplayClass0_0.<<UseNotifications>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)