Couldn't accept new TLS connection: Too many open files

I have an unraid docker for my Plex server. I first noticed the issue when adding new shows to my Library. It would not download the Metadata information for them and when I clicked on fix match it would just spin. When I went to check the agent settings the Server settings screen would spin for a few minutes and then would go to unavailable. After looking at the log, completing these actions would cause a bombardment of “Couldn’t accept new TLS connection: Too many open files” errors. I have tried to remove the image, restart the docker service, reboot the unraid server, and even install a complete new container.

  • Unraid - 6.5.3
  • Plex - 1.13.2.5154
  • Repository - plexinc/pms-docker:plexpass

I have tried to upload the log file but it failed multiple times…

It seems that it starts when I scan a Library. For example if I restart the Plex server to clear the errors and then click Rescan Library Files for TV Shows, the TLC errors come flying in.

I see this happen on both plexpass and latest repository flags.

So it appears that when it gets to the end of the scan it goes to the parent folder and starts scanning from that level. At that point it opens 100s of thousands of files and breaks itself.

Jun 21, 2018 15:09:01.270 [0x1553bde32700] DEBUG - HTTP 200 response from GET http://127.0.0.1:32400/:/metadata/updateProgressMessage?message=Scanning%20Modern%20Family
Jun 21, 2018 15:09:01.270 [0x1553ccd74800] DEBUG -     * Scanning directory /data/disks/google_secure/tvshows/Modern Family/Season 8 (parent: yes)
Jun 21, 2018 15:09:01.270 [0x1553ccd74800] VERBOSE -     * Noting that 'Modern Family/Season 8' was updated at 2018-06-10 07:59:56
Jun 21, 2018 15:09:01.270 [0x1553ccd74800] VERBOSE -     * Taking directory 'Modern Family/Season 8' (9231) out of the map (2 left)
Jun 21, 2018 15:09:01.459 [0x1553ccd74800] DEBUG - Adding subdirectory for scanner: "/data/disks/google_secure/tvshows/Modern Family/Season 8"
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding subdirectory for scanner: "/data/disks/google_secure/tvshows/Modern Family"
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding subdirectory for scanner: "/data/disks/google_secure/tvshows"
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding subdirectory for scanner: "/data/disks/google_secure"
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding subdirectory for scanner: "/data/disks"
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding subdirectory for scanner: "/data"
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding subdirectory for scanner: "/"
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding file for scanner: ""
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding file for scanner: ""
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding file for scanner: ""
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding file for scanner: ""
Jun 21, 2018 15:09:01.460 [0x1553ccd74800] DEBUG - Adding file for scanner: ""

I added a folder directly to my tvshows library and it did the same thing. It went all the way to the root and started scanning files.

I also added another library TV Shows Test and added just one shows folder and it stopped how it should have. I am trying a new Library with all shows now to see what happens.

So after adding a second library I had the same issue. It started scanning all of the root directory. Looking at the session log though I was able to see that it happened again right after the same folder scan. Looking at the Season 8 folder I noticed that there was some crazy filename with special characters. Once I removed that file all is well.