JosefNemec/Playnite · error · Exception
Can't scan emulation directory, {directory} doesn't exist.
Error message
Can't scan emulation directory, {directory} doesn't exist. What it means
Thrown by ScanDirectory (the low-level overload taking supportedExtensions/scanPlatforms) when FileSystem.DirectoryExists(directory) is false. The scan requires a real, accessible directory on disk; a missing or inaccessible path is a fatal precondition failure.
Source
Thrown at source/Playnite/Emulators/Scanner.cs:665
mergeRelatedFiles,
fileScanCallback);
}
private List<ScannedGame> ScanDirectory(
string directory,
List<string> supportedExtensions,
List<string> scanPlatforms,
CancellationToken cancelToken,
string crcExludePatterns,
bool scanSubfolders,
bool scanArchives,
bool mergeRelatedFiles,
Action<string> fileScanCallback = null)
{
logger.Info($"Scanning emulated directory {directory}.");
if (!FileSystem.DirectoryExists(directory))
{
throw new Exception($"Can't scan emulation directory, {directory} doesn't exist.");
}
var emuDbs = emuDbProvider(scanPlatforms);
var resultGames = new List<ScannedGame>();
try
{
ScanDirectoryBase(
directory,
supportedExtensions,
emuDbs,
resultGames,
cancelToken,
crcExludePatterns,
scanSubfolders,
scanArchives,
mergeRelatedFiles,
fileScanCallback);
View on GitHub (pinned to 5911f4e964)
Solutions
- Verify the directory exists and is accessible (Directory.Exists) before initiating the scan.
- Update the scan configuration to point at the current ROM location.
- For removable/network paths, confirm the drive is mounted or the share is reachable before scanning.
Example fix
// before
if (!FileSystem.DirectoryExists(directory)) { throw new Exception($"Can't scan emulation directory, {directory} doesn't exist."); }
// after — caller-side guard
if (!Directory.Exists(scanDir)) {
logger.Warn($"Scan directory not found: {scanDir}. Skipping.");
continue;
} Defensive patterns
Strategy: validation
Validate before calling
// Confirm the directory exists before invoking ScanDirectory.
if (!Directory.Exists(directory)) {
logger.Warn($"Scan directory missing: {directory}");
return;
} Try / catch
try { ScanDirectory(...); }
catch (Exception ex) when (ex.Message.Contains("doesn't exist")) {
logger.Warn($"Scan directory unavailable: {directory}");
} Prevention
- Validate scan directories at config-save time.
- For removable/network paths, check existence right before scanning.
- Allow users to re-locate missing ROM directories from the scan UI.
When it happens
Trigger: Calling ScanDirectory with a directory path that does not exist on disk — an unmounted drive, a moved/deleted ROM folder, a network path that is offline, or a typo in the scan configuration.
Common situations: External ROM drive disconnected; network share unavailable; user moved their ROM library but did not update the scan directory; portable drive letter changed.
Related errors
- Emulator startup script not found.
- {directory} not found.
- Emulator not found.
- No emulator profile specified.
- Assigned custom emulator profile not found.
AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13).
Data as JSON: /api/errors/a6d8b66ebe2e7e15.
Report an issue: GitHub.