Browser cookie corruption(?) after site migration on Azure

AI-generated summary

Simon_Miller reported a browser cookie corruption issue after migrating a Discourse platform from Vultur to Azure on CentOS, resulting in a 500 error on /latest.json and incorrect locale display in settings. The problem, observed in Windows Chrome but not Edge or Chrome Android, was linked to an error in the logs involving invalid IP address syntax: 106.70.36.109:6082. Falco pointed to a known Azure bug with workarounds discussed in a related thread here. Justin_Vega asked for clarification on Edge version. Simon_Miller later confirmed the issue stemmed from the Application Gateway sending internal IPs instead of user IPs, which triggered Nginx’s flood protection; updating the Nginx configuration resolved the problem solution.

Hello,

I have migrated a Discourse platform from Vultur host to Azure, within a CentOS linux flavour. The migration went smoothly, using the built in database backup and restore process. We then delegated the DNS.

Some users (including myself at one point) are getting the sad face 500 error loading /latest.json. In all instances, clearing your cookies/sessions fixes the problem.. but it appears to come back after half an hour or so.

I was also as an admin able to see during the error in my Settings section that the key-value pairs for the various settings labels were not parsed to a language locale e.g. “default locale” was displayed as something like “[en.default_locale]”.

I am not a Linux or Discourse guru so have no idea where to go with this issue. It may be things “settling down” after DNS migration, or there could be something more going on.

The problem so far has only been reported on Windows Chrome. I cannot reproduce on Edge or Chrome Android.

Looking in the /logs I see entries such as the following:

Job exception: PG::InvalidTextRepresentation: ERROR:  invalid input syntax for type inet:"106.70.36.109:6082" LINE 1: UPDATE "users" SET "ip_address" = '106.70.36.109:6082' WHERE...

Any advice would be appreciated.

Simon

That is a well know Azure bug with some workarounds described here

Chromium Edge or Legacy Edge?

We came to this conclusion as well, and it was the case. The Appgw was sending its internal IPs instead of user IPs and presumably Nginx’ flood protection was kicking in. Updating Nginx configs solved the issue.