hydroclimali/XEE_tutorial

[TransportError] Failed to retrieve metadata service, 404 error

Opened this issue · 1 comments

Hi Ali,
I am running your demo code using Goolge Colab and I am encountering the error below. Any suggestions?

`TransportError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/google/auth/compute_engine/credentials.py in refresh(self, request)
110 try:
--> 111 self._retrieve_info(request)
112 self.token, self.expiry = _metadata.get_service_account_token(

19 frames
TransportError: ("Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/?recursive=true from the Google Compute Engine metadata service. Status: 404 Response:\nb''", <google_auth_httplib2._Response object at 0x78603109bac0>)

The above exception was the direct cause of the following exception:

RefreshError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/six.py in raise_from(value, from_value)

RefreshError: ("Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/?recursive=true from the Google Compute Engine metadata service. Status: 404 Response:\nb''", <google_auth_httplib2._Response object at 0x78603109bac0>)`

Hi Mukhtar,
I'm not sure exactly what's causing the issue. Just to make sure, do you currently have a Google Earth Engine account? And if so, is your account working for any GEE tasks? (https://groups.google.com/g/google-appengine/c/9QodWjgreqw/m/h47RfmxjKgAJ)

If you have an EE account, I did some research and the issue may be due to one of the following:

  1. User authentication --> you may be able to resolve it by running the following in your notebook (/colab):
    from google.colab import auth auth.authenticate_user()

  2. EE Authentication --> run the following in a command line:
    earthengine authenticate

  3. (maybe) IAM permissions with your service account --> Take a look at this link