My functions became inaccessible from my development localhost, but in GCP Shell it works!

Unexpectedly, I can't access my functions in my development environment, everything was working until a few minutes ago, but when I make a call in GCP Shell they work.

 

(gcp shell)$ curl https://xxxxxx.cloudfunctions.net/testando -i
HTTP/2 200
content-type: text/html; charset=utf-8
etag: W/"c-Lve95gjOVATpfV8EL5X4nxwjKHE"
function-execution-id: 2xx0mcwws161
x-cloud-trace-context: 3xx5744c0601909e31ff7b543eb44e91;o=1
date: Wed, 27 Oct 2021 19:14:00 GMT
server: Google Frontend
content-length: 12

Hello World!

 

user@localhost:~$ curl https://xxxxxx.cloudfunctions.net/testando -i
curl: (6) Could not resolve host: xxxxxx.cloudfunctions.net

 

Can anyone help me with this?

0 14 684
14 REPLIES 14

glen_yu
Google Developer Expert
Google Developer Expert

What's the ingress setting on those functions?  I wonder if you accidentally switched it to internal traffic only and hence it works from GCP shell but not your localhost/laptop/pc

 

EDIT:  Cloud Functions Ingress Settings

Sorry. I didn't send it in response to your comment. 

No, I didn't make any changes. It's just happening with all my functions. I sent an endpoint URL for one of the functions to a friend and he can get a response and access it, but I can't. Everything was working normally, and all of a sudden it feels like my IP was blocked, or something like that.  I really do not understand. 

That is very strange.  I wonder if there's an issue with your DNS... To rule that out, can you do a dig:

 

dig xxxxx.cloudfunctions.net
dig @8.8.8.8 xxxxx.cloudfunctions.net
dig @1.1.1.1 xxxxx.cloudfunctions.net

 

8.8.8.8 and 1.1.1.1 are google and cloudflare respectively, but you're welcome to try others.  I just want to rule out a DNS issue

i tried this away:

 

user@localhost:~$ dig cloudflare.com +short
104.16.133.229
104.16.132.229


user@localhost:~$ dig google.com +short
142.250.78.206


user@localhost:~$ dig xxxxx.cloudfunctions.net/testando +short
user@localhost:~$ dig xxxxx.cloudfunctions.net +short
(no response, empty)

and this:

 

user@localhost:~$ dig @8.8.8.8 xxxxx.cloudfunctions.net +short
216.239.36.54

 

user@localhost:~$ dig @8.8.8.8 xxxxx.cloudfunctions.net/testando +short
(empty)

 

user@localhost:~$ dig @1.1.1.1 xxxxx.cloudfunctions.net +short
216.239.36.54

 

user@localhost:~$ dig @1.1.1.1 xxxxx.cloudfunctions.net/testando +short
(empty)

Wow...that is a head scratcher.  I tried creating a cloud function with the provided Hello World code but haven't had any luck reproducing the problem you have.

 

If you edit the CF and turn on (or off) "Required HTTPS" or make some other small change and redeploy does that fix things?  Or perhaps make another CF -- do you have issues with that one as well?

oh man, i created a new account, one of those $300 free ones... after creating a new one on Google Cloud and then creating a new Cloud Functions... same problem, exact same problem. I think Google blocked my IP or something on another level, but they did.

ok, i dont care, just access the real endpoint see by youself

 

https://us-east1-catalobyte-311413.cloudfunctions.net/testando

 

what you see? for me, nothing...  its blocked only for me

{{Term removed by staff}}... Maybe it's time to give Google Support a shout and see what's going on.  If possible, update here when you do find what the cause was.  Good luck!

 

EDIT:

Screen Shot 2021-10-28 at 00.08.33.png

 

 

$ dig @8.8.8.8 https://us-east1-catalobyte-311413.cloudfunctions.net/testando                                                      

; <<>> DiG 9.10.6 <<>> @8.8.8.8 https://us-east1-catalobyte-311413.cloudfunctions.net/testando
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 16865
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;https://us-east1-catalobyte-311413.cloudfunctions.net/testando.	IN A

;; AUTHORITY SECTION:
.			86379	IN	SOA	a.root-servers.net. nstld.verisign-grs.com. 2021102702 1800 900 604800 86400

;; Query time: 20 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Oct 28 00:11:50 EDT 2021
;; MSG SIZE  rcvd: 166

 

glen_yu
Google Developer Expert
Google Developer Expert

@ronaldofreitas , may I ask what region you're in?  There was another post just now about DNS and Cloud Functions (they're in Chile, with ENTEL as ISP) that sounded very similar to the one you're experiencing.

South America region, Brazil. Things seem to be back to normal here, but I still don't understand what happened.

So the CF works for you now and DNS resolves properly? 

My god it's happening all over again!!

Fxxxk!!