What does error 504 mean
Error 504 (Gateway Timeout) is a standard HTTP status that means a gateway server (such as a proxy server, load balancer, or CDN) did not receive a timely response from an upstream server (usually an application or database server) it was trying to reach. On an Android device, this error is typically displayed in a browser (Chrome, Firefox, etc.) or in other apps that use web requests (social networks, messengers).
You will see a message similar to:
504 Gateway TimeoutERR_HTTP2_PROTOCOL_ERRORServer not responding(in the interface translation)
The error is not a problem with your Android device itself. It is a signal of a failure in the connection chain between your device and the final server you are trying to reach.
Causes
- Problems on the server or provider side: The final server (website or API) is overloaded, frozen, or not responding. The intermediate gateway (often from your internet provider or the website owner) waits for a response for too long and cancels the request.
- Unstable or slow internet connection: The network has high ping (latency) or packet loss. The request from your device reaches the gateway, but the server's response does not fit within the gateway's allotted time (usually 30-60 seconds).
- Blocking by antivirus, firewall, or VPN: Security software or VPN services may redirect or analyze your traffic, creating additional delay, causing the total request time to exceed the limit.
- Corrupted browser or app cache: Local app data may contain invalid sessions or cookies, causing infinite redirects or stuck requests.
- Incorrect network settings on the device: Incorrectly specified APNs (for mobile internet), a configured system proxy, or DNS issues can disrupt the normal request route.
- Temporary failures with your carrier: Especially relevant for mobile networks (4G/5G) under high load or at coverage zone borders.
Solutions
Method 1: Basic Reboot and Network Switch
This is the first and mandatory step, which resolves most temporary glitches.
- Restart your Android device. Power it off completely, wait 30 seconds, and turn it back on. This clears RAM and temporary network buffers.
- If using Wi-Fi:
- Reboot your router (unplug it from power for 30 seconds).
- On your device, "forget" the network (
Settings→Wi-Fi→ tap the network →Forget this network) and reconnect by entering the password.
- Try switching to mobile data (4G/5G) if the error occurred on Wi-Fi, and vice versa. This quickly determines whether the problem is with that specific network or with general internet access on the device.
Method 2: Check and Disable Third-Party Software
Temporarily disable programs that affect traffic.
- Disable the VPN service if active. Completely close the VPN app.
- Temporarily disable antivirus or firewall (if a third-party one is installed, not the system one). Check if the error disappears.
- Check Wi-Fi settings: Go to
Settings→Wi-Fi→ tap the gear icon next to the connected network →Advanced settingsorProxy. Ensure the proxy mode is set toNoneorOff.
Method 3: Clear App Cache and Data
If the error occurs only in one app (e.g., Chrome or a specific client).
- Go to
Settings→Apps→Manage apps. - Find the problematic app (e.g.,
Chrome) and open its page. - Tap
Memory(orStorage). - First, tap
Clear cache. This is safe and will not delete your personal data (logins, history). - If that didn't help, tap
Clear data(orClear storage). Warning: this will delete all app data (logins, settings, history). For a browser, you will need to log in to sites again. - Restart the app and try again.
Method 4: Reset Device Network Settings
A radical but often effective method that returns all network parameters to factory defaults.
⚠️ Important: This step will delete all saved Wi-Fi networks and passwords, as well as all paired Bluetooth devices. You will need to set them up again.
- Open
Settings→System(orGeneral settings). - Find and select
Reset(orReset & recovery). - Tap
Reset Wi-Fi, mobile network, and Bluetooth settings(the name may vary slightly depending on the shell:Network settings reset). - Confirm the action. The device will reboot.
- After reboot, set up Wi-Fi or mobile data again.
Method 5: Check and Configure APN (for Mobile Internet)
If the problem occurs only when using mobile data (not on Wi-Fi).
- Go to
Settings→Network & internet→Mobile network. - Find the
Access Point Names(APN) orAPNitem. - Tap the three dots in the top right corner and select
Reset to default. This restores the correct APNs from your carrier (if they are preinstalled in the firmware). - If resetting didn't help or the APN list is empty, contact your carrier's support (MTS, Beeline, MegaFon, Tele2, etc.) and ask them to send APN settings for your tariff plan. Usually this is an SMS or a link for automatic configuration.
- Ensure that in the selected APN, the
ProxyandPortfields are empty (unless your carrier uses a proxy).
Method 6: Change DNS
Sometimes the problem is caused by your provider's DNS server.
- When connected to Wi-Fi: go to
Settings→Wi-Fi, tap the gear icon for the network. - Find
Advanced settings→IP settings(orDNS). Switch fromDHCPtoStatic. - In the
DNS 1field, enter8.8.8.8(Google DNS), inDNS 2—8.8.4.4. Save and reconnect. - For mobile data, changing DNS usually requires root access or apps like
DNS Changer. Without them, Method 4 (network settings reset) is simpler.
Prevention
- Regularly update your system and apps. Updates often contain fixes for network stacks and security.
- Avoid unreliable VPN services. Use reputable providers that do not cause excessive delays.
- Monitor your SIM card condition. If it is physically damaged or oxidized, it can cause connection drops. Clean the contacts with alcohol if necessary.
- For Wi-Fi: keep your router firmware up to date, avoid overloading it with too many devices, and choose a less congested channel (using an app like Wi-Fi Analyzer).
- Periodically clear your browser cache, especially if you frequently visit different sites.
What to do if nothing helped?
If you have systematically completed all the steps and error 504 appears on a specific website or in a specific app, then the problem is most likely on their servers. In this case:
- Try accessing that site/service from another device (e.g., a computer) and from a different network (e.g., mobile internet on a phone). If the error repeats — the problem is with the resource owner.
- Wait for the administrators to fix the outage. Usually, such problems are temporary.
- If the problem is global (the internet does not work on any site or in any app, with any type of network), and rebooting the router and resetting network settings did not help, then most likely the issue is with your internet provider (for Wi-Fi) or mobile carrier (for mobile data). Contact their technical support.