SillyTavern/SillyTavern · error · Error

Failed to get settings snapshots

Error message

Failed to get settings snapshots

What it means

Thrown by `getSnapshots` after POST `/api/settings/get-snapshots` returns a non-ok response. Notably the catch returns `[]`, so callers receive an empty list rather than seeing the error. The request uses `omitContentType: true`.

Source

Thrown at public/scripts/user.js:547

/**
 * Gets a list of settings snapshots.
 * @returns {Promise<Snapshot[]>} List of snapshots
 * @typedef {Object} Snapshot
 * @property {string} name Snapshot name
 * @property {number} date Date in milliseconds
 * @property {number} size File size in bytes
 */
async function getSnapshots() {
    try {
        const response = await fetch('/api/settings/get-snapshots', {
            method: 'POST',
            headers: getRequestHeaders({ omitContentType: true }),
        });

        if (!response.ok) {
            const data = await response.json();
            toastr.error(data.error || 'Unknown error', 'Failed to get settings snapshots');
            throw new Error('Failed to get settings snapshots');
        }

        const snapshots = await response.json();
        return snapshots;
    } catch (error) {
        console.error('Error getting settings snapshots:', error);
        return [];
    }
}

/**
 * Make a snapshot of the current settings.
 * @param {function} callback Success callback
 * @returns {Promise<void>}
 */
async function makeSnapshot(callback) {
    try {
        const response = await fetch('/api/settings/make-snapshot', {

View on GitHub (pinned to 8172dcd0ee)

Solutions

  1. Confirm `/api/settings/get-snapshots` is registered and returns 200.
  2. Check server logs since the empty-array fallback hides the real error.
  3. Verify session validity and directory permissions.

Example fix

// before
const snaps = await getSnapshots(); // silent [] on error
// after
const r = await fetch('/api/settings/get-snapshots', { method: 'POST', headers: getRequestHeaders({ omitContentType: true }) });
if (!r.ok) console.error('snapshots failed', await r.json());
Defensive patterns

Strategy: fallback

Try / catch

let snaps = []; try { snaps = await getSnapshots(); } catch (e) { console.error(e); }

Prevention

When it happens

Trigger: Backend endpoint error; permissions denied on the snapshots directory; session expired; misconfigured content-type header rejected by middleware.

Common situations: Snapshots feature disabled or misconfigured; deployment where the endpoint is not registered; silent failure mistaken for 'no snapshots'.

Related errors


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