0
votes

I have a dropwizard application. And a e2-small (2 vCPUs, 2 GB memory) memory. When I run the application passing necessary properties it run successfully without error.(log snippet at end of question)

My application is running on port 8080 and from my compute engine console(after connecting SSH) I do

curl http://0.0.0.0:8080

It returns me as expected. But I am not able to access this application from outside. I have External IP (needed that for cloud SQL too) , so I try to access the application as http://externalip:8080 it does not return me anything . Also curl http://externalip:8080 from compute engine console(after connecting SSH) does not return anything.

I have allowed http and https traffic in firewall section while creating compute engine instance.

I have set up my deployment pipeline(using third party tool) using same external ip and it successfully copies my artifacts to my compute engine. So I am sure the external ip is enabled.

Can you please help me understand what might be the issue?

INFO [2020-11-18 15:32:09,981] org.eclipse.jetty.server.handler.ContextHandler: Started i.d.j.MutableServletContextHandler@4850a747{/,null,AVAILABLE} INFO [2020-11-18 15:32:09,995] org.eclipse.jetty.server.AbstractConnector: Started application@50a0404b{HTTP/1.1,[http/1.1]}{0.0.0.0:8080} INFO [2020-11-18 15:32:09,997] org.eclipse.jetty.server.AbstractConnector: Started application@e328d88{HTTP/1.1,[http/1.1]}{0.0.0.0:8443} INFO [2020-11-18 15:32:09,998] org.eclipse.jetty.server.AbstractConnector: Started admin@78ea668{HTTP/1.1,[http/1.1]}{0.0.0.0:8081} INFO [2020-11-18 15:32:09,999] org.eclipse.jetty.server.AbstractConnector: Started admin@10af6715{HTTP/1.1,[http/1.1]}{0.0.0.0:8444} INFO [2020-11-18 15:32:10,000] org.eclipse.jetty.server.Server: Started @9687ms 127.0.0.1 - - [18/Nov/2020:15:33:53 +0000] "GET / HTTP/1.1" 200 2314 "-" "curl/7.64.0" 54 127.0.0.1 - - [18/Nov/2020:15:34:13 +0000] "GET / HTTP/1.1" 200 2314 "-" "curl/7.64.0" 3

1
Already went through stackoverflow.com/questions/40050596/…. but it did not help. vncserver is not present in compute engineViraj Nalawade
If localhost is working, then you are missing something in external IP setting and firewall setting. Frankly, There is nothing else. cloud.google.com/nodejs/docs/tutorials/…Dhruv garg
@Dhruvgarg okay, any particular setting you can point me to? and I am sure the external ip is enabled. Reason being I set up my deployment pipeline using same external ip and it copies my artifacts to my compute engineViraj Nalawade
follow the attached document. I don't know how you have implemented your pipeline, so can't say maybe there is some bug in that, but If you follow all the commands in the attached doc it should work.Dhruv garg
Provide more information about your deployment scenario, are you able to ssh to your VM-Instance ? are you able to ping your external ip after enabling the icmp on the firewall rule ? Please also provide the screenshot of error message. Note: Please make sure to redact your PII information such as project-id and ip address from the screenshot before attaching here.Sohail Alvi

1 Answers

0
votes

By default GCP firewall denies any ingress traffic. Ingress traffic is traffic that originates outside the network that is traveling into the network For same was the reason any http request from outside VM instance were getting Connection refused error.

I followed

  1. https://cloud.google.com/vpc/docs/using-vpc and
  2. https://cloud.google.com/vpc/docs/using-firewalls

After which we added firewall rules for my project(u can make it instance level too) and allowed ingress traffic which resolved my issue