7eb2b445cb
- Major query performance boost: replaced correlated subqueries with DistinctBy() in BaseItemRepository, added episode deduplication index, and increased default command timeout to 120s. - Fixed LibraryMonitor shutdown race: added disposal checks and exception handling in FileRefresher to prevent ObjectDisposedException. - Added PowerShell and SQL utilities for fixing Linux paths in config files and database; new scripts for WebDir and path migration. - Auto-fix for WebDir in startup.json on load; new helper scripts and docs. - Added automated weekly DB performance monitoring scripts and reporting. - Expanded documentation and README for all fixes, scripts, and migration steps. - Updated SQL scripts for index creation and diagnostics; improved output handling. - Updated db-config defaults and added new diagnostic/report files.
3.5 KiB
3.5 KiB
Check and Fix system.xml MetadataPath on Windows
Problem
Even though database stores %MetadataPath%\People, the logs show Linux paths.
This means system.xml has a Linux path configured for MetadataPath.
Where to Check
1. Check your system.xml file
Location: C:\ProgramData\jellyfin\config\system.xml (or your config directory)
Look for this line:
<MetadataPath>/var/lib/jellyfin/metadata</MetadataPath>
2. What it should be
Option A: Empty (Use default)
<MetadataPath></MetadataPath>
or
<MetadataPath/>
Option B: Windows path
<MetadataPath>C:\ProgramData\jellyfin\data\metadata</MetadataPath>
How to Fix
Method 1: Via Jellyfin Dashboard (Recommended)
- Open Jellyfin Dashboard
- Go to Advanced → Paths
- Look for Metadata path
- Clear it (to use default) or set it to a Windows path
- Save
- Restart Jellyfin
Method 2: Edit system.xml Manually
- Stop Jellyfin service/application
- Open
C:\ProgramData\jellyfin\config\system.xmlin a text editor - Find the
<MetadataPath>line - Change from:
To:
<MetadataPath>/var/lib/jellyfin/metadata</MetadataPath>or<MetadataPath></MetadataPath><MetadataPath>C:\ProgramData\jellyfin\data\metadata</MetadataPath> - Save the file
- Start Jellyfin
Method 3: PowerShell Script (Automated)
# Path to your Jellyfin config directory
$configPath = "C:\ProgramData\jellyfin\config\system.xml"
# Backup first
Copy-Item $configPath "$configPath.backup.$(Get-Date -Format 'yyyyMMdd_HHmmss')"
# Read the XML
[xml]$xml = Get-Content $configPath
# Check current MetadataPath
Write-Host "Current MetadataPath: $($xml.ServerConfiguration.MetadataPath)"
# Update to empty (use default) or set a Windows path
$xml.ServerConfiguration.MetadataPath = ""
# Or set to specific path:
# $xml.ServerConfiguration.MetadataPath = "C:\ProgramData\jellyfin\data\metadata"
# Save
$xml.Save($configPath)
Write-Host "Updated MetadataPath to: $($xml.ServerConfiguration.MetadataPath)"
Write-Host "Please restart Jellyfin for changes to take effect"
Or use the automated script:
.\FixJellyfinPaths.ps1 -DryRun # Preview changes
.\FixJellyfinPaths.ps1 # Apply fixes
Verification
After fixing, check the logs to see if the Linux paths are gone.
The error should change from:
[WRN] Image not found at "/var/lib/jellyfin/metadata/People/D/David L.M. McIntyre/folder.jpg"
To:
[WRN] Image not found at "C:\ProgramData\jellyfin\data\metadata\People\D\David L.M. McIntyre\folder.jpg"
Why This Happens
- Database stores:
%MetadataPath%\People\D\David L.M. McIntyre\folder.jpg - Jellyfin expands
%MetadataPath%using the value fromsystem.xml - If
system.xmlhas/var/lib/jellyfin/metadata, the expanded path becomes:/var/lib/jellyfin/metadata\People\D\David L.M. McIntyre\folder.jpg - This creates a mixed Linux/Windows path that doesn't exist
Other Files to Check
If the issue persists, also check:
encoding.xml- ForTranscodingTempPathnetwork.xml- For any path configurationsdatabase.xml- Though this is less likely to have path issues
Root Cause
When you migrated from Linux to Windows, the system.xml configuration file was copied over with Linux paths intact. The database correctly stores virtual paths (%MetadataPath%), but the virtual path is expanded using the incorrect Linux path from the config file.