geektutu/7days-golang · error

no such group:

Error message

no such group: 

What it means

HTTP 404 response in HTTPPool.ServeHTTP: the group name from the URL path is not registered (GetGroup returns nil), so this node hosts no such cache group. It fires for peer requests naming an unknown group.

Source

Thrown at gee-cache/day7-proto-buf/geecache/http.go:63

// ServeHTTP handle all http requests
func (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	if !strings.HasPrefix(r.URL.Path, p.basePath) {
		panic("HTTPPool serving unexpected path: " + r.URL.Path)
	}
	p.Log("%s %s", r.Method, r.URL.Path)
	// /<basepath>/<groupname>/<key> required
	parts := strings.SplitN(r.URL.Path[len(p.basePath):], "/", 2)
	if len(parts) != 2 {
		http.Error(w, "bad request", http.StatusBadRequest)
		return
	}

	groupName := parts[0]
	key := parts[1]

	group := GetGroup(groupName)
	if group == nil {
		http.Error(w, "no such group: "+groupName, http.StatusNotFound)
		return
	}

	view, err := group.Get(key)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	// Write the value to the response body as a proto message.
	body, err := proto.Marshal(&pb.Response{Value: view.ByteSlice()})
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	w.Header().Set("Content-Type", "application/octet-stream")
	w.Write(body)

View on GitHub (pinned to cf36443821)

Solutions

  1. Register the group on every peer so group names match across nodes.
  2. Verify the group name in the request URL matches the registered group exactly.
  3. Route the request to a node that hosts the group.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at gee-cache/day7-proto-buf/geecache/http.go:63 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of geektutu/7days-golang@cf36443821 (2026-09-03). Data as JSON: /api/errors/591c74da5d22eb58. Report an issue: GitHub.