Azure / Azure/azure-functions-host

Empty triggers sync after 'D:\home\site\wwwroot\host.json' reading error

Open
#6,822 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

#### Investigative information

- Timestamp: 2020-09-30 07:51:48.6859060
- Function App version:
- Function App name: [not sharing]
- Function name(s) (as appropriate): [not sharing]
- Invocation ID: N/A
- Region: [not sharing]

The App name etc. can be identified from this query:
```
cluster('wawsweu.kusto.windows.net').database('wawsprod').FunctionsLogs
| where TIMESTAMP > datetime(2020-09-30 07:50) and TIMESTAMP < datetime(2020-09-30 09:05)
| where Summary has '8bd87703-806d-41ea-a471-c9cc6652ad7f'
```

#### Repro steps

The issue is intermittent and rare, no reliable repro steps.

An app using Service Bus trigger worked correctly until a Functions host failed to read host.json (apparently because of transient file system availability issues): `System.IO.IOException : The network path was not found. : 'D:\home\site\wwwroot\host.json'`

The host restarted and retried multiple times. Suddenly, it sent SyncTriggers with an empty lists of triggers and functions:
```
Making SyncTriggers request (RequestId=8bd87703-806d-41ea-a471-c9cc6652ad7f, Uri=https://[removed app name].azurewebsites.net/operations/settriggers, Content={
"triggers": [],
"functions": []
}).
```
This sync requests succeeded, and the app triggers stopped triggering. A few seconds later, the host loaded host.json successfully, but did not send SyncTriggers anymore. Eventually, another Functions host started on a different instance, loaded host.json successfully, and synced triggers properly, so the app self-recovered. However, there was a long period of time (more than 1 hour) when triggers were not triggering.

#### Expected behavior

On 'D:\home\site\wwwroot\host.json' reading error, the host is expected to keep retrying, but not erasing the existing triggers.

#### Actual behavior

The host sent SyncTriggers with an empty lists of triggers and functions.

#### Known workarounds

None

Contributor guide

Open the contributing guide

Research direction

Start by tracing the host.json loading path and the SyncTriggers request to /operations/settriggers. The issue provides no repository source files or reliable reproduction steps; done means a host.json read failure does not send an empty trigger list, while later successful loading still preserves or restores existing triggers.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.