{"record":{"id":"f98607ec05e15cde","repo":"redis/go-redis","slug":"at-least-one-channel-is-required","errorCode":null,"errorMessage":"at least one channel is required","messagePattern":"at least one channel is required","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ring.go","lineNumber":735,"sourceCode":"\t\t\tpipe.StaleConns += ps.StaleConns\n\t\t\thavePipe = true\n\t\t}\n\t}\n\tif havePipe {\n\t\tacc.PipelineStats = &pipe\n\t}\n\treturn &acc\n}\n\n// Len returns the current number of shards in the ring.\nfunc (c *Ring) Len() int {\n\treturn c.sharding.Len()\n}\n\n// Subscribe subscribes the client to the specified channels.\nfunc (c *Ring) Subscribe(ctx context.Context, channels ...string) *PubSub {\n\tif len(channels) == 0 {\n\t\tpanic(\"at least one channel is required\")\n\t}\n\n\tshard, err := c.sharding.GetByKey(channels[0])\n\tif err != nil {\n\t\t// TODO: return PubSub with sticky error\n\t\tpanic(err)\n\t}\n\treturn shard.Client.Subscribe(ctx, channels...)\n}\n\n// PSubscribe subscribes the client to the given patterns.\nfunc (c *Ring) PSubscribe(ctx context.Context, channels ...string) *PubSub {\n\tif len(channels) == 0 {\n\t\tpanic(\"at least one channel is required\")\n\t}\n\n\tshard, err := c.sharding.GetByKey(channels[0])\n\tif err != nil {","sourceCodeStart":717,"sourceCodeEnd":753,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/ring.go#L717-L753","documentation":"Error \"at least one channel is required\" thrown in redis/go-redis.","triggerScenarios":"Thrown at ring.go:735 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}