0

I have up and running Google App Engine instance on production and it's working fine. I wanted to create development environment for coding and testing because needed softwares (ex. SDK) cannot be install locally on my computer. So I create to Google Cloud a Virtual Machine (VM, Debian 10) and checked in my code from App Engine to VM.

Dev App Server seems to work ok.
Dev App Server log shows that it's working Dev App Server log shows that it's working

I can start Dev App Server (using port 8080) on VM but when I try to reached it, browser says "This site can’t be reached". I use VM's external IP address (it's ephemeral, which means that it's not static ip address).

Firewall rules should be ok.(port 8080). Below is some of the rules.

Firewall setup:
Firewall setup

I installed apache2 on the VM and tried to reached index page (port 80) -> works fine!

My question is:
Why I cannot reach my dev app server which is using port 8080?
Is it because of port rules?
Something else, what?

Gryu
  • 2,102
  • 2
  • 16
  • 29
  • I think that I got a solution. My app dev server is listening only localhost, so I have to change it to have an access from internet. https://cloud.google.com/appengine/docs/standard/java/tools/using-local-server#command-line-arguments – Inkwon Hwang Jul 08 '20 at 08:29

1 Answers1

1

It says, that instance is running on localhost:8080. So maybe app is configured to listen not on 0.0.0.0:8080 but on localhost:8080.

In this case it could not be reached from any other network except localhost even if firewall allows access to it.

Use netstat -an to find out if there is 0.0.0.0:8080

You could also use telnet to test if port is open:

telnet someIP somePort

If not:

The development server command supports the following command-line arguments:

--address=...

The host address to use for the server. You might need to set this to be able to access the development server from another computer on your network. An address of 0.0.0.0 allows both localhost access and hostname access. Default: localhost.

Reference

Similar thread

If you use maven, then you could modify your pom.xml file the next way:

<plugins>
   <plugin>
     <groupId>com.google.cloud.tools</groupId>
     <artifactId>appengine-maven-plugin</artifactId>
     <version>2.2.0</version>
     <configuration>
       <devserver.host>0.0.0.0</devserver.host>
       <devserver.port>8080</devserver.port>
     </configuration>
  </plugin>
</plugins>

as described here and try to launch your project as usual

Gryu
  • 2,102
  • 2
  • 16
  • 29
  • Yep, you are right. Dev App Server is connected only localhost. Next question is that where I can setup so that it allows connection from internet. – Inkwon Hwang Jul 09 '20 at 08:41
  • @InkwonHwang Have you opened **Similar thread** link and read about usage examples? It depends on what you use. – Gryu Jul 09 '20 at 10:34
  • Thanks @Gryu for replying! Basically I need to know where I can put command line arguments --address=0.0.0.0 Normally arguments are used while using script ex. sh file. I'm using command mvn appengine:devserver Should is do? mvn appengine:devserver --address=0.0.0.0 – Inkwon Hwang Jul 09 '20 at 13:08