{"record":{"id":"eb67abbc3aa36035","repo":"kopia/kopia","slug":"no-logs-found","errorCode":null,"errorMessage":"no logs found","messagePattern":"no logs found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command_logs_show.go","lineNumber":47,"sourceCode":"\tc.out.setup(svc)\n}\n\nfunc (c *commandLogsShow) run(ctx context.Context, rep repo.DirectRepository) error {\n\tsessions, err := getLogSessions(ctx, rep.BlobReader())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsessions = c.crit.filterLogSessions(sessions)\n\n\tif len(c.logSessionIDs) > 0 {\n\t\tsessions = filterLogSessions(sessions, func(l *logSessionInfo) bool {\n\t\t\treturn slices.Contains(c.logSessionIDs, l.id)\n\t\t})\n\t}\n\n\tif len(sessions) == 0 {\n\t\treturn errors.New(\"no logs found\")\n\t}\n\n\t// by default show latest one\n\tif !c.crit.any() {\n\t\tsessions = sessions[len(sessions)-1:]\n\t\tlog(ctx).Infof(\"Showing the latest log (%v)\", formatTimestamp(sessions[0].startTime))\n\t}\n\n\tvar data gather.WriteBuffer\n\tdefer data.Close()\n\n\tvar decrypted gather.WriteBuffer\n\tdefer decrypted.Close()\n\n\tfor _, s := range sessions {\n\t\tfor _, bm := range s.segments {\n\t\t\tif err := rep.BlobReader().GetBlob(ctx, bm.BlobID, 0, -1, &data); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"error getting log\")","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/command_logs_show.go#L29-L65","documentation":"Raised by the logs-show command after all filtering (log criteria and any explicitly listed session IDs) leaves zero log sessions, meaning the repository contains no upload log sessions matching the request, so there is nothing to display.","triggerScenarios":"Running 'kopia logs show' when the repository contains no log sessions, or with --log-session-id / --since-style filters that exclude all sessions.","commonSituations":"Requesting a specific log session ID that was deleted or typo'd; logs never uploaded to the repo; filters like 'last-week' on a repo with only older logs.","solutions":["Run 'kopia logs list' to see which log sessions actually exist","Drop or widen filters (remove --log-session-id, use a broader --since)","Confirm logs exist in this repository rather than a different one","Enable debug log uploads if sessions are missing"],"exampleFix":"// before\nkopia logs show --log-session-id abc123\n// after\nkopia logs list   # find a valid session ID first\nkopia logs show --log-session-id <valid-id>","handlingStrategy":"fallback","validationCode":"SESSIONS=$(kopia logs list); if [ -z \"$SESSIONS\" ]; then echo \"no logs in repo\"; fi","typeGuard":null,"tryCatchPattern":"out, err := cmd.Output(); if err != nil && strings.Contains(err.Error(), \"no logs found\") { // notify user, skip log display }","preventionTips":["List sessions before showing one","Avoid overly narrow session ID/since filters","Ensure log uploads are enabled"],"tags":["cli","logs","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}