diff --git a/dask_cloudprovider/gcp/instances.py b/dask_cloudprovider/gcp/instances.py index 09fee60d..0f9ff17c 100644 --- a/dask_cloudprovider/gcp/instances.py +++ b/dask_cloudprovider/gcp/instances.py @@ -673,7 +673,10 @@ def refresh_client(self): import google.auth # Obtain Application Default Credentials - credentials, _ = google.auth.default() + try: + credentials, _ = google.auth.default() + except google.auth.exceptions.DefaultCredentialsError: + credentials = None # Use the credentials to build a service client return googleapiclient.discovery.build(