Constant errors in log MS-ASPNETCORE-TOKEN

Product: PowerShell Universal
Version: 1.5.9

I keep seeing this in my logs:
[ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token '<GUID>' , request rejected. (8charstr)

An example block of errors:

2021-01-25T10:07:08.2300085-06:00 0HM61949LC8TU:00000001 [INF] Request starting HTTP/1.1 GET http://127.0.0.1:43324/api/v1/version   (ca22a1cb)
2021-01-25T10:07:08.2303224-06:00 0HM61949LC8TU:00000001 [ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'a0370706-f700-4187-8939-507939888b0d', request rejected. (0e2e79cb)
2021-01-25T10:07:08.2303931-06:00 0HM61949LC8TU:00000001 [INF] Request finished in 0.4091ms 400  (791a596a)
2021-01-25T10:07:08.2549209-06:00 0HM61949LC8TU:00000002 [INF] Request starting HTTP/1.1 GET http://127.0.0.1:43324/api/v1/version   (ca22a1cb)
2021-01-25T10:07:08.2552610-06:00 0HM61949LC8TU:00000002 [ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'a0370706-f700-4187-8939-507939888b0d', request rejected. (0e2e79cb)
2021-01-25T10:07:08.2553450-06:00 0HM61949LC8TU:00000002 [INF] Request finished in 0.4408ms 400  (791a596a)
2021-01-25T10:07:08.2652160-06:00 0HM61949LC8TU:00000003 [INF] Request starting HTTP/1.1 GET http://127.0.0.1:43324/api/v1/Job/2684   (ca22a1cb)
2021-01-25T10:07:08.2655242-06:00 0HM61949LC8TU:00000003 [ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'a0370706-f700-4187-8939-507939888b0d', request rejected. (0e2e79cb)
2021-01-25T10:07:08.2655898-06:00 0HM61949LC8TU:00000003 [INF] Request finished in 0.3962ms 400  (791a596a)
2021-01-25T10:07:08.3026614-06:00 0HM61949LC8TU:00000004 [INF] Request starting HTTP/1.1 GET http://127.0.0.1:43324/api/v1/version   (ca22a1cb)
2021-01-25T10:07:08.3030464-06:00 0HM61949LC8TU:00000004 [ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'a0370706-f700-4187-8939-507939888b0d', request rejected. (0e2e79cb)
2021-01-25T10:07:08.3031315-06:00 0HM61949LC8TU:00000004 [INF] Request finished in 0.4973ms 400  (791a596a)
2021-01-25T10:07:08.3067162-06:00 0HM61949LC8TU:00000005 [INF] Request starting HTTP/1.1 GET http://127.0.0.1:43324/api/v1/Script/1   (ca22a1cb)
2021-01-25T10:07:08.3070237-06:00 0HM61949LC8TU:00000005 [ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'a0370706-f700-4187-8939-507939888b0d', request rejected. (0e2e79cb)
2021-01-25T10:07:08.3071065-06:00 0HM61949LC8TU:00000005 [INF] Request finished in 0.4049ms 400  (791a596a)
2021-01-25T10:07:08.3229943-06:00 0HM61949LC8TU:00000006 [INF] Request starting HTTP/1.1 GET http://127.0.0.1:43324/api/v1/version   (ca22a1cb)
2021-01-25T10:07:08.3233761-06:00 0HM61949LC8TU:00000006 [ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'a0370706-f700-4187-8939-507939888b0d', request rejected. (0e2e79cb)
2021-01-25T10:07:08.3234670-06:00 0HM61949LC8TU:00000006 [INF] Request finished in 0.4968ms 400  (791a596a)
2021-01-25T10:07:08.3261500-06:00 0HM61949LC8TU:00000007 [INF] Request starting HTTP/1.1 GET http://127.0.0.1:43324/api/v1/Schedule/1   (ca22a1cb)
2021-01-25T10:07:08.3264363-06:00 0HM61949LC8TU:00000007 [ERR] 'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'a0370706-f700-4187-8939-507939888b0d', request rejected. (0e2e79cb)

The only potentially relevant reference I could find to this error is: MS-ASPNETCORE-TOKEN error hosting an ASP.NET Core 2.0 Web API on IIS 8 · Issue #448 · aspnet/IISIntegration · GitHub
And I don’t know for sure if this is the same issue.

It doesn’t seem to be affecting functionality currently, but I’m also still not very far into building out this instance. Any thoughts? @adam?

Actually, it looks like this might have something to do with running OutOfProcess vs InProcess in an IIS Hosted Environment.

Try setting the ApiUrl in appsettings.json. I bet your jobs are trying to query the kestrel server rather than the IIS proxy.

The ApiUrl should the address of your IIS site.

Maybe the process hosting setting changes the auto url lookup behavior,

1 Like

Hmm, I’m not sure whether using that fixed anything. It seems to have resolved when doing so, but now the error is gone whether its there or not.

1 Like

I’m getting these errors as well. Just to be clear, if the URL to access the Admin Console is https://mydashbaords/admin. ApiURL should be https://mydashbaords/?

@adam I just want clarify, is this the correct appSettings order of precedence?

  1. Environment Variables
  2. ProgramData
  3. Installation Root

Note, I’m running in IIS.

Thats the correct order of precedence.

1 Like