Skip to content

fix(agent-platform-migrate-from-ai-studio): use numeric-project-id metadata key for in-VM project number - #216

Open
rootkiller6788 wants to merge 1 commit into
google:mainfrom
rootkiller6788:fix-invm-project-number
Open

fix(agent-platform-migrate-from-ai-studio): use numeric-project-id metadata key for in-VM project number#216
rootkiller6788 wants to merge 1 commit into
google:mainfrom
rootkiller6788:fix-invm-project-number

Conversation

@rootkiller6788

Copy link
Copy Markdown

What

In skills/cloud/agent-platform-migrate-from-ai-studio/SKILL.md, the OpenClaw setup step 3 has two branches that resolve the GCP project number:

  • Out-of-VM: gcloud projects describe "$PROJECT_ID" --format="value(projectNumber)" — returns the project number. Correct.
  • In-VM: curl "http://metadata.google.internal/computeMetadata/v1/project/project-id" — the project-id metadata endpoint returns the project ID, not the project number.

The value is then interpolated into the Compute Engine default service account address (${PROJECT_NUMBER}-compute@developer.gserviceaccount.com), which requires the numeric project number. With a project ID substituted (e.g. my-project-123-compute@...), the address does not resolve and the next step's gcloud iam service-accounts keys create --iam-account=... fails.

Why

This was reported in #207 as a separate defect in the same OpenClaw section. The metadata server serves the project number at project/numeric-project-id; switching the in-VM branch to that key makes it consistent with the out-of-VM branch and produces a valid service account address.

Test

Verification is by inspection of the exact metadata endpoints:

  • project/project-id -> project ID (string, e.g. my-project-123)
  • project/numeric-project-id -> project number (e.g. 123456789012)

No other reference to project/project-id exists in this repository (code search confirmed the only occurrence is the line being changed).

…tadata key for in-VM project number

The in-VM branch of step 3 curls the metadata server's project-id
endpoint but uses the result as the project number, interpolating it
into the Compute Engine default service account address
(${PROJECT_NUMBER}-compute@developer.gserviceaccount.com). The
project-id endpoint returns the project ID, so the generated service
account address is invalid and the gcloud key creation step fails.
Switch to the numeric-project-id metadata key, matching the
projectNumber value returned by the out-of-VM gcloud projects describe
branch just above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant