Files
pgsql-jellyfin/docs/MARKER_CONFLICT_FIX.md
T
wjones 33d7c010fb Jellyfin 11.0.0-PostgreSQL PREVIEW: version bump & defaults
- Update version to 11.0.0-PostgreSQL-PREVIEW in assemblies, installer, and build scripts
- Default web directory is now "wwwroot" across all platforms
- Configuration manager now creates .example files if missing
- Set PostgreSQL as default database with sensible options
- Postgres provider ensures database exists before table checks
- Add docs for marker conflict fixes and startup.json path issues
- Version string in logs/UI uses informational version
- Installer output filename and wizard show PREVIEW suffix
- Documentation summarizes version bump and verification steps
2026-02-27 13:45:09 -05:00

8.3 KiB

Fix Jellyfin Marker Conflict Error

Error: Expected to find only .jellyfin-data but found marker for .jellyfin-config
Cause: Config and data directories point to same location
Solution: Delete old markers or fix directory configuration


Quick Fix: Delete Old Markers

# Remove conflicting marker files
Remove-Item "C:\ProgramData\jellyfin\.jellyfin-config" -Force
Remove-Item "C:\ProgramData\jellyfin\log\.jellyfin-log" -Force -ErrorAction SilentlyContinue
Remove-Item "C:\ProgramData\jellyfin\plugins\.jellyfin-plugin" -Force -ErrorAction SilentlyContinue

# Or remove entire directory and start fresh
Remove-Item "C:\ProgramData\jellyfin" -Recurse -Force

# Then restart Jellyfin

Root Cause

What Are Marker Files?

Jellyfin creates hidden marker files (.jellyfin-*) to identify:

  • .jellyfin-config - Config directory
  • .jellyfin-data - Data directory
  • .jellyfin-log - Log directory
  • .jellyfin-plugin - Plugin directory
  • .jellyfin-cache - Cache directory

The Problem

Your current state:

C:\ProgramData\jellyfin\
  ├── .jellyfin-config      ← From old installation
  ├── .jellyfin-data         ← Trying to create
  ├── log\
  │   └── .jellyfin-log
  └── plugins\
      └── .jellyfin-plugin

What happened:

  1. Previous installation used C:\ProgramData\jellyfin\ as config dir
  2. Now trying to use same folder as data dir
  3. Sanity check fails - can't be both!

Step 1: Backup Your Data (If Needed)

# If you have existing data
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
Copy-Item "C:\ProgramData\jellyfin" "C:\ProgramData\jellyfin-backup-$timestamp" -Recurse -Force

Step 2: Delete Old Installation Data

# Remove everything
Remove-Item "C:\ProgramData\jellyfin" -Recurse -Force

# Verify
Test-Path "C:\ProgramData\jellyfin"
# Should return: False

Step 3: Start Jellyfin

cd E:\Projects\pgsql-jellyfin\lib\Release\net11.0
dotnet jellyfin.dll

# Jellyfin will:
# 1. Create C:\ProgramData\jellyfin\
# 2. Create proper marker files
# 3. Initialize fresh configuration

Solution 2: Use Separate Directories

Configure Different Paths

Create: C:\ProgramData\jellyfin\startup.json

{
  "DataPath": "C:\\ProgramData\\jellyfin\\data",
  "ConfigPath": "C:\\ProgramData\\jellyfin\\config",
  "LogPath": "C:\\ProgramData\\jellyfin\\log",
  "CachePath": "C:\\ProgramData\\jellyfin\\cache"
}

Then Clean Up

# Remove old markers
Remove-Item "C:\ProgramData\jellyfin\.jellyfin-*" -Force -ErrorAction SilentlyContinue

# Start Jellyfin
dotnet jellyfin.dll --datadir "C:\ProgramData\jellyfin\data"

Solution 3: Use Custom Data Directory

Start with Custom Path

# Use project folder for development
cd E:\Projects\pgsql-jellyfin\lib\Release\net11.0
dotnet jellyfin.dll --datadir "E:\Projects\pgsql-jellyfin\dev-data"

# Or use a different system directory
dotnet jellyfin.dll --datadir "C:\jellyfin-dev\data"

PowerShell Quick Fix Script

# Quick cleanup script
Write-Host "Fixing Jellyfin marker conflict..." -ForegroundColor Cyan

# Backup existing data
if (Test-Path "C:\ProgramData\jellyfin\library.db") {
    $backup = "C:\ProgramData\jellyfin-backup-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
    Write-Host "Backing up to: $backup" -ForegroundColor Yellow
    Copy-Item "C:\ProgramData\jellyfin" $backup -Recurse -Force
}

# Remove conflicting markers
Write-Host "Removing conflicting markers..." -ForegroundColor Cyan
Remove-Item "C:\ProgramData\jellyfin\.jellyfin-*" -Force -ErrorAction SilentlyContinue

# Clean subdirectory markers
Get-ChildItem "C:\ProgramData\jellyfin" -Recurse -Filter ".jellyfin-*" | Remove-Item -Force

Write-Host "✅ Markers removed - restart Jellyfin" -ForegroundColor Green

Understanding the Error

Code Flow

File: Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs

// Line 97: Check all paths
public virtual void MakeSanityCheckOrThrow()
{
    CreateAndCheckMarker(ConfigurationDirectoryPath, "config");  // Creates .jellyfin-config
    CreateAndCheckMarker(LogDirectoryPath, "log");               // Creates .jellyfin-log
    CreateAndCheckMarker(PluginsPath, "plugin");                 // Creates .jellyfin-plugin
    CreateAndCheckMarker(ProgramDataPath, "data");               // Creates .jellyfin-data ← ERROR HERE
    CreateAndCheckMarker(CachePath, "cache");                    // Creates .jellyfin-cache
    CreateAndCheckMarker(DataPath, "data");                      // Creates .jellyfin-data
}

// Line 115-130: Check for conflicts
private void CheckOrCreateMarker(string path, string markerName, bool recursive = false)
{
    // Find OTHER markers in this directory
    otherMarkers = GetMarkers(path, recursive)
        .FirstOrDefault(e => !Path.GetFileName(e).Equals(markerName));
    
    // If found other markers → ERROR
    if (otherMarkers is not null)
    {
        throw new InvalidOperationException(
            $"Expected to find only {markerName} but found marker for {otherMarkers}.");
    }
    
    // Create marker file
    File.Create(Path.Combine(path, markerName));
}

What's happening:

  1. Code tries to create .jellyfin-data in C:\ProgramData\jellyfin\
  2. Finds existing .jellyfin-config there
  3. Throws error because one folder can't be both config AND data

Why This Happens

Common Causes

  1. Previous Installation - Old Jellyfin used that directory
  2. Configuration Mix-up - Paths not configured correctly
  3. Upgrade Issue - Migrating from different version
  4. Manual Configuration - Manually set conflicting paths

Your Situation

Based on the error, your paths are likely:

  • ConfigPath: C:\ProgramData\jellyfin (has .jellyfin-config)
  • DataPath: C:\ProgramData\jellyfin (trying to create .jellyfin-data)

Problem: Same directory for both!


Quick 3-Step Fix

# Step 1: Stop Jellyfin if running
Stop-Process -Name "jellyfin" -Force -ErrorAction SilentlyContinue

# Step 2: Remove marker files
Remove-Item "C:\ProgramData\jellyfin\.jellyfin-config" -Force -ErrorAction SilentlyContinue
Remove-Item "C:\ProgramData\jellyfin\.jellyfin-data" -Force -ErrorAction SilentlyContinue
Get-ChildItem "C:\ProgramData\jellyfin" -Filter ".jellyfin-*" -Recurse | Remove-Item -Force

# Step 3: Restart Jellyfin
cd E:\Projects\pgsql-jellyfin\lib\Release\net11.0
dotnet jellyfin.dll

This will:

  • Remove conflicting markers
  • Let Jellyfin recreate them correctly
  • Use default directory structure

If Problem Persists

Check Your Startup Configuration

  1. Check for startup.json:

    Get-Content "C:\ProgramData\jellyfin\startup.json" -ErrorAction SilentlyContinue
    
  2. Check environment variables:

    Get-ChildItem Env: | Where-Object { $_.Name -like "*JELLYFIN*" }
    
  3. Check command line args:

    • Are you passing --datadir or --configdir?

Prevention

Proper Directory Structure

Windows default:

C:\ProgramData\jellyfin\
  ├── config\           ← Config files (.jellyfin-config marker)
  ├── data\             ← Database files (.jellyfin-data marker)
  ├── log\              ← Log files (.jellyfin-log marker)
  ├── cache\            ← Cache files (.jellyfin-cache marker)
  └── plugins\          ← Plugins (.jellyfin-plugin marker)

Each subdirectory has its own marker - no conflicts!


Files to Check/Delete

# List all markers
Get-ChildItem "C:\ProgramData\jellyfin" -Filter ".jellyfin-*" -Recurse | 
    Select-Object FullName | 
    ForEach-Object { Write-Host $_.FullName }

Expected after fix:

C:\ProgramData\jellyfin\.jellyfin-data
C:\ProgramData\jellyfin\config\.jellyfin-config
C:\ProgramData\jellyfin\log\.jellyfin-log
C:\ProgramData\jellyfin\cache\.jellyfin-cache
C:\ProgramData\jellyfin\plugins\.jellyfin-plugin

Summary

Error: InvalidOperationException - conflicting markers
Cause: Multiple marker files in same directory
Fix: Delete conflicting markers
Prevention: Use separate subdirectories for each purpose

Quick command:

Remove-Item "C:\ProgramData\jellyfin\.jellyfin-config" -Force

Then restart Jellyfin!