SillyTavern/SillyTavern · warning
Not Found
Error message
Not Found
What it means
HTTP 404 returned by POST /api/characters/get when the character .png file referenced by avatar_url does not exist in the user's characters directory. The server constructs the full path via path.join and checks fs.existsSync before calling processCharacter.
Source
Thrown at src/endpoints/characters.js:1485
const pngFiles = files.filter(file => file.endsWith('.png'));
const processingPromises = pngFiles.map(file => processCharacter(file, request.user.directories, { shallow: useShallowCharacters }));
const data = (await Promise.all(processingPromises)).filter(c => c.name);
return response.send(data);
} catch (err) {
console.error(err);
const isRangeError = err instanceof RangeError;
response.status(500).send({ overflow: isRangeError, error: true });
}
});
router.post('/get', validateAvatarUrlMiddleware, async function (request, response) {
try {
if (!request.body) return response.sendStatus(400);
const item = request.body.avatar_url;
const filePath = path.join(request.user.directories.characters, item);
if (!fs.existsSync(filePath)) {
return response.sendStatus(404);
}
const data = await processCharacter(item, request.user.directories, { shallow: false });
return response.send(data);
} catch (err) {
console.error(err);
response.sendStatus(500);
}
});
router.post('/chats', validateAvatarUrlMiddleware, async function (request, response) {
try {
if (!request.body) return response.sendStatus(400);
const characterDirectory = (request.body.avatar_url).replace('.png', '');
const chatsDirectory = path.join(request.user.directories.chats, characterDirectory);
View on GitHub (pinned to 8172dcd0ee)
Solutions
- Refresh the character list via /api/characters/all to get current avatar_url values.
- Handle the 404 in the client by removing the stale character from the UI.
- Verify avatar_url matches an entry from the character list before requesting it.
Defensive patterns
Strategy: validation
Validate before calling
// Check character existence before fetching details
async function getCharacterSafely(avatar_url) {
const resp = await fetch('/api/characters/get', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ avatar_url }),
});
if (resp.status === 404) {
console.warn(`Character ${avatar_url} not found, may have been deleted`);
return null;
}
return resp.json();
} Prevention
- Refresh the character list periodically to keep avatar_url values current.
- Handle 404 gracefully by removing the character from the client UI.
- Never hard-code avatar_url values — always derive them from the /all endpoint.
When it happens
Trigger: POST /api/characters/get with an avatar_url for a character that was deleted, renamed, or never existed on this server instance.
Common situations: Stale client cache referencing a deleted character; avatar_url typo or truncation; cross-environment mismatch (dev vs production character sets).
Related errors
- Not Found
- Error: character file does not exist
- Bad Request
- MiniMax key is missing.
- Azure OpenAI configuration is incomplete. Please provide Bas
AI-assisted analysis of SillyTavern/SillyTavern@8172dcd0ee (2026-08-13).
Data as JSON: /api/errors/dd4199763a918a8d.
Report an issue: GitHub.