HTTP
504 Gateway Timeout
What it means
A proxy in front of the site did not get a response from the server behind it in time. The front door waited, then gave up. The origin may still be working on the request, or it may be stuck.
Where you usually see it
Slow applications behind a proxy, large file operations, and servers that are up but not answering on the expected port.
What to try first
Retry once after a pause. If you were submitting a form, check later whether the action actually went through before you submit it again. If you run the site, look at origin logs, slow queries, and the proxy timeout.
When to stop
A 504 does not tell you that the work failed, only that the proxy stopped waiting. Double-submitting a payment or an application form can create a second copy.