-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Environment:
Version information
Cloud Code Extension version: 2.37.0
VSCode version: Version: 1.109.2 (Universal)
Commit: 591199df409fbf59b4b52d5ad4ee0470152a9b31
OS: Linux (Devcontainer) / Host: Linux (Google Cloudtop)
Cloud SDK: System installed (Managed from cloudtop)
Skaffold: N/A
Kubectl: v1.35.1
Description: I am running VS Code in a Devcontainer where I have mounted my host's valid gcloud configuration and authenticated credentials. Despite configuring the extension to use the system gcloud and explicitly setting GOOGLE_APPLICATION_CREDENTIALS, the extension fails to pick up the credentials at startup, remains in a "Not signed in" state, and spams 401 errors for its internal API calls.
Observed Behavior:
- gcloud auth list inside the container shows the account is ACTIVE.
GOOGLE_APPLICATION_CREDENTIALSis set and points to a valid application_default_credentials.json file (verified readable).- Cloud Code logs immediately show a 401 error for cloudcode-pa.googleapis.com and the status bar asks to sign in.
[INFO]: Cloud Code version 2.37.0
[ERROR]: Unsuccessful http request to https://cloudcode-pa.googleapis.com/v1internal:listExperiments.
Response: {"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token...
Repro step:
- Setup a
.devcontainerthat mounts the host's ~/.config/gcloud to the container (e.g., via a bind mount to /etc/user-host-config and symlinking or setting env vars). - Configure devcontainer.json to disable auto-dependencies:
"customizations": { "vscode": { "settings": { "cloudcode.autoDependencies": "off", "cloudcode.dependencyPaths": { "gcloud": "/usr/bin/gcloud" } } } } - Set the environment variable in devcontainer.json:
"remoteEnv": { "GOOGLE_APPLICATION_CREDENTIALS": "/etc/user-host-config/gcloud/application_default_credentials.json" } - Rebuild and open the Devcontainer.
- Observe that
gcloudCLI works fine, but the Extension fails to authenticate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels