Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make InvalidHostServicesException a fatal error #2045

Closed
mathewc opened this issue Sep 15, 2021 · 0 comments
Closed

Make InvalidHostServicesException a fatal error #2045

mathewc opened this issue Sep 15, 2021 · 0 comments

Comments

@mathewc
Copy link
Member

mathewc commented Sep 15, 2021

Make InvalidHostServicesException a fatal error on startupin v4. In v3 we only log an error.

Motivation

In Functions v3 DependencyValidator on startup analyzes registered services here and logs an error if things aren't as expected (i.e. missing expected services or unexpected services). Ideally that would have been a fatal error preventing the host from starting up but we couldn't introduce that breaking change in v3. As a compromise, we instead updated the CLI to fail in this case (code here). However the intent all along was to prevent host startup in these situations.

Impact

Over the last 7 days, there are 569 distinct apps that have missing or invalid services.

All("FunctionsLogs")
| where PreciseTimeStamp > ago(7d)
| where Level < 3
| where Source == "Microsoft.Azure.WebJobs.Script.WebHost.DependencyInjection.DependencyValidator"
| where Summary startswith "Invalid host services detected."
| project AppName, Summary, Details
| summarize HasInvalid=countif(Details contains "[Invalid]") > 0, HasMissing=countif(Details contains "[Missing]") > 0 by AppName
| order by AppName asc

This query shows the types of errors we're seeing currently:

All("FunctionsLogs")
| where PreciseTimeStamp > ago(7d)
| where Level < 3
| where Source == "Microsoft.Azure.WebJobs.Script.WebHost.DependencyInjection.DependencyValidator"
| where Summary startswith "Invalid host services detected."
| project AppName, Details
| distinct Details

Compat-mode support

Because the intent is for this to be a hard error and prevent any hosts from running with invalid service configurations, we won't provide any way to disable this check.

Detection

Yes, we have existing logs showing details on invalid/missing services (see query above).

Support

Documentation

I don't believe we have any existing documentation on these service restrictions. We could add some.

Components impacted

Affects only the Host. We will be able to remove the special handling in the CLI however since it'll now be fatal by default.

Performance

None. This is already an existing check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants