Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

In Google Cloud, a Virtual Machine (VM) is a computing resource that emulates a physical computer within the cloud environment. It provides users with the ability to run applications and perform various computing tasks without the need for physical hardware.

In this blog post, I am going to share with you how you troubleshoot your server which is running on Google Cloud Virtual Machine.

Prerequisite – Create The Server Running On Google Cloud

I have a dedicated blog post where I have shown step-by-step approach to create your first server running on Google Cloud Virtual Machine. I highly recommend to go through that post to understand the basics first.

Here is the post

With that, let’s find out how to do the troubleshooting.

Connection Refused

If you are seeing a Connection Refused error, it is possible that:

  • You are trying to access the VM using an https address. Check that your URL is http://[EXTERNAL_IP] rather than https://[EXTERNAL_IP].
  • The VM instance does not have the proper tag that allows Compute Engine to apply the appropriate firewall rules to your instance. See Ensure that your VM instance has the correct tags below.
  • Your project does not have a firewall rule that allows traffic to the external IP address for your instance. See Ensure that the correct firewall rule exists below.

Make Sure Virtual Machine Has The Correct Tags

  1. In the Google Cloud console, go to the VM instances page.

  2. Click the name of the instance that you are trying to connect to.

  3. Click Edit at the top of the page.

  4. Scroll down to Firewalls and make sure that Allow HTTP traffic is checked. If it is not checked, check it.

  5. Save your changes. This ensures that the correct tags are added to the VM instance.

Make Sure Correct Firewall Rule Exists

  1. In the Google Cloud console, go to Firewall rules.
  2. Look for a firewall rule that allows all IP ranges through tcp:80. Usually, this rule is named the default-allow-http rule.

  3. If a rule does not exist, create one.

  4. Click Create firewall rule.

  5. Enter a name for the rule, such as default-allow-http.

  6. Under Source IP ranges, enter 0.0.0.0/0 to allow traffic from all sources.

  7. Under Protocols and ports, check Specified protocols and ports and enter tcp:80.

  8. Create your firewall rule.

  9. Test your server again by going to the external IP address of the instance.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *