JosefNemec/Playnite · error · Exception
Backup output path not specified!
Error message
Backup output path not specified!
What it means
Thrown by BackupData when neither OutputDir nor OutputFile is set on the supplied BackupOptions. The backup logic needs a concrete destination; with both null/empty it has nowhere to write the archive, so it aborts before doing any work.
Source
Thrown at source/Playnite/Backup.cs:77
private const string autoBackupFilePattern = autoBackupFileName + @"\-\d{4}\-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}";
private const string autoBackupFileName = "PlayniteBackup";
private const string libraryEntryRoot = "library";
private const string libraryFilesEntryRoot = "libraryfiles";
private const string extensionsDataEntryRoot = "extensiondata";
private const string extensionsEntryRoot = "extension";
private const string themesEntryRoot = "themes";
private static readonly string[] configFilesNames = new string[] { PlaynitePaths.ConfigFileName, PlaynitePaths.FullscreenConfigFileName };
public static void BackupData(string optionsFile, CancellationToken cancelToken)
{
BackupData(Serialization.FromJsonFile<BackupOptions>(optionsFile), cancelToken);
}
public static void BackupData(BackupOptions options, CancellationToken cancelToken)
{
if (options.OutputDir.IsNullOrEmpty() && options.OutputFile.IsNullOrEmpty())
{
throw new Exception("Backup output path not specified!");
}
if (!options.OutputDir.IsNullOrEmpty())
{
options.OutputFile = Path.Combine(options.OutputDir, GetAutoBackupFileName());
}
if (options.BackupItems == null)
{
options.BackupItems = new List<BackupDataItem>();
}
FileSystem.DeleteFile(options.OutputFile);
using (var zipFile = new FileStream(options.OutputFile, FileMode.Create))
using (var archive = new ZipArchive(zipFile, ZipArchiveMode.Create))
{
// Settings
foreach (var config in configFilesNames)
View on GitHub (pinned to 5911f4e964)
Solutions
- Set options.OutputDir to a valid directory (a timestamped filename is generated from it).
- Alternatively set options.OutputFile to an explicit full archive path.
- If loading options from JSON, validate the keys exist and are non-empty before calling BackupData.
- For CLI usage, pass the output path argument and confirm it is bound to the options.
Example fix
// before
var opts = new BackupOptions { BackupItems = items };
Backup.BackupData(opts, token);
// after
var opts = new BackupOptions { OutputDir = @"D:\Backups\Playnite", BackupItems = items };
if (opts.OutputDir.IsNullOrEmpty() && opts.OutputFile.IsNullOrEmpty())
throw new InvalidOperationException("Backup destination required.");
Backup.BackupData(opts, token); Defensive patterns
Strategy: validation
Validate before calling
if (options.OutputDir.IsNullOrEmpty() && options.OutputFile.IsNullOrEmpty())
{
throw new InvalidOperationException("Specify BackupOptions.OutputDir or OutputFile.");
}
Backup.BackupData(options, cancelToken); Try / catch
try { Backup.BackupData(options, cancelToken); }
catch (Exception e) when (e.Message.Contains("output path", StringComparison.OrdinalIgnoreCase))
{ logger.Error(e, "Backup destination missing."); } Prevention
- Always set OutputDir or OutputFile on BackupOptions.
- Validate options JSON keys before deserializing into BackupData(optionsFile).
- Unit-test the backup path with a known destination.
When it happens
Trigger: Calling BackupData(options, cancelToken) where options.OutputDir and options.OutputFile are both null or empty strings (IsNullOrEmpty returns true for each).
Common situations: A config file passed to BackupData(optionsFile, ...) omits the output fields; CLI/script invokes the backup with no destination flag; a serialized BackupOptions round-trip dropped the destination; typo in the JSON key name.
Related errors
- No URL was given.
- Source directory does not exist or could not be found: {sour
- The icon is corrupt. Couldn't read the header.
- Non empty process name must be specified.
- Cannot start process, executable path is specified.
AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13).
Data as JSON: /api/errors/886f3b6e9367aea4.
Report an issue: GitHub.