Skip to main content

mnamer False Success Reports - Files Not Moving

· 2 min read

Debugging a media organization script that was reporting "SUCCESS" for files that weren't actually being moved. A case study in the importance of proper success detection beyond exit codes.

Problem

The mnamer media organization script on hecate was reporting "SUCCESS: Organized" for files even when they weren't actually being moved. User observed files staying in /mnt/2TB_SLOW/torrents/plex/Shows/ instead of being moved to proper destinations like /mnt/2TB_SLOW/Movies or /mnt/2TB_SLOW/TV Shows.

Root Cause Analysis

Investigation Findings

  1. mnamer is misidentifying files: Generic filenames like "4 - Now.mp4" are being identified as the movie "Slow (2021)" instead of Wim Hof Method content
  2. Files already exist in target: Multiple versions of "Slow (2021)" already exist in /mnt/2TB_SLOW/Movies/Slow (2021)/
  3. --no-overwrite prevents duplicates: mnamer skips files that would overwrite existing ones
  4. Script logic flaw: The organization script reports "SUCCESS" based on mnamer exit code (0) rather than actual file processing

Technical Details

  • mnamer misidentifies "4 - Now.mp4" as movie "Slow" due to generic filename
  • Target file /mnt/2TB_SLOW/Movies/Slow (2021)/Slow (2021).mp4 already exists
  • mnamer returns exit code 0 even when "0 out of 1 files processed successfully"
  • The script uses timeout 300 "$MNAMER_BIN" --batch --no-overwrite --recurse "$file" and considers exit code 0 as success
  • Log shows: skipping (--no-overwrite) followed by 0 out of 1 files processed successfully
  • Script still logs: SUCCESS: Organized $file

Evidence

# File still in original location after "SUCCESS"
/mnt/2TB_SLOW/torrents/plex/Shows/Wim Hof Method - Power of The Mind/9 - Meditation/4 - Now.mp4

# mnamer misidentifies it as:
search parameters: name = Slow, year = None

# Target already exists:
/mnt/2TB_SLOW/Movies/Slow (2021)/Slow (2021).mp4

Resolution

Immediate Fix

The organization script needs to parse mnamer output to determine if files were actually processed, not just rely on exit codes.

Prevention

  • Implement proper success detection in media organization scripts
  • Add validation that files actually moved to target locations
  • Consider adding a "dry-run" mode to preview what would be organized

Files Affected

  • /home/dev/bin/organize_media.sh on hecate server
  • /home/dev/logs/mnamer.log (misleading success messages)

Status

  • Identified: 2025-06-15 16:30
  • Root Cause: Script logic flaw in success detection
  • Resolution: Pending script update