Azure / Azure/azure-event-grid

Azure EventGrid: Webhook validation callback receives InternalServerError when stale

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
3
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Internal Server Error with stale validations

According to the [StackOverflow](https://stackoverflow.com/questions/77594081/azure-eventgrid-webhook-validation-callback-receives-internalservererror-when-s) User - James World have acknowledged the validation OPTIONS request with a 200 response containing no headers. This is in order to use a manual callback with the URL contained in the WebHook-Request-Callback header.
The subscription, as expected, then reports a provisioningState of AwaitingManualAction
After approximately 10 minutes the subscription silently disappears.
When he make a request to the validation endpoint it fails with:

```csharp
{
"error": {
"code": "InternalServerError",
"message": "The operation failed due to an internal server error. The initial state of the impacted resources (if any) are restored. Please try again in few minutes. If error still persists, report : (UTC) to our forums for assistance or raise a support ticket ."
}
}
```
Note that using an invalid URL (such as manipulating the GUID) results in a 400 error, and revalidating an already validated subscription is a 2xx.

Clearly we need to validate promptly to activate the subscription - he has no issue with that; but occasionally unavoidable delays happen and we need to handle them cleanly. Also, whilst we know we can immediately respond with headers to validate, sometimes we want to go the callback route.

This 500 response seems like a quite specific bug to him. He can understand EventGrid not wanting to track a subscription awaiting validation forever - but a 404 would surely be a better response here than a 500?

The behaviour of unvalidated subscriptions disappearing after 10 minutes is not specified in the [Cloud Event Standard](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection); clearly this is an Azure Event Grid decision.

However, [Event Grid's own documentation](https://learn.microsoft.com/en-us/azure/event-grid/webhook-event-delivery#endpoint-validation-with-cloudevents-v10) is vague and could be improved. [Asynchronous validation under the Event Grid Schema](https://learn.microsoft.com/en-us/azure/event-grid/webhook-event-delivery#endpoint-validation-with-event-grid-events) by contrast is specified as having a 5 minute timeout and then transitioning to a provisioningStatus of failed. It's weird that Cloud Event Schema subscriptions just disappear - why not have the same behaviour? It would provide a better user experience.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked Event Grid documentation for CloudEvents endpoint validation and compare it with the documented Event Grid Schema timeout behavior and the CloudEvents webhook standard. Reproduce the delayed manual-callback flow, including the 10-minute disappearance and subsequent validation response, then define whether the issue is resolved by corrected service behavior or clearer documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, documentation
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.