{"record":{"id":"be4ff39a1279b5a0","repo":"googleapis/mcp-toolbox","slug":"unable-to-retrieve-flusher-for-sse","errorCode":null,"errorMessage":"unable to retrieve flusher for sse","messagePattern":"unable to retrieve flusher for sse","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"internal/server/mcp.go","lineNumber":437,"sourceCode":"\tdefer func() {\n\t\t// Decrement active sessions counter\n\t\ts.instrumentation.McpActiveSessions.Add(ctx, -1, metric.WithAttributes(sessionAttrs...))\n\n\t\t// Record session duration\n\t\tsessionDuration := time.Since(sessionStart).Seconds()\n\t\tdurationAttrs := make([]attribute.KeyValue, len(sessionAttrs))\n\t\tcopy(durationAttrs, sessionAttrs)\n\t\tif err != nil {\n\t\t\tspan.SetStatus(codes.Error, err.Error())\n\t\t\tdurationAttrs = append(durationAttrs, attribute.String(\"error.type\", err.Error()))\n\t\t}\n\t\ts.instrumentation.McpSessionDuration.Record(ctx, sessionDuration, metric.WithAttributes(durationAttrs...))\n\t\tspan.End()\n\t}()\n\n\tflusher, ok := w.(http.Flusher)\n\tif !ok {\n\t\terr = fmt.Errorf(\"unable to retrieve flusher for sse\")\n\t\ts.logger.DebugContext(ctx, err.Error())\n\t\t_ = render.Render(w, r, newErrResponse(err, http.StatusInternalServerError))\n\t\treturn\n\t}\n\tsession := &sseSession{\n\t\twriter:     w,\n\t\tflusher:    flusher,\n\t\tdone:       make(chan struct{}),\n\t\teventQueue: make(chan string, 100),\n\t}\n\ts.sseManager.add(sessionId, session)\n\tdefer s.sseManager.remove(sessionId)\n\n\t// https scheme formatting if (forwarded) request is a TLS request\n\tproto := r.Header.Get(\"X-Forwarded-Proto\")\n\tif proto == \"\" {\n\t\tif r.TLS == nil {\n\t\t\tproto = \"http\"","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/mcp.go#L419-L455","documentation":"Error \"unable to retrieve flusher for sse\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/mcp.go:437 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":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}