question

TobyMilne-9644 avatar image
0 Votes"
TobyMilne-9644 asked

API Management - Gateway getting 400 bad request, then 429 Throttling Errors fetching configuration

Hi,
We have some APIM Gateways hosted on prem, which are getting errors when they periodically fetch their config from the control plane.
It starts with a number of 400 error codes, but then as the gateway re-requests every second, soon Azure starts to reply with 429 (Throttled) errors.

It looks like the gateway is set up to try every second for config on an error, which seems to be too fast for Azure, could the retry implement a slower back off (it looks like you are using the Polly library so that supports progressively longer back offs)?

We are running the gateways via docker - image currently in use is mcr.microsoft.com/azure-api-management/gateway@sha256:7ca80c8314e192c440e6453fb7f18fb3e4dd893ab9e8741487ca5d5bb10d8b2a

400 errors look like this:
[Error]2021-09-2T08:59:28.750 [Error], exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Gateway.Host.AspNetCore.ExternalConfiguration.ServiceConfigurationSource.HandleConfigurationError(HttpResponseMessage response) in D:\a\1\s\Proxy\Gateway.Host.AspNetCore\ExternalConfiguration\ServiceConfigurationSource.cs:line 212
at Gateway.Host.AspNetCore.ExternalConfiguration.ServiceConfigurationSource.<>c_DisplayClass19_0.<<UpdateConfiguration>b_1>d.MoveNext() in D:\a\1\s\Proxy\Gateway.Host.AspNetCore\ExternalConfiguration\ServiceConfigurationSource.cs:line 179
--- End of stack trace from previous location where exception was thrown ---
at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext), source: ServiceConfigurationSource



429 errors look like this:
[Error], exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 429 ().
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Gateway.Host.AspNetCore.ExternalConfiguration.ServiceConfigurationSource.HandleConfigurationError(HttpResponseMessage response) in D:\a\1\s\Proxy\Gateway.Host.AspNetCore\ExternalConfiguration\ServiceConfigurationSource.cs:line 212
at Gateway.Host.AspNetCore.ExternalConfiguration.ServiceConfigurationSource.<>c_DisplayClass19_0.<<UpdateConfiguration>b_1>d.MoveNext() in D:\a\1\s\Proxy\Gateway.Host.AspNetCore\ExternalConfiguration\ServiceConfigurationSource.cs:line 179
--- End of stack trace from previous location where exception was thrown ---
at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext), source: ServiceConfigurationSource [0m



azure-api-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers