An invalid host.json
file in combination with a HostInitializationError
can cause an endless ScriptHost
restart loop
#10452
Labels
An invalid
host.json
file in combination with aHostInitializationError
can cause an endlessScriptHost
restart loop.We discovered this issue while addressing misconfigurations in applications during a recent release. #10439 reintroduced temporary support for the previous behavior, which reduces the frequency of this issue but doesn't fully resolve it. As this fallback is only temporary and will be removed, it is essential to address the root cause before the fallback behavior is disabled.
Conditions to reproduce
"version": "2.0",
'Did not find functions with language [dotnet-isolated].'
WebJobsScriptHostService.UnsynchronizedStartHostAsync
attempts:1. First attempt, on this one we try to load
host.json
as usualSince the
host.json
is invalid, we will throw aHostConfigurationException
trying to build the host:azure-functions-host/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs
Lines 338 to 347 in 6bccacf
2. On this next attempt, we will be handling the Host Configuration Error, skipping the step of parsing the
host.json
:We will be able to build the host:
azure-functions-host/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs
Lines 338 to 347 in 6bccacf
However, we won't be able to start the host and we will throw a
HostInitializationException
here:azure-functions-host/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs
Line 382 in 6bccacf
3. On this attempt we're handling an initialization error:
Now we will skip job host startup, but since the
host.json
is still invalid, we will throw aHostConfigurationException
again trying to build the host:azure-functions-host/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs
Lines 338 to 347 in 6bccacf
4. This attempt will be exactly as attempt 2
5. This attempt will be exactly as attempt 3
The text was updated successfully, but these errors were encountered: