{"record":{"id":"ab657ef8a0b33948","repo":"kubernetes/kops","slug":"unable-to-fetch-akamai-linode-instance-id-w","errorCode":null,"errorMessage":"unable to fetch Akamai (Linode) instance id: %w","messagePattern":"unable to fetch Akamai \\(Linode\\) instance id: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linode/linodemetadata/authenticator.go","lineNumber":61,"sourceCode":"\nvar _ bootstrap.Authenticator = (*linodeAuthenticator)(nil)\n\n// NewLinodeAuthenticator returns a bootstrap.Authenticator that can create\n// authentication tokens for Akamai (Linode) instances by querying the Akamai (Linode) metadata\n// service for the instance ID and returning it prefixed with \"x-linode-instance-id\".\nfunc NewLinodeAuthenticator() (bootstrap.Authenticator, error) {\n\treturn &linodeAuthenticator{\n\t\tclient:          http.DefaultClient,\n\t\tmetadataBaseURL: linodeMetadataBaseURL,\n\t}, nil\n}\n\n// CreateToken queries the Akamai (Linode) metadata service for the instance ID and returns\n// it prefixed with \"x-linode-instance-id \".\nfunc (a *linodeAuthenticator) CreateToken(body []byte) (string, error) {\n\tinstanceID, err := getLinodeMetadataValue(context.TODO(), a.client, a.metadataBaseURL, \"id\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to fetch Akamai (Linode) instance id: %w\", err)\n\t}\n\n\treturn LinodeAuthenticationTokenPrefix + instanceID, nil\n}\n\n// GetMetadataValue fetches the given field from the Akamai (Linode) instance metadata service\n// using the standard metadata endpoint and default HTTP client.\nfunc GetMetadataValue(ctx context.Context, key string) (string, error) {\n\treturn getLinodeMetadataValue(ctx, http.DefaultClient, linodeMetadataBaseURL, key)\n}\n\n// getLinodeMetadataValue queries the Akamai (Linode) metadata service for the given key\n// and returns the value as a string.\nfunc getLinodeMetadataValue(ctx context.Context, client *http.Client, metadataBaseURL, key string) (string, error) {\n\ttokenReq, err := http.NewRequestWithContext(ctx, http.MethodPut, metadataBaseURL+\"/v1/token\", nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"building metadata token request: %w\", err)\n\t}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linode/linodemetadata/authenticator.go#L43-L79","documentation":"CreateToken fails because the HTTP GET to the Linode metadata service /v1/instance (used to read the instance ID) returned an error or empty ID. It fires on instances where the metadata service is unreachable, disabled, or returned a non-200 response, so no x-linode-instance-id token can be minted.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/linode/linodemetadata/authenticator.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the instance metadata service is enabled for the Linode instance","Check network connectivity to the metadata endpoint from the node","Confirm the requesting context is not cancelled or timed out before the metadata call completes"],"exampleFix":null,"handlingStrategy":"retry","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"}