{"record":{"id":"a7e051105c5743b5","repo":"sipeed/picoclaw","slug":"invalid-pico-token","errorCode":null,"errorMessage":"Invalid Pico token","messagePattern":"Invalid Pico token","errorType":"http","errorClass":null,"httpStatus":403,"severity":"error","filePath":"web/backend/api/pico.go","lineNumber":189,"sourceCode":"\t\th.createWsProxy(origProtocol, upstreamProtocol).ServeHTTP(w, r)\n\t}\n}\n\nfunc (h *Handler) handlePicoMediaProxy() http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tif !h.gatewayAvailableForProxy() {\n\t\t\tlogger.Warnf(\"Gateway not available for Pico media proxy\")\n\t\t\thttp.Error(w, \"Gateway not available\", http.StatusServiceUnavailable)\n\t\t\treturn\n\t\t}\n\n\t\tgateway.mu.Lock()\n\t\tpicoToken := gateway.picoToken\n\t\tgateway.mu.Unlock()\n\n\t\tif picoToken == \"\" {\n\t\t\tlogger.Warnf(\"Missing Pico token for media proxy\")\n\t\t\thttp.Error(w, \"Invalid Pico token\", http.StatusForbidden)\n\t\t\treturn\n\t\t}\n\n\t\th.createPicoHTTPProxy(picoToken).ServeHTTP(w, r)\n\t}\n}\n\n// handleGetPicoInfo returns non-secret Pico connection info for the launcher UI.\n//\n//\tGET /api/pico/info\nfunc (h *Handler) handleGetPicoInfo(w http.ResponseWriter, r *http.Request) {\n\tcfg, err := config.LoadConfig(h.configPath)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"Failed to load config: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\th.writePicoInfoResponse(w, r, cfg, nil)","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/web/backend/api/pico.go#L171-L207","documentation":"Sent as a 403 by handlePicoMediaProxy when gateway.picoToken is empty: the media proxy has no Pico token to inject into upstream requests, so it refuses to proxy. Means the Pico channel is reachable but has no token configured.","triggerScenarios":"Thrown at web/backend/api/pico.go:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run POST /api/pico/setup or regenerate a token via the Pico token endpoint","Verify the Pico channel settings in the config contain a non-empty token","Retry the media request after the token is set"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}