SillyTavern/SillyTavern · error

Internal Server Error

Error message

Internal Server Error

What it means

HTTP 500 from the World Info list/index route's catch block. The handler reads and parses every JSON file in the user's worlds directory; any unexpected error (typically a FS-level failure reading the directory itself) is logged and returned as a generic 500.

Source

Thrown at src/endpoints/worldinfo.js:67

                const fileContents = await fs.promises.readFile(filePath, 'utf8');
                const fileContentsParsed = tryParse(fileContents) || {};
                const fileExtensions = fileContentsParsed?.extensions || {};
                const fileNameWithoutExt = path.parse(file.name).name;
                const fileData = {
                    file_id: fileNameWithoutExt,
                    name: fileContentsParsed?.name || fileNameWithoutExt,
                    extensions: _.isObjectLike(fileExtensions) ? fileExtensions : {},
                };
                data.push(fileData);
            } catch (err) {
                console.warn(`Error reading or parsing World Info file ${file.name}:`, err);
            }
        }

        return response.send(data);
    } catch (err) {
        console.error('Error reading World Info directory:', err);
        return response.sendStatus(500);
    }
});

router.post('/get', (request, response) => {
    if (!request.body?.name) {
        return response.sendStatus(400);
    }

    const file = readWorldInfoFile(request.user.directories, request.body.name, true);

    return response.send(file);
});

router.post('/delete', (request, response) => {
    if (!request.body?.name) {
        return response.sendStatus(400);
    }

View on GitHub (pinned to 8172dcd0ee)

Solutions

  1. Confirm `data/<user>/worlds` exists and is readable by the server process.
  2. Check server log for `Error reading World Info directory:` to see the real errno.
  3. Fix ownership/permissions on the data directory, or recreate the worlds folder.
  4. If the volume is read-only or unmounted, remount/repair it and retry.

Example fix

// before
// (client just receives 500 with no detail)
// after - ensure dir exists at startup
fs.mkdirSync(path.join(userDir, 'worlds'), { recursive: true });
Defensive patterns

Strategy: try-catch

Validate before calling

import fs from 'node:fs';
fs.mkdirSync(path.join(userDir, 'worlds'), { recursive: true });
await fs.promises.access(path.join(userDir, 'worlds'), fs.constants.R_OK);

Try / catch

try { /* read worlds dir */ } catch (err) { console.error('Error reading World Info directory:', err); if (err.code === 'ENOENT') { /* recreate and retry */ } else { response.sendStatus(500); } }

Prevention

When it happens

Trigger: fs.readdir or stat on `request.user.directories.worlds` throws (ENOENT if the worlds dir does not exist, EACCES on permission denied), or another low-level FS error occurs before per-file parsing. Individual file parse errors are swallowed (only warned), so a 500 implies the directory read itself failed.

Common situations: The worlds directory was deleted or never created for the user; data dir on an unmounted/read-only volume; server process lacks read permission on the worlds folder; symlink loop or broken symlink in the worlds path.

Understand the failure class

Related errors


AI-assisted analysis of SillyTavern/SillyTavern@8172dcd0ee (2026-08-13). Data as JSON: /api/errors/ed386115f374d25c. Report an issue: GitHub.