ANCM is not stable after upgrading to .net 9 #59107
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
feature-iis
Includes: IIS, ANCM
Is there an existing issue for this?
Describe the bug
Since upgrading to .net 9, all existing core app start to get "HTTP Error 503.0 - Service Unavailable" in shared application pool frequently, no matter inprocess or outofprocess mode. Looks like the core apps are impacted by each other.
Expected Behavior
The problem can be fixed if manually change ANCM in "C:\Program Files\IIS\Asp.Net Core Module\V2" from v19.0.24303 to v18.0.24081. So, something is changed in new ANCM and caused the issue.
Steps To Reproduce
Install the dotnet-hosting-9.0.0-win.exe on a Windows Server 2022 machine.
Create Sites in IIS
Create two sites in IIS:
site2 (a working Core application)
site3 (which will contain a test configuration)
Ensure both sites use the same application pool.
Configure Site3
For site3, add a web.config file with the following test data:
Test Site2 and Site3
Visit site2 first; it should work as expected (Core app is running).
Visit site3 next, and you will see the expected error:
"Parser Error Message: The 'tempDirectory' attribute must be set to a valid absolute path."
Revisit Site2
After encountering the error on site3, visit site2 again. You should see the following error:
"HTTP Error 503.0 - Service Unavailable"
Inspect the debug logs for any relevant details. You may find that ANCM is continuously monitoring changes in the application pool. For example:
[aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::OnGlobalConfigurationChange 'MACHINE/WEBROOT/APPHOST/test-114-SITE3'
Exceptions (if any)
[2024-11-22T13:04:18.446Z, PID: 10040] [aspnetcorev2_outofprocess.dll] FORWARDING_HANDLER::OnAsyncCompletion Done 1
[2024-11-22T13:04:18.459Z, PID: 10040] [aspnetcorev2_outofprocess.dll] FORWARDING_HANDLER::OnAsyncCompletion Done 0
[2024-11-22T13:04:18.472Z, PID: 10040] [aspnetcorev2_outofprocess.dll] FORWARDING_HANDLER::~FORWARDING_HANDLER
[2024-11-22T13:04:28.243Z, PID: 10040] [aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::OnGlobalConfigurationChange 'MACHINE/WEBROOT/APPHOST/test-114-SITE3'
[2024-11-22T13:04:28.244Z, PID: 10040] [aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::OnGlobalApplicationStop
[2024-11-22T13:04:28.256Z, PID: 10040] [aspnetcorev2.dll] Shutdown starting in 5000 ms.
[2024-11-22T13:04:33.263Z, PID: 10040] [aspnetcorev2.dll] Shutdown starting.
[2024-11-22T13:04:33.270Z, PID: 10040] [aspnetcorev2.dll] Stopping application '/LM/W3SVC/1120488701/ROOT'
[2024-11-22T13:04:33.276Z, PID: 10040] [aspnetcorev2_outofprocess.dll] Stopping file watching.
[2024-11-22T13:04:33.282Z, PID: 10040] [aspnetcorev2_outofprocess.dll] Waiting for file watcher thread to exit.
[2024-11-22T13:04:33.282Z, PID: 10040] [aspnetcorev2_outofprocess.dll] Stopping file watcher thread
[2024-11-22T13:04:33.295Z, PID: 10040] [aspnetcorev2_outofprocess.dll] Waiting for file watcher thread to exit.
[2024-11-22T13:04:33.305Z, PID: 10040] [aspnetcorev2_outofprocess.dll] Event Log: 'Sent shutdown HTTP message to process with Id '10204' and received http status '202'.'
End Event Log Message.
[2024-11-22T13:04:33.332Z, PID: 10040] [aspnetcorev2_outofprocess.dll] Event Log: 'Application '/LM/W3SVC/1120488701/ROOT' with physical root 'h:\root\home\test-114\www\site2' shut down process with Id '10204' listening on port '30915''
End Event Log Message.
[2024-11-22T13:04:34.144Z, PID: 10040] [aspnetcorev2.dll] Received a request during shutdown. Will return a 503 response.
[2024-11-22T13:04:34.154Z, PID: 10040] [aspnetcorev2.dll] Failed HRESULT returned: 0x800704e7 at D:\a_work\1\s\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\proxymodule.cpp:97
[2024-11-22T13:04:34.161Z, PID: 10040] [aspnetcorev2.dll] Failed HRESULT returned: 0x800704e7 at D:\a_work\1\s\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\proxymodule.cpp:121
[2024-11-22T13:04:34.270Z, PID: 10040] [aspnetcorev2.dll] Received a request during shutdown. Will return a 503 response.
[2024-11-22T13:04:34.299Z, PID: 10040] [aspnetcorev2.dll] Failed HRESULT returned: 0x800704e7 at D:\a_work\1\s\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\proxymodule.cpp:97
[2024-11-22T13:04:34.323Z, PID: 10040] [aspnetcorev2.dll] Failed HRESULT returned: 0x800704e7 at D:\a_work\1\s\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\proxymodule.cpp:121
.NET Version
.net 9
Anything else?
No response
The text was updated successfully, but these errors were encountered: