Unable to resolve host address 'storage.googleapis.com'

Q: Date/Time this occurred (Provide your time zone also)
A: Not time specific

Q: DevKinsta Version
A: 2.7.0

Q: OS Version
A: MacOS Monterey 12.5.1 (21G83)

Q: Docker Desktop Version
A: 4.12.0 (85629)

Q: Were any error codes or messages observed? If so, what were they?
A: unable to resolve host address ‘storage.googleapis.com

Q: Detailed Description of the Problem
A: See below

While doing some development work using download_url() to download an external file from our GCP storage account I get a critical Wordpress error:

A debug trace shows that the http request was failing with the error "“A valid URL was not provided.”

Digging into this a little further have uncovered the following:

x@y ~ % docker exec -it devkinsta_fpm bash                                              
root@z:/www/kinsta# wget storage.googleapis.com/(redacted).appspot.com/(redacted).jpeg
--2022-09-11 17:23:38--  http://storage.googleapis.com/(redacted).appspot.com/(redacted).jpeg
Resolving storage.googleapis.com (storage.googleapis.com)... failed: Name or service not known.
wget: **unable to resolve host address 'storage.googleapis.com'**

The URL works in Chrome and Firefox, the code works in our Kinsta staging environment and the same function calls other external URLs just fine so wondering what is different or special about storage.googleapis.com in DevKinsta – is this because Kinsta uses GCP under the hood?

I also wondered if this was adjacently related to Site Health: REST/loopback requests are failing, scheduled event failed or https://stackoverflow.com/questions/47915774/chrooted-php-fpm-script-cannot-resolve-dns-after-a-moment but in either case I wanted to ask in the community to see if I’m missing something really obvious!

@Kevin are you able to shed any light on this?

Hi @jamesgreenblue, thanks for reaching out. So I noticed when I curl storage.googleapis.com from the fpm container it can’t resolve the host. However if I add the https protocol it connects. Does that make any difference for you?

# curl storage.googleapis.com
curl: (6) Could not resolve host: storage.googleapis.com
# curl help.ubuntu.com
# curl https://storage.googleapis.com
<?xml version='1.0' encoding='UTF-8'?><Error><Code>MissingSecurityHeader</Code><Message>Your request was missing a required header.</Message><Details>Authorization</Details></Error>#

You’re right though that the behavior is different on the Kinsta/Staging container. I’ll ask our devs if this has to do with how we resolved the loopback issue. I’m not 100% sure what would cause this.