{"record":{"id":"c397c64be7a57a11","repo":"kgretzky/evilginx2","slug":"id-d-not-found","errorCode":null,"errorMessage":"id %d not found","messagePattern":"id (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/terminal.go","lineNumber":493,"sourceCode":"\t\t\t\t\t\t}\n\t\t\t\t\t\tfor k, v := range s.HttpTokens {\n\t\t\t\t\t\t\ttkeys = append(tkeys, k)\n\t\t\t\t\t\t\ttvals = append(tvals, white.Sprint(v))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlog.Printf(\"[ %s ]\\n%s\\n\", lgreen.Sprint(\"tokens\"), AsRows(tkeys, tvals))\n\t\t\t\t\t}\n\t\t\t\t\tif len(s.CookieTokens) > 0 {\n\t\t\t\t\t\tjson_tokens := t.cookieTokensToJSON(s.CookieTokens)\n\t\t\t\t\t\tlog.Printf(\"[ %s ]\\n%s\\n\\n\", lyellow.Sprint(\"cookies\"), json_tokens)\n\t\t\t\t\t\tlog.Printf(\"%s %s %s %s%s\\n\\n\", dgray.Sprint(\"(use\"), cyan.Sprint(\"StorageAce\"), dgray.Sprint(\"extension to import the cookies:\"), white.Sprint(\"https://chromewebstore.google.com/detail/storageace/cpbgcbmddckpmhfbdckeolkkhkjjmplo\"), dgray.Sprint(\")\"))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !s_found {\n\t\t\treturn fmt.Errorf(\"id %d not found\", id)\n\t\t}\n\t\treturn nil\n\t} else if pn == 2 {\n\t\tswitch args[0] {\n\t\tcase \"delete\":\n\t\t\tif args[1] == \"all\" {\n\t\t\t\tsessions, err := t.db.ListSessions()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif len(sessions) == 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tfor _, s := range sessions {\n\t\t\t\t\terr = t.db.DeleteSessionById(s.Id)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Warning(\"delete: %v\", err)\n\t\t\t\t\t} else {","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/terminal.go#L475-L511","documentation":"handleSessions looks up a live session by numeric ID; when no active session with that ID exists in the session list, it returns 'id %d not found'. Session IDs are ephemeral — they are reassigned and vanish when sessions expire or the server restarts.","triggerScenarios":"Running 'sessions <id>' to view or a pn>=2 form like 'sessions delete <id>' where the ID was never created or has already been closed/expired (s_found stays false).","commonSituations":"Using a session ID captured hours earlier after a restart; typo in the ID; targeting a session that expired by timeout; reusing IDs from a previous run's notes.","solutions":["Run 'sessions' with no args to list current IDs and pick a valid one","Confirm the target victim actually visited and has an active session","Re-check after server restart — all old IDs are gone","Use 'sessions delete all' if the intent is cleanup rather than a specific ID"],"exampleFix":"// before\nsessions 17\n// after\nsessions        # list active IDs first\nsessions 3","handlingStrategy":"validation","validationCode":"ids := listActiveSessionIDs() // from bare 'sessions' output\nif !contains(ids, wantID) {\n\treturn fmt.Errorf(\"session %d is not active; pick from %v\", wantID, ids)\n}","typeGuard":null,"tryCatchPattern":"if err := t.handleSessions([]string{strconv.Itoa(id)}); err != nil {\n\tif strings.Contains(err.Error(), \"not found\") {\n\t\tt.handleSessions(nil) // list current IDs\n\t}\n}","preventionTips":["Always list sessions ('sessions') immediately before acting on an ID","Treat IDs as ephemeral: re-lookup after any restart or timeout","Parse IDs from live output, never from saved notes or logs"],"tags":["cli","sessions","lookup"],"backgroundTag":"resource-not-found-by-id","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}