[Bug] New "Plex Music" library doesn't work with command line scanner

I have been experimenting with the new music scanner and it seems a bit buggy. For a start the command line scan doesn’t work with “Plex Music” libraries

I use a script to create libraries (sections) eg:-

“Plex Media Scanner.exe” --add-section music.best --type 8 --lang en --agent tv.plex.agents.music --location “m:\media\music\best”

This sets the scanner to “Plex Music Scanner” NOT “Plex Music” as it should.

So I manually fix that in the db then run:-

“Plex Media Scanner.exe” --scan --refresh --section 1

Which does nothing! If you --force it, then it loops through artists, but still adds no music. You CAN initiate a scan via the Plex UI but NOT via the command line. All other library types including music with scanner=“Plex Music Scanner” work fine. So it’s problems with new Plex Music library.

To recreate the problem more easily, Run Plex server FIRST, THEN rename “Plex Media Scanner.exe” so it won’t run. Add a new music library, then rename back to “Plex Media Scanner.exe” and run (using appropriate number for section)

“Plex Media Scanner.exe” --scan --refresh --force --section 1

Hi @beeman

I just tried to create a new music library and initiate a scan through the CLI. Something does appear to be different now with the Plex Scanner. I was also unable to get it to scan in a music library using the normal full scan command. ““Plex Media Scanner.exe” --scan --refresh --section 1”

The scan would work through the Plex web interface just fine though.

I will forward this on to the Plex dev’s. Are you able to attach some logs for the devs?

I am currently manually initiating Plex Music Lib scans via UI, one at a time. When it finishes (may be a few days), I will backup my Plex server partition and restore one of my test ones to generate logs. It is very easy to recreate though.

Does the Plex Music scanner utilise embedded MusicBrainz tags?

It would be nice if when Plex did a --scan it simply added all the files without doing any media analysis at all. This would allow files to be added very quickly, and so be playable, then --refresh to add metadata could be done in a second pass, followed lastly by --analyze to do the basic media analysis, or skip that pass, so it just does analysis on request.

1 Like

@Kraevin Any movement on this? How do we scan music folders/files manually? I’ve got too big of a library and it’s all mounted with Rclone so doing a full library scan just isn’t realistic every time I add a new song or album.

@Justin.Wedepohl I forwarded the issue to the devs, they are aware. Hopefully they will post an update soon. I know there are some issues with the scanner itself as well, like verbose no longer working.

1 Like

What is the lastest scanner and latest agent supposed to work with musicbrainz?
It’s not clear from the documentation, but it’s just impossible to select Plex media scanner (I believe nee scanner ) with Plex media agent.

@ChuckPa any ideas how this is supposed to be done now? unable to figure out the correct Plex Media Scanner CLI command to scan a new artist into a music library. what was working before is now no longer working since the recent Plex Music changes.

There doesn’t appear to be any way to get it working now without changing the scanner back to “Plex Music Scanner” but then you lose the extra metadata grabbed via “Plex Music”.

1 Like

@ChuckPa @Kraevin

The Problem with Plex Music and the Commandline to add Directorys (Albums) is still there.
Is a Bugfix on the Way?

Thanks

I think this is the same Problem

@ChuckPa

Is there a Workarount to scan Music Paths via the commandline at the Moment?
Adding Movies and TV Series worked perfectly by commandline, but Music not.

I’m sorry, i didn’t see this until now. (i’m the linux guy :wink: )

Frankly, I don’t know about the command line scanner

Help me spin up again ?

what’s current status?

can you give me something I can try?

Thanks for your Reply

Initial: My Music have a Path “/volume1/data/”. Scanner is Plex Music. I have a very large Music Folder, so i add Music manual to Plex with the command line, to prevent full scanns.

So, in my envoirment i take: (Ubuntu)

export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=“/usr/lib/plexmediaserver/Library/Application Support”
export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib

Then for manual (Script) adding Folders to my Music Library (c4) i take to follow command:

sudo -u plex “/usr/lib/plexmediaserver/Plex Media Scanner” -s -c 4 -d “/volume1/data/ABBA/Gold_(1992)”

This command is successfull on the bash (no error). In the Plex Alterts is NOTHING. No new Artist, no new Album. Then i take the command (Path) without the Album:

sudo -u plex “/usr/lib/plexmediaserver/Plex Media Scanner” -s -c 4 -d “/volume1/data/ABBA”

This command is successfull on the bash (no error). In the Plex Alerts i see, the “scanning ABBA”. But no new Artist/Album is show up in the Plex itself.

Hope you understand and can reproduce

If you have any Questions, please ask me.
Thanks a lot

1 Like

@ChuckPa

Should we open a new Thread in the Linux SubForum?
Have you tried the above Post with:

sudo -u plex “/usr/lib/plexmediaserver/Plex Media Scanner” -s -c 4 -d “/volume1/data/ABBA/Gold_(1992)”

No Linux guy here, but why would you call it with sudo?
AFAIK Plex is running on Linux under its own user account and not under root.

edit sorry meant @bangaa, you should try regular scan with the 1.19.2.2673 or newer beta version.

The scanner seems much better behaved than earlier versions.

My music is ~3+ tb, and at this point has been mostly matched up (although plex still insists on trying to match unmatchables).

Either way, I would not expect much success trying to coopt plex’s scanner to use via CLI.

at otto, the sudo -u plex makes the command run in the plex user context (not root or the current user).

1 Like

I use the newest Beta Plex (Pass) Version from yesterday, but the GUI Scanner is not speed effective enought. I have a lot more music than you. Why also scanning the whole PlexMusic Library, when i know which Artists/Albums are new in the Library? There are a lot of I/O’s on the Server than i can prohibit with the Plex commandline.

New Folders with Movies and TV Series i can scann in the Movie-Library via commandline, there are no Problems. Only the “new” PlexMusic Library has this Problem. I am glad, when the Devs can eliminate this Bug :slightly_smiling_face:

IMO, if your server can’t handle the io for scanning the storage, then it sounds like you have outgrown your server.

One alternative is to separate music to its own plex server (either VM or bare metal hardware), or split up your music collection into smaller chunks on the existing hardware (perhaps separate classical, or various, or soundtracks, etc). I know that isn’t pleasant, but if you have that much more than I do, then that is getting in to ‘plaid’ territory.

Of course the other alternative is to upgrade your server and/or storage to something that can cope with the amount of IO and data that you have.

if you are using some remote google drive which is io limited, well, as you can see that comes with its own consequences and limitations.

In any case, I wish you good luck.

No, the Server run not on limit, but why do a Full Scann, when we can do a Part-Scan? Why?
Why do you cut your Hairs, when is not necessary :stuck_out_tongue_winking_eye:

The commandline function is already in Plex integrated, but has a Bug. I think its not a really big thing to resolve this.

This have to be looked into.
Wasted IO is wasted IO, it doesn’t matter if you have your library on a DAT tape or an NVMe drive.
Granular scanning is a godsend, we need it for the new plex music agent.

3 Likes