# Atlas error: Session not found or Message not found

> Run `atlas session` to list real session ids and copy one verbatim: Atlas ids are branded, so a session id that lacks the session prefix is rejected by the id decoder.

Atlas fails with Session not found: <id>, or Message not found: <id>, because message-v2 raises the storage NotFoundError when the session or message row is missing. From the CLI, a bad id fails earlier with Invalid session ID: <reason>, because the TUI entrypoint validates the session id shape first. The fix is to run `atlas session` to list real session ids and copy one, and to check the prefix, since ids are branded and must start with the session prefix.

## Symptom

An operation fails with: Session not found: <id>, or: Message not found: <id>. From the CLI, a bad id fails earlier with: Invalid session ID: <reason>.

## Cause

message-v2 raises the storage NotFoundError when the session or message row is missing. The TUI entrypoint validates the session id shape first and throws its own Invalid session ID error with the decode reason as the cause.

## Fix

1. Run `atlas session` to list real session ids and copy one.
2. Check the prefix: ids are branded, so a session id must start with the session prefix or the id decoder rejects it.
3. If the session was deleted, start a new one; there is nothing to resume.
4. For a message id, re-read the session transcript rather than reusing an id from an older run.

## Why does Atlas say Session not found

Atlas says Session not found: <id> because message-v2 raises the storage NotFoundError when the session row is missing. The same code path produces Message not found: <id> for a missing message row, so in the 2026 build both errors mean storage was queried and came back empty.

A NotFoundError is a storage answer, not a permissions problem or a crash. Atlas asked for the row named by that id and there was nothing there. Three situations produce it. The id is correct but the session was deleted, so nothing remains to resume. The id belongs to a different machine or a different install, so the row exists somewhere else. Or the id was copied from an old transcript or a stale note and no longer corresponds to anything. In every case the resolution starts with getting a real, current id rather than debugging the storage layer.

## How to find a real Atlas session id

Run `atlas session` to list real session ids and copy 1 verbatim. That listing is the authoritative source, and copying rather than typing avoids both failures at once: Session not found: <id> from storage, and Invalid session ID: <reason> from the TUI entrypoint's shape validation.

Copy the id character for character. Atlas session ids are branded, meaning the string carries a prefix that identifies what kind of id it is, and the decoder checks that prefix before anything touches storage. Hand-typing an id, truncating it, or reconstructing it from memory is how developers end up with a value that looks plausible and decodes to nothing. If the session you want is not in the `atlas session` listing at all, it does not exist on this machine, and no id will retrieve it.

## What does Invalid session ID mean in Atlas

Invalid session ID: <reason> means the Atlas TUI entrypoint rejected the id's shape before ever querying storage. Session ids are branded, so an id missing the session prefix fails the decoder. That is why a malformed id trips 1 error earlier than Session not found: <id>, which comes from storage.

The two errors sit at different layers, and the one you get tells you where the problem is. Invalid session ID: <reason> means the string did not decode, most often because the prefix is wrong: ids are branded, so a session id must start with the session prefix or the id decoder rejects it. Session not found: <id> means the string decoded fine and storage simply had no such row. Fixing a decode failure is about the shape of the id. Fixing a NotFoundError is about whether the session still exists at all.

## How to fix a missing Atlas message id

For a Message not found: <id> error in Atlas, re-read the session transcript rather than reusing an id from an older run. message-v2 raises the storage NotFoundError when the message row is missing, and message ids from a previous session do not carry over to a new one.

Message ids are per-session artifacts. Pulling one out of yesterday's notes, a shell history line, or a script that hardcoded it will produce a NotFoundError as soon as the message row is gone or the session it belonged to was replaced. Re-read the transcript of the session you are actually working in and take the current id from there. If you are automating against the server API, resolve message ids at runtime from the session you just queried instead of persisting them across runs, since they are not stable handles to reuse later.

## What to do when an Atlas session was deleted

If the Atlas session was deleted, start a new one: there is nothing to resume, and Session not found: <id> is the correct and final answer from storage. No id repair, prefix fix, or retry will bring back a session row that message-v2 reports as missing.

Accept the deletion and move forward. Your code is not lost with the session, because Atlas snapshots file changes as git patches so edits can be diffed and rolled back, and Atlas reads git branches, status, and diffs, and can stage and create commits on your behalf. The work that landed on disk is still on disk. Start a fresh session, point Atlas at the repository, and let it re-derive context. Verify the new session id by running `atlas session` and confirming it appears in the listing before you script against it.

## FAQ

### how to fix Session not found in Atlas

Run `atlas session` to list real session ids and copy one verbatim. Session not found: <id> means message-v2 raised the storage NotFoundError because no session row matches that id.

### what does Invalid session ID mean in Atlas

The TUI entrypoint validates the session id shape first and throws Invalid session ID: <reason> with the decode reason as the cause. The id did not decode, so storage was never queried.

### why does my Atlas session id get rejected by the decoder

Atlas ids are branded, so a session id must start with the session prefix or the id decoder rejects it. Copy the id exactly as it appears in the `atlas session` listing.

### can I resume a deleted Atlas session

No. If the session was deleted, start a new one; there is nothing to resume. Session not found: <id> is storage reporting that the row is gone.

### how to fix Message not found in Atlas

Re-read the session transcript rather than reusing an id from an older run. message-v2 raises the storage NotFoundError when the message row is missing.

### why does the same Atlas id fail differently from the CLI and the API

The TUI entrypoint validates the id shape first, so a malformed id fails there with Invalid session ID: <reason>. A well-formed id that has no row fails later in storage with Session not found: <id>.

---

Canonical HTML: https://runatlas.sh/resources/troubleshooting/session-not-found
Source of truth: aeo_pages row `/resources/troubleshooting/session-not-found` (segment: Troubleshooting) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
