{"record":{"id":"9a763a21a1061962","repo":"benbjohnson/litestream","slug":"info-failed-s","errorCode":null,"errorMessage":"info failed: %s","messagePattern":"info failed: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cmd/litestream/info.go","lineNumber":62,"sourceCode":"\t\t\t},\n\t\t},\n\t}\n\n\tresp, err := client.Get(\"http://localhost/info\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to control socket: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read response: %w\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tvar errResp litestream.ErrorResponse\n\t\tif err := json.Unmarshal(body, &errResp); err == nil && errResp.Error != \"\" {\n\t\t\treturn fmt.Errorf(\"info failed: %s\", errResp.Error)\n\t\t}\n\t\treturn fmt.Errorf(\"info failed: %s\", string(body))\n\t}\n\n\tvar result litestream.InfoResponse\n\tif err := json.Unmarshal(body, &result); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse response: %w\", err)\n\t}\n\n\tif *jsonOutput {\n\t\toutput, err := json.MarshalIndent(result, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to format response: %w\", err)\n\t\t}\n\t\tfmt.Println(string(output))\n\t} else {\n\t\tuptime := time.Duration(result.UptimeSeconds) * time.Second\n\t\tfmt.Printf(\"Litestream %s\\n\", result.Version)","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/info.go#L44-L80","documentation":"When the /info endpoint returns a non-200 status, Run attempts to decode the body as a litestream.ErrorResponse and, if it carries a non-empty Error field, surfaces it as `info failed: <server error>`. This is the server's structured error message passed through to the CLI user.","triggerScenarios":"The daemon handles the request but rejects it, responding with a JSON error body such as {\"error\":\"...\"} and an HTTP error status (e.g. internal error while collecting info, IPC not fully initialized).","commonSituations":"Daemon under load or mid-shutdown returning 500s; a version mismatch where the client's /info request is rejected by the running daemon; the socket is enabled but the server-side info handler fails to enumerate databases.","solutions":["Read the embedded <server error> text — it states the actual daemon-side reason — and address it.","Check litestream daemon logs at the matching timestamp for the full error and stack.","Ensure client and daemon versions match (upgrade/downgrade the CLI to the daemon's version).","If the daemon is unhealthy (500s), restart the litestream process."],"exampleFix":"// before (diagnose from message)\n$ litestream info\ninfo failed: store not initialized\n// after\n$ systemctl restart litestream\n$ litestream info\nLitestream v0.5.0 ...","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := runInfo(ctx)\nif err != nil && strings.HasPrefix(err.Error(), \"info failed: \") {\n    serverMsg := strings.TrimPrefix(err.Error(), \"info failed: \")\n    log.Errorf(\"daemon rejected /info: %s — check daemon logs and version match\", serverMsg)\n    return\n}","preventionTips":["Keep the litestream CLI and daemon on the same version.","Parse the embedded server message — it names the daemon-side cause.","Alert on daemon health so it is not serving 500s when info is called."],"tags":["http","server-error","ipc"],"backgroundTag":"http-error-response","analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}