wandb/openui · warning · HTTPException
No session found
Error message
No session found
What it means
Raised by OpenUI's GET session endpoint: the handler can identify the logged-in user but no session record matching the requested session exists (the else branch before falling back to session_store), so it returns HTTP 404 'No session found'. It signals the requested session id is unknown or was never persisted.
Source
Thrown at backend/openui/server.py:493
except IntegrityError:
user = User.get(User.username == getpass.getuser())
user_id = user.id
if user.email is None:
user.email = get_git_user_email()
user.save()
request.session["user_id"] = str(user_id)
session_store.write(
request.session["session_id"],
str(user_id),
SessionData(
username=user.username,
token_count=0,
max_tokens=config.MAX_TOKENS,
email=user.email,
),
)
else:
raise HTTPException(status_code=404, detail="No session found")
session_data = session_store.get(session_id)
return JSONResponse(
content=session_data.model_dump(),
status_code=200,
)
@router.delete(
"/v1/session",
tags=["openui/session"],
)
async def delete_session(
request: Request,
):
session_id = request.session.get("session_id")
if session_id is None:
raise HTTPException(status_code=404, detail="No session found")
request.session.pop("session_id")View on GitHub (pinned to 42d7ab4ab6)
Solutions
- Create a new session (POST the session endpoint) and use the returned session id instead of the stale one.
- If your deployment relies on session_store, add persistent storage (e.g. Redis) or expect loss on restart.
- Verify the request's authenticated user actually owns the requested session id.
- Handle 404 in the client by resetting local session state and re-initializing.
Example fix
// before
const res = await fetch(`/session/${oldId}`); // 404 after restart
// after
let res = await fetch(`/session/${oldId}`);
if (res.status === 404) {
res = await fetch('/session', { method: 'POST' }); // create new session
} Defensive patterns
Strategy: fallback
Validate before calling
const res = await fetch(`/session/${sessionId}`);
if (res.status === 404) {
sessionId = null; // invalidate local reference
const created = await fetch("/session", { method: "POST" });
sessionId = (await created.json()).id;
} Type guard
function hasSession(state): state is State & { sessionId: string } {
return typeof state.sessionId === "string" && state.sessionId.length > 0;
} Prevention
- Don't persist session ids across server restarts unless the store is persistent
- Back session_store with Redis or the DB for durability
- Re-fetch or recreate sessions on any 404 instead of retrying the same id
- Scope session ids to the owning user and validate ownership before use
When it happens
Trigger: GETting a session whose id exists in neither the database (User's associated session) nor the in-memory session_store — e.g. requesting a session id that was never created, belongs to another user, or was created before a server restart wiped the in-memory store.
Common situations: Client bookmarks/caches an old session id after server restart (session_store is memory-resident), sharing session ids across users, or a race where the session row was deleted while the client still holds the id.
Related errors
- Login required to use OpenUI
- Invalid model
- You've exceeded our usage quota, come back tomorrow to gener
- Model not supported
- Groq API key is not set.
AI-assisted analysis of wandb/openui@42d7ab4ab6 (2026-09-01).
Data as JSON: /api/errors/5d52ea6169244b88.
Report an issue: GitHub.