DuendeSoftware / Support

Support for Duende Software products
21 stars 0 forks source link

Razor Pages result in a 404 Not Found response for debug builds #1491

Open AdeZwart opened 6 days ago

AdeZwart commented 6 days ago

Which version of Duende IdentityServer are you using? 6.2.5 6.3.10 7.0.8

Which version of .NET are you using? .net 6.0.36 .net 8.0.404

Describe the bug We use the Razor Pages in /Pages/Account. Somewhere in the last month those pages started to result in 404 Not Found responses when running a local debug build. When I run a release build locally the pages load with a regular 200 OK response. Thanks to this behavior it is only affecting our local development environments.

It only affects the razor pages, as the API endpoints and /.well-known/openid-configuration work as expected.

To Reproduce I have no clear idea what caused this and how to reproduce it other than running my solution.

Expected behavior The Razor Pages result in a 200 OK response for both debug and release builds.

Log output/exception with stacktrace

warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
      Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[62]
      User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
info: Duende.IdentityServer.Startup[0]
      Starting Duende IdentityServer version 6.3.10+269ca2171fe1e901c87f2f0797bbc7c230db87c6 (.NET 6.0.36)
info: Duende.License[0]
      You have a valid license key for the Duende software Enterprise edition for use at [redacted]. The license expires on [redacted].
info: Duende.IdentityServer.Startup[0]
      Using the default authentication scheme Identity.Application for IdentityServer
warn: Microsoft.AspNetCore.Server.Kestrel[0]
      Overriding address(es) 'http://+:80'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:80
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://[::]:443
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /app/
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://host.docker.internal:8001/ - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://host.docker.internal:8001/ - - - 404 0 - 647.6035ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://host.docker.internal:8001/account/login - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://host.docker.internal:8001/account/login - - - 404 0 - 760.8447ms

Additional context I've tried rolling back to v6.2.5 and pushing forward to v7 (and dotnet8) but the result remains the same.

RolandGuijt commented 1 day ago

To determine if this is an issue with IdentityServer, which I suspect it isn't, can you please try running a Razor pages application without IdentityServer in a docker container and see if you see the same behavior. If so, please repost this issue in the issue tracker for Razor pages.

Having said that, you can try the following: