The Gateway Is Either Offline Or Could Not Be Reached - Solved

Problem

 
If you are using on-premise gateway for your PowerBI reports or PowerApps, which helps in getting your on-premise data available in cloud applications. Then you must have encountered this error at some point "The gateway is either offline or could not be reached."
 
 
 

Solution

 
Let’s see how to fix this issue.
 
I have found two different solutions depending on the cause of the issue.
 
First Solution
 
If the system drives of server or computer where the Gateway is installed is full, gateway will stop working. So, the solution in this scenario is - you need to clean up the unwanted data and make some space in system drive.
 
Second Solution
 
Open services windows start menu OR type services.msc in Run command
 
 
Look for the service "On-premises data gateway service"
 
 
 
Select it and Restart the service
 
 
Once the service is restarted successfully, go back to your Power BI web service >> manage gateways >> Click on "Test all Connections" >> Your issue should be fixed now.
 
 
 
Last Solution
 
If the above two solutions didn't work for then you need to download the latest version of the gateway and install it on your server.
 
Hope this helps.