PureDevOps Community

Heroku[router]: at=error code=H31 desc="Misdirected Request

Last week we were continuously facing this issue

Heroku[router]: at=error code=H31 desc=“Misdirected Request

on almost all of the dynos in our environment. Internally checked using heroku ps:exec command seems all our applications are working fine. Any clue what could be the issue ?

From heroku it seems to be a new error

We’ve added a new error code: H31 Misdirected Request. The error is emitted when Heroku receives a request for an app at the wrong endpoint (IP address). The client will receive a HTTP 421 Misdirected Request response. This can happen because the client is using stale DNS information, or the client is accessing the app through a CDN that has stale DNS information. Verify that DNS is correctly configured for your app. If a CDN is configured for the app, consider contacting your CDN provider.

As this seems to be mostly on DNS we checked whats going wrong and understood that there is a heroku addon “heroku SSL Endopont” is deprecated and causing DNS issue for some of the application.

The solution is to update the heroku dns name for each app directly to the DNS Providers like Cloudflare or other sources