maotoumao/MusicFree · warning

toast.backupFileNotFound

Error message

toast.backupFileNotFound

What it means

Not a thrown exception but a user-facing warning toast in onResumeFromWebdav (backupSetting.tsx:150). It fires when the WebDAV server responds successfully but does not contain the expected backup file at /MusicFree/MusicFreeBackup.json, so resume is aborted early. The app deliberately guards the resume flow instead of letting getFileContents throw a generic 404.

Source

Thrown at src/pages/setting/settingTypes/backupSetting.tsx:150

    }

    async function onResumeFromWebdav() {
        const url = Config.getConfig("webdav.url");
        const username = Config.getConfig("webdav.username");
        const password = Config.getConfig("webdav.password");

        if (!(username && password && url)) {
            Toast.warn(t("toast.resumePreCheckFailed"));
            return;
        }
        const client = createClient(url, {
            authType: AuthType.Password,
            username: username,
            password: password,
        });

        if (!(await client.exists("/MusicFree/MusicFreeBackup.json"))) {
            Toast.warn(t("toast.backupFileNotFound"));
            return;
        }

        try {
            const resumeData = await client.getFileContents(
                "/MusicFree/MusicFreeBackup.json",
                {
                    format: "text",
                },
            );
            await Backup.resume(
                resumeData,
                Config.getConfig("backup.resumeMode"),
            );
            Toast.success(t("toast.resumeSuccess"));
        } catch (e: any) {
            Toast.warn(t("toast.resumeFail", { reason: e?.message ?? e }));
        }

View on GitHub (pinned to d118b18b3d)

Solutions

  1. Run 'backup to WebDAV' once to upload /MusicFree/MusicFreeBackup.json, then retry resume
  2. Verify webdav.url points to the same account/root where the backup was written
  3. Check the server (web UI) that /MusicFree/MusicFreeBackup.json exists at the exact root-relative path
  4. Re-create the file manually on the server with the JSON produced by Backup.backup()

Example fix

// before
if (!(await client.exists("/MusicFree/MusicFreeBackup.json"))) {
    Toast.warn(t("toast.backupFileNotFound"));
    return;
}
// after
const backupPath = Config.getConfig("webdav.backupPath") ?? "/MusicFree/MusicFreeBackup.json";
if (!(await client.exists(backupPath))) {
    await onBackupToWebdav(); // auto-upload a backup before resuming
    if (!(await client.exists(backupPath))) {
        Toast.warn(t("toast.backupFileNotFound"));
        return;
    }
}
Defensive patterns

Strategy: validation

Validate before calling

const backupPath = "/MusicFree/MusicFreeBackup.json";
if (!(await client.exists(backupPath))) {
    Toast.warn(t("toast.backupFileNotFound"));
    return;
}

Prevention

When it happens

Trigger: User taps 'resume from WebDAV' while webdav.url/username/password are configured and reachable, but client.exists('/MusicFree/MusicFreeBackup.json') returns false — no backup has ever been uploaded, it was deleted on the server, or it is stored under a different path.

Common situations: Fresh WebDAV account used before the first backup; backup stored manually under a custom path like /backups/xxx.json; server URL pointing to a different account/root directory than the one used when backing up; file removed by server-side cleanup.

Related errors


AI-assisted analysis of maotoumao/MusicFree@d118b18b3d (2026-08-30). Data as JSON: /api/errors/20b6b4539f82879b. Report an issue: GitHub.