ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.38k stars 1.64k forks source link

Ocelot API Gateway: Intermittent 'Failed to Load API Definition' When Idle #2189

Closed robbypranata010118 closed 6 days ago

robbypranata010118 commented 6 days ago

I am developing an application using

I’m actually not sure where this issue originates – whether it’s from Ocelot, Consul, or the web API that I created. The issue I’m facing is that sometimes Ocelot's Swagger responds with "failed to load API definition," even though when I check in Consul, the web API service is still registered and in a healthy status. I’ve also checked, and the web API can be accessed directly if I go to the downstream address. I suspect this issue happens when the application is idle for a certain period without any access. So far, my workaround has been to restart the web API service to get it working again.

(FYI, my web API is deployed on IIS, and I’ve set the idle timeout to 0.)

Has anyone else experienced this, and how did you handle this issue?

Screenshot 2024-11-06 at 23 49 12
raman-m commented 6 days ago

Robby, officially Ocelot team doesn't support any Swagger features. Your question will be converted to a discussion...