{"record":{"id":"f9bed78269079b02","repo":"kubernetes/kops","slug":"unable-to-fetch-droplet-id-w","errorCode":null,"errorMessage":"unable to fetch droplet id: %w","messagePattern":"unable to fetch droplet id: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/do/dometadata/authenticator.go","lineNumber":44,"sourceCode":"\n\t\"k8s.io/kops/pkg/bootstrap\"\n)\n\nconst DOAuthenticationTokenPrefix = \"x-digitalocean-droplet-id \"\n\ntype doAuthenticator struct {\n}\n\nvar _ bootstrap.Authenticator = (*doAuthenticator)(nil)\n\nfunc NewAuthenticator() (bootstrap.Authenticator, error) {\n\treturn &doAuthenticator{}, nil\n}\n\nfunc (o *doAuthenticator) CreateToken(body []byte) (string, error) {\n\tdropletID, err := GetDropletID()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to fetch droplet id: %w\", err)\n\t}\n\treturn DOAuthenticationTokenPrefix + dropletID, nil\n}\n\nconst (\n\tdropletIDMetadataURL = \"http://169.254.169.254/metadata/v1/id\"\n)\n\n// GetDropletID returns the droplet ID from the metadata service.\nfunc GetDropletID() (string, error) {\n\treturn getMetadata(dropletIDMetadataURL)\n}\n\nfunc getMetadata(url string) (string, error) {\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error querying droplet metadata: %w\", err)\n\t}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/do/dometadata/authenticator.go#L26-L62","documentation":"Wraps GetDropletID failure in the DO bootstrap authenticator: the node could not read its own droplet ID from the DigitalOcean metadata service (169.254.169.254), so the node identity token cannot be created.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/do/dometadata/authenticator.go:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the droplet metadata service is reachable from the node","Check the wrapped error: network failure vs non-200 response","Ensure nodeup/kops-controller runs on an actual DigitalOcean droplet"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}