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
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:gcloud projects describe "$PROJECT_ID" --format="value(projectNumber)"— returns the project number. Correct.curl "http://metadata.google.internal/computeMetadata/v1/project/project-id"— theproject-idmetadata 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'sgcloud 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-idexists in this repository (code search confirmed the only occurrence is the line being changed).