{"record":{"id":"c694dd253f8e6ea0","repo":"getsops/sops","slug":"key-uuid-cannot-be-empty-in-key-id-q","errorCode":null,"errorMessage":"key UUID cannot be empty in key ID: %q","messagePattern":"key UUID cannot be empty in key ID: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hckms/keysource.go","lineNumber":111,"sourceCode":"\t\tkeys = append(keys, k)\n\t}\n\treturn keys, nil\n}\n\n// parseKeyID parses a key ID in format \"region:key-uuid\" and returns the region and UUID.\nfunc parseKeyID(keyID string) (string, string, error) {\n\tkeyID = strings.TrimSpace(keyID)\n\tparts := strings.SplitN(keyID, \":\", 2)\n\tif len(parts) != 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid key ID format: expected 'region:key-uuid', got %q\", keyID)\n\t}\n\tregion := strings.TrimSpace(parts[0])\n\tkeyUUID := strings.TrimSpace(parts[1])\n\tif region == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"region cannot be empty in key ID: %q\", keyID)\n\t}\n\tif keyUUID == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"key UUID cannot be empty in key ID: %q\", keyID)\n\t}\n\treturn region, keyUUID, nil\n}\n\n// Credentials is a wrapper around auth.ICredential used for authentication\n// towards HuaweiCloud KMS.\ntype Credentials struct {\n\tcredential auth.ICredential\n}\n\n// NewCredentials returns a Credentials object with the provided auth.ICredential.\nfunc NewCredentials(c auth.ICredential) *Credentials {\n\treturn &Credentials{credential: c}\n}\n\n// ApplyToMasterKey configures the credentials on the provided key.\nfunc (c Credentials) ApplyToMasterKey(key *MasterKey) {\n\tkey.credentials = c.credential","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/hckms/keysource.go#L93-L129","documentation":"The mirror case of error 87: the region part parsed fine but the UUID segment after the colon is empty after trimming, so parseKeyID rejects the ID because without a key UUID no KMS key can be addressed.","triggerScenarios":"NewMasterKey given a key ID like 'eu-west-0:' or 'eu-west-0:  ' — colon present but the key UUID segment is blank after TrimSpace.","commonSituations":"Truncating the ID during copy-paste so only the region and colon remain; a placeholder like 'REGION:' left un-substituted from a template; YAML key dropped from an env-var-driven value.","solutions":["Append the actual KMS key UUID after the colon.","Copy the key ID from HuaweiCloud KMS console (key details page) to get the full UUID.","Verify template variables: both REGION and KEY_ID must render non-empty."],"exampleFix":"// before\n// huawei://eu-west-0:\n// after\n// huawei://eu-west-0:9a8b7c6d-1234-5678-9abc-def012345678","handlingStrategy":"validation","validationCode":"parts := strings.SplitN(strings.TrimSpace(keyID), \":\", 2)\nif len(parts) == 2 && strings.TrimSpace(parts[1]) == \"\" {\n    return errors.New(\"key UUID segment empty: append the KMS key UUID after the colon\")\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Copy full key IDs from the HuaweiCloud console, never retype them.","Check for unsubstituted template placeholders (REGION:, etc.) in config review."],"tags":["huaweicloud","kms","validation","configuration"],"backgroundTag":"invalid-key-id-format","analyzedSha":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}