You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
google.auth.default() fails to retreive project_id #16090
2026-03-12 20:03:00,015 - google.auth._default - DEBUG - Checking '' for explicit credentials as part of auth process...
2026-03-12 20:03:00,016 - google.auth._default - DEBUG - Checking Cloud SDK credentials as part of auth process...
2026-03-12 20:03:00,016 - google.auth._default - DEBUG - Cloud SDK credentials not found on disk; not using them
2026-03-12 20:03:00,016 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 1 of 3. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:01,079 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 2 of 3. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:02,988 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 3 of 3. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:02,989 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 1 of 5. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:03,942 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 2 of 5. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:05,808 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 3 of 5. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:09,676 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 4 of 5. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:17,548 - google.auth.compute_engine._metadata - WARNING - Compute Engine Metadata server unavailable on attempt 5 of 5. Reason: http.client transport only supports the http scheme, httpswas specified
2026-03-12 20:03:17,549 - google.auth._default - WARNING - No project ID could be determined. Consider running `gcloud config set project` or setting the GOOGLE_CLOUD_PROJECT environment variable
--- Success! ---
use a requests.Request in _get_gce_credentials. But this would have issues, because requests is an optional dependency, so we'd still need a backup method
update _mtls.should_use_mds_mtls to return False if requests isn't installed, to fall back to non-authenticated. (But we shouldn't fall back if STRICT mode is enabled)
Maybe make requests a required dependency?
The author of the feature is going to be back in office next week, so I will discuss it with him then
I started facing this issue on Google Cloud Dataproc 2.2 (latest) when some of the libraries transitively started installing google-auth 2.49.1 (Dataproc ships with 2.41.1). I had to set GCE_METADATA_MTLS_MODE=none as a temporary fix.
The suggested workaround of passing request=Request() to google.auth.default() doesn't help when the call is made internally by other Google Cloud libraries (e.g., Vertex AI, BigQuery). Users can't control how those libraries invoke google.auth.default(). The fix needs to be in google-auth itself, not in calling code. Setting GCE_METADATA_MTLS_MODE=none is the only workaround that works globally.
Activity
[-]google.auth.default() fails to reteive project_id[/-][+]google.auth.default() fails to retreive project_id[/+]daniel-sanche commentedon Mar 12, 2026
I was able to reproduce the issue:
It looks like this is coming up because _mtls.should_use_mds_mtls is returning True, but then _get_gce_credentials is using a non-SSL request. It seems this assumption has changed
A couple options are:
requestsis an optional dependency, so we'd still need a backup methodrequestsa required dependency?The author of the feature is going to be back in office next week, so I will discuss it with him then
daniel-sanche commentedon Mar 12, 2026
It looks like
requestsis already a required dependency for api_core, so maybe that is the right optionm15pradeep commentedon Mar 23, 2026
I started facing this issue on Google Cloud Dataproc 2.2 (latest) when some of the libraries transitively started installing google-auth 2.49.1 (Dataproc ships with 2.41.1). I had to set GCE_METADATA_MTLS_MODE=none as a temporary fix.
m15pradeep commentedon Mar 23, 2026
The suggested workaround of passing request=Request() to google.auth.default() doesn't help when the call is made internally by other Google Cloud libraries (e.g., Vertex AI, BigQuery). Users can't control how those libraries invoke google.auth.default(). The fix needs to be in google-auth itself, not in calling code. Setting GCE_METADATA_MTLS_MODE=none is the only workaround that works globally.
fix(auth): use requests transport for GCE MDS (googleapis#16480)
fix(auth): Disable MDS mTLS feature by default. (#16786)