{"record":{"id":"1b4df39e55663583","repo":"geektutu/7days-golang","slug":"no-such-group","errorCode":null,"errorMessage":"no such group: ","messagePattern":"no such group: ","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"gee-cache/day4-consistent-hash/geecache/http.go","lineNumber":50,"sourceCode":"// ServeHTTP handle all http requests\nfunc (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tif !strings.HasPrefix(r.URL.Path, p.basePath) {\n\t\tpanic(\"HTTPPool serving unexpected path: \" + r.URL.Path)\n\t}\n\tp.Log(\"%s %s\", r.Method, r.URL.Path)\n\t// /<basepath>/<groupname>/<key> required\n\tparts := strings.SplitN(r.URL.Path[len(p.basePath):], \"/\", 2)\n\tif len(parts) != 2 {\n\t\thttp.Error(w, \"bad request\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tgroupName := parts[0]\n\tkey := parts[1]\n\n\tgroup := GetGroup(groupName)\n\tif group == nil {\n\t\thttp.Error(w, \"no such group: \"+groupName, http.StatusNotFound)\n\t\treturn\n\t}\n\n\tview, err := group.Get(key)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/octet-stream\")\n\tw.Write(view.ByteSlice())\n}\n","sourceCodeStart":32,"sourceCodeEnd":63,"githubUrl":"https://github.com/geektutu/7days-golang/blob/cf3644382101dc13e7fd92e8f5c66cabc51bcd3b/gee-cache/day4-consistent-hash/geecache/http.go#L32-L63","documentation":"HTTP 404 response in HTTPPool.ServeHTTP: the group name extracted from the URL path /<basepath>/<groupname>/<key> is not registered via GetGroup, so no cache group exists under that name. It fires for peer requests naming a group this node does not host.","triggerScenarios":"GET /_geecache/<unknownGroup>/<key>; group name mismatch between URL and NewGroup; group registered on one peer but not this one.","commonSituations":"Group-name typos; inconsistent bootstrap across a consistent-hash cluster; deploying new nodes that lack the group registration code path.","solutions":["Call geecache.NewGroup with the exact name on every node in the pool.","Match the URL group name case-sensitively against the NewGroup registration.","Share a single group-registration bootstrap (config-driven) across all peers to avoid drift.","Log registered group names at startup to spot naming drift early."],"exampleFix":"// before: node never registers the group\n// (no NewGroup call) -> 404\n// after: register in each node's startup\ngeecache.NewGroup(\"scores\", 2<<30, geecache.GetterFunc(loadScores))","handlingStrategy":"validation","validationCode":"// day4: verify group registration on this node before remote reads\nif geecache.GetGroup(\"scores\") == nil {\n    geecache.NewGroup(\"scores\", 2<<30, geecache.GetterFunc(loadScores))\n}","typeGuard":null,"tryCatchPattern":"// Go: distinguish 404 (group missing) from other failures\nif resp.StatusCode == http.StatusNotFound {\n    return fmt.Errorf(\"group not registered on peer %s\", peerAddr)\n}","preventionTips":["Register identical groups on every node of the consistent-hash cluster.","Drive group names from shared config, not per-node literals.","Fail fast at startup if any configured group is missing via GetGroup.","Alert on 404s from cache peers — they indicate deployment drift, not user error."],"tags":["http","cache","not-found","configuration","consistent-hash"],"backgroundTag":"cache-group-not-found","analyzedSha":"cf3644382101dc13e7fd92e8f5c66cabc51bcd3b","analyzedAt":"2026-09-03T18:31:24.087Z","contentChangedAt":"2026-09-03T18:31:24.087Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}