{"record":{"id":"4fb969f4cee0861e","repo":"kubernetes/kops","slug":"droplet-metadata-returned-non-200-status-code-d-4fb969","errorCode":null,"errorMessage":"droplet metadata returned non-200 status code: %d","messagePattern":"droplet metadata returned non-200 status code: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/do/dometadata/authenticator.go","lineNumber":66,"sourceCode":"\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}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"droplet metadata returned non-200 status code: %d\", resp.StatusCode)\n\t}\n\n\tbodyBytes, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error reading droplet metadata: %w\", err)\n\t}\n\n\treturn string(bodyBytes), nil\n}\n","sourceCodeStart":48,"sourceCodeEnd":76,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/do/dometadata/authenticator.go#L48-L76","documentation":"Status-code validation on the DO metadata response: the HTTP request succeeded but returned a non-200 status, so the metadata payload cannot be trusted. Indicates the metadata service rejected or failed the request rather than a connectivity problem.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/do/dometadata/authenticator.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry after a short delay (metadata service transient errors)","Verify the requested metadata path is correct","Check for metadata service rate limiting"],"exampleFix":null,"handlingStrategy":"validation","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"}