{"record":{"id":"3b211c885028d59c","repo":"grafana/k6","slug":"failed-to-decode-y-coordinate-w","errorCode":null,"errorMessage":"failed to decode Y coordinate: %w","messagePattern":"failed to decode Y coordinate: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/webcrypto/jwk.go","lineNumber":244,"sourceCode":"\t}\n\n\tif err := jwkKey.validate(); err != nil {\n\t\treturn nil, UnknownCryptoKeyType, fmt.Errorf(\"invalid EC JWK key: %w\", err)\n\t}\n\n\tcrv, err := pickEllipticCurve(jwkKey.Crv)\n\tif err != nil {\n\t\treturn nil, UnknownCryptoKeyType, fmt.Errorf(\"failed to parse elliptic curve: %w\", err)\n\t}\n\n\tx, err := base64URLDecode(jwkKey.X)\n\tif err != nil {\n\t\treturn nil, UnknownCryptoKeyType, fmt.Errorf(\"failed to decode X coordinate: %w\", err)\n\t}\n\n\ty, err := base64URLDecode(jwkKey.Y)\n\tif err != nil {\n\t\treturn nil, UnknownCryptoKeyType, fmt.Errorf(\"failed to decode Y coordinate: %w\", err)\n\t}\n\n\tpk := &ecdsa.PublicKey{\n\t\tCurve: crv,\n\t\tX:     new(big.Int).SetBytes(x),\n\t\tY:     new(big.Int).SetBytes(y),\n\t}\n\n\t// if the key is a public key, return it\n\tif jwkKey.D == \"\" {\n\t\treturn pk, PublicCryptoKeyType, nil\n\t}\n\n\td, err := base64URLDecode(jwkKey.D)\n\tif err != nil {\n\t\treturn nil, UnknownCryptoKeyType, fmt.Errorf(\"failed to decode D: %w\", err)\n\t}\n","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/webcrypto/jwk.go#L226-L262","documentation":"Returned by importECDSAJWK when the JWK's `y` field (the public key's Y coordinate) is not valid base64url. Same stage as the X-coordinate failure: JSON and curve already validated, but the second coordinate cannot be decoded to bytes.","triggerScenarios":"Thrown at internal/js/modules/k6/webcrypto/jwk.go:243 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-encode the y coordinate as unpadded base64url with the curve's coordinate length (e.g. 32 bytes for P-256)","Verify the JWK was produced by a spec-compliant exporter"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}