{"record":{"id":"88c4f218d0290791","repo":"grafana/k6","slug":"couldn-t-open-protoset-w","errorCode":null,"errorMessage":"couldn't open protoset: %w","messagePattern":"couldn't open protoset: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/grpc/client.go","lineNumber":110,"sourceCode":"\treturn c.convertToMethodInfo(fdset)\n}\n\n// LoadProtoset will parse the given protoset file (serialized FileDescriptorSet) and make the file\n// descriptors available to request.\nfunc (c *Client) LoadProtoset(protosetPath string) ([]MethodInfo, error) {\n\tif c.vu.State() != nil {\n\t\treturn nil, errors.New(\"load must be called in the init context\")\n\t}\n\n\tinitEnv := c.vu.InitEnv()\n\tif initEnv == nil {\n\t\treturn nil, errors.New(\"missing init environment\")\n\t}\n\n\tabsFilePath := initEnv.GetAbsFilePath(protosetPath)\n\tfdsetFile, err := initEnv.FileSystems[\"file\"].Open(absFilePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't open protoset: %w\", err)\n\t}\n\n\tdefer func() { _ = fdsetFile.Close() }()\n\tfdsetBytes, err := io.ReadAll(fdsetFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't read protoset: %w\", err)\n\t}\n\n\tfdset := &descriptorpb.FileDescriptorSet{}\n\tif err = proto.Unmarshal(fdsetBytes, fdset); err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't unmarshal protoset file %s: %w\", protosetPath, err)\n\t}\n\n\treturn c.convertToMethodInfo(fdset)\n}\n\n// Note: this function was lifted from `lib/options.go`\nfunc decryptPrivateKey(key, password []byte) ([]byte, error) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/grpc/client.go#L92-L128","documentation":"Raised in Client.LoadProtoset when the protoset file cannot be opened from the init-time 'file' filesystem at the resolved absolute path (missing file, archive omission, or I/O error).","triggerScenarios":"Thrown at internal/js/modules/k6/grpc/client.go:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the protoset path relative to the script and that the file exists","Ensure the protoset is bundled when running from an archive (k6 archive)","Check read permissions on the file"],"exampleFix":null,"handlingStrategy":"try-catch","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"}