Bug: External subtitles not picked up in plex if added after movie is imported

It’s unfortunately still an issue, I’m not even sure if plex realises there is a bug regarding this.

Basically what I’ve found is that if you add external subtitles a couple of days after a movie is scanned into plex (eg. you use Bazarr), plex won’t realise the subtitles are there, and the only way you can add them to plex is to, delete and re-add the movie with a different folder name or click the upload subtitle button and choose the subtitle file.

I’m using ubuntu plex, latest version, here is an example of filename format:
\movies\Knives Out (2019)\Knives Out (2019) - [DVDSCR][AC3[XVID]-CM8.avi

A couple of days after the movie is added I then add the subtitle file:
\movies\Knives Out (2019)\Knives Out (2019) - [DVDSCR][AC3[XVID]-CM8.en.srt

Issue:
The subtitle is not recognised by plex as being available. Even if you click rescan library it doesn’t show up, the only way to get it to add is to click upload subtitle and select the file.

Thanks

Did you try refreshing the metadata (not the same as re-scanning the library)?

Removing / replacing the movie forces a metadata refresh.


Scanning vs Refreshing a Library

Refresh Metadata

Refreshing Metadata for a library or individual item causes the metadata for the item to be refreshed, even if it already has metadata. You can think of refreshing as “update metadata for the requested item even if it already has some”.

You should refresh a library or individual item if:

You’ve added “local media assets” (such as artwork, theme music, external subtitle files, etc.)

Thanks.

When I click refresh metadata it only refreshes the metadata it does not seem to rescan the folder for the srt file unfortunately. Even if it did it would still be a bug, basically Plex doesn’t monitor for folder changes of non video assets (subtitles).

1 Like

where are the media files located?

Are they on a network share? If so then No, it’s not a bug. notification over network shares is not supported by the networking protocols.

Additionally, On Linux:

  1. The pathname separator is /, not \.
  2. Up to 8192 directories can be monitored by default (Linux kernel limit). This can easily be increased when needed.

Thanks.

The movies and subtitles are both in a local folder on the same server as plex (docker), and it is not network share.

Sorry the correct path is

/movies/Knives Out (2019)/Knives Out (2019) - [DVDSCR][AC3[XVID]-CM8.avi
/movies/Knives Out (2019)/Knives Out (2019) - [DVDSCR][AC3[XVID]-CM8.en.srt

The reason I had / and not \ is when I copy + pasted the filename / folder for this example post I was on my windows pc browsing the network share.

I can confirm the local path is

/movies/movie_name (year)/movie_name.ext

Subtitles file and video file are in same directory.

I use ubuntu 18.04 lts server edition.
Drive formatted as ext4 then I use mergerfs to create a pool

# FSTAB
UUID="accf4128-ef55-44bc-b105-5b82ce3f342f" /mnt/disk-8tb1 ext4 defaults 0 0
UUID="057aee3a-63ac-4014-9ec2-25470d81cdf1" /mnt/disk-8tb2 ext4 defaults 0 0
UUID="c2c8f098-2158-495b-bb2c-a150fd049496" /mnt/disk-8tb3 ext4 defaults 0 0
UUID="b8e93a30-3f17-4737-9a45-3047c43f80a8" /mnt/disk-8tb4 ext4 defaults 0 0
UUID="3eb93b46-7fe0-452a-8335-72aabe8dc0b5" /mnt/disk-6tb1 ext4 defaults 0 0
UUID="f413c50f-d0c8-4db9-9093-1749f51c3c60" /mnt/disk-4tb1 ext4 defaults 0 0
UUID="81ca18e1-7807-485c-ad8a-1ad826de70fe" /mnt/disk-3tb1 ext4 defaults 0 0
UUID="fb17a341-9176-4490-8df1-0c7fcea02c30" /mnt/disk-3tb2 ext4 defaults 0 0
UUID="fc6d8b67-3170-4cad-b158-7478284c07bc" /mnt/disk-3tb3 ext4 defaults 0 0
UUID="c8b7c67a-c02c-4f40-89dc-5c54c69315f3" /mnt/disk-3tb4 ext4 defaults 0 0

/mnt/disk* /mnt/storage fuse.mergerfs defaults,allow_other,minfreespace=30G,use_ino,category.create=mfs,fsname=mergerfs,nonempty 0 0

Then docker volume mapper for plex container

  volumes:
  - /mnt/storage/media/movies:/movies

Plex server has no trouble instantly picking up new movies when they are added, but just doesn’t see new subtitles when they are added.

Give this a shot for me but I suspect what you’ve run into already, without realizing it, is the 8192 directory limit. It happens extremely quickly with large libraries, photos, and especially when music is involved.

Examining your logs; looking for ‘[Notify]’ errors is absolute evidence the table is full.

I forget what happens in a docker container.

Thanks @ChuckPa i’ll try that.

for

sudo find /dir1 /dir2 /dir3 -type d -print | wc -l

should I just do that on the root directory, or should I do it on the volumes that are mapped into the plex docker?

root@server:/# ls
bin   etc         initrd.img      lib64       opt   run   srv  usr      vmlinuz.old
boot  events.log  initrd.img.old  lost+found  proc  sbin  sys  var
dev   home        lib             mnt         root  snap  tmp  vmlinuz
root@server:/mnt/storage# sudo find /mnt/storage -type d -print | wc -l
11902

Do it where your media is . PMS doesn’t set watch points on system directories.

Thanks i’ll add fs.inotify.max_user_watches=32768 intosysctl.conf

Currently it doesn’t have fs.inotify.max_user_watches in there.

There’s why.

Follow my procedure.

You’ll want 16384 as the value for max_user_watches in /etc/sysctl.conf

If you’re planning on growing fast, make it 32768.

(This change is at the host level)

After making the change, restart PMS.

Do we need to change the plex docker as well, or just change it at host level only. Thank you.

Changing and activating at the host (sudo sysctl -p) gets the host setup.
After the host is ready, restart the container so it can make use of it.

Hi

I followed instructions, then restarted whole server.

As a test I created some external subtitle files and placed them in a movie folder, plex doesn’t see them.

Then I created a new folder with a copy of a movie and plex picked up the new movie straight away (within 2 seconds)

Interesting. I can test that.

Which host OS?

Did you “Scan files” after adding the new subtitles? (that is needed)

Directories are what’s monitored, not files. Need to remember that.

root@server:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

In the plex web gui I’ve hit “scan library files” libraries under manage -> libraries and will report back.

It’s finished scanning I still have no subtitles listed under the movie “Knives Out”.

bump. let me know if you need me to do any testing, to confirm the bug.

How many directories do you have being watched? Linux default is 8192 directories.
Do you have a lot of music?

I just added an “interview.mkv” file and it was detected immediately.

Thanks.

video files are identified immediately
external subtitle files are not identified
the all media folder contains 11902 directories
i don’t have music folder