Running Sonic/Loudness Analysis on ephemeral cloud instance - API or CLI approach?

jbo44112
Wed, 03 Dec 2025 22:28:16 +0000
Dev/API Corner

Hello,

I’m spinning up temporary Plex servers in the cloud to scan my 9TB library, then exporting the database back to my low-power zimaboard which is too slow for initial library scanning (especially Sonic analysis on 7TB of music).

Discovery works great, but deep analysis like sonic analysis never runs.

Looking for the correct API/CLI method to trigger it programmatically.

Environment

Plex Docker: plexinc/pms-docker:latest

OS: Ubuntu

Storage: S3 via rclone mount (vfs-cache-mode full)

Plex Pass: Lifetime (verified active)

What Works

Instance provisioning (Docker)

S3 mounting via rclone

Plex container with valid claim token

Plex Pass is active (verified via /myplex/account then subscriptionActive=\"1\")

Library creation via API

Discovery phase : example for a part of the music library : 2114 tracks found, 172 bundles (artists + albums) created

What Doesn’t Work

Sonic/Loudness analysis: 0% completion

After discovery, I trigger analysis via:

# Method 1: API
curl -X PUT \"http://localhost:32400/library/sections/1/analyze?force=1\" \\
  -H \"X-Plex-Token: $TOKEN\"

# or Method 2: CLI
# --server-action sonic seems ignored
docker exec plex '/usr/lib/plexmediaserver/Plex Media Scanner' \\
  --analyze --section 1 --server-action sonic

Both return successfully, but checking the database shows no tracks have ms:musicAnalysisVersion in extra_data:

SELECT COUNT(*) FROM metadata_items
WHERE metadata_type = 10
AND extra_data LIKE '%ms:musicAnalysisVersion%';
-- Result: 0

Additional informations

CPU stays low (~2-5%) during "analysis" phase

No Sonic or Loudness entries in Scanner logs

The server is claimed and Plex Pass is active

Preferences like LoudnessAnalysis don’t seem to exist in /:/prefs

Questions

1. Is there a specific API endpoint or CLI flag to force Sonic analysis?

2. Does Sonic analysis require the server to be "settled" for some time?

3. Is there a preference I need to enable first?

Any help in automating the Plex scan or initiating the Sonic scan via API or CLI would be greatly appreciated.

Thanks in advance

1 post - 1 participant