{"record":{"id":"2c0826fe3c5186f8","repo":"grafana/k6","slug":"invalid-websocket-tags-option-w","errorCode":null,"errorMessage":"invalid WebSocket tags option: %w","messagePattern":"invalid WebSocket tags option: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/websockets/params.go","lineNumber":59,"sourceCode":"\n\tparams := raw.ToObject(rt)\n\tfor _, k := range params.Keys() {\n\t\tswitch k {\n\t\tcase \"headers\":\n\t\t\theadersV := params.Get(k)\n\t\t\tif common.IsNullish(headersV) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\theadersObj := headersV.ToObject(rt)\n\t\t\tif headersObj == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, key := range headersObj.Keys() {\n\t\t\t\tparsed.headers.Set(key, headersObj.Get(key).String())\n\t\t\t}\n\t\tcase \"tags\":\n\t\t\tif err := common.ApplyCustomUserTags(rt, parsed.tagsAndMeta, params.Get(k)); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid WebSocket tags option: %w\", err)\n\t\t\t}\n\t\tcase \"jar\":\n\t\t\tjarV := params.Get(k)\n\t\t\tif common.IsNullish(jarV) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif v, ok := jarV.Export().(*httpModule.CookieJar); ok {\n\t\t\t\tparsed.cookieJar = v.Jar\n\t\t\t}\n\t\tcase \"compression\":\n\t\t\t// deflate compression algorithm is supported - as defined in RFC7692\n\t\t\t// compression here relies on the implementation in gorilla/websocket package, usage is\n\t\t\t// experimental and may result in decreased performance. package supports\n\t\t\t// only \"no context takeover\" scenario\n\n\t\t\talgoString := strings.TrimSpace(params.Get(k).ToString().String())\n\t\t\tif algoString != \"deflate\" {\n\t\t\t\treturn nil, fmt.Errorf(\"unsupported compression algorithm '%s', supported algorithm is 'deflate'\", algoString)","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/websockets/params.go#L41-L77","documentation":"Returned by buildParams while parsing the options object of new WebSocket(url, params): the `tags` entry failed common.ApplyCustomUserTags, meaning the tags value is not a valid tags object (not an object, or contains values that cannot be treated as tag strings). The wrapped error carries the specifics; the connection is never attempted.","triggerScenarios":"Thrown at internal/js/modules/k6/websockets/params.go:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass tags as a plain object of string values: new WebSocket(url, { tags: { env: 'staging' } })","Omit the tags key if no custom tags are needed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}