Another test you should make is this:
Take one or a few of the file paths in the server log which show the boost::filesystem:... errors and paste them into the address bar of the Windows file explorer. Then hit Enter. If the file is opened, all is as expected, but if you get an error message, then your Plex server is for some reason expecting to find the file on a different address that it actually is.
One example M:\Films 1\We Live In Time (2024)\We Live In Time (2024) 1080p H265 AAC51.mp4
Side question: did you actually add the folder M:\Films 1 to your movies library and not just M:?
Okay, tried that with a few file paths as requested and they all opened fine on the PMS via Explorer.
When adding the āFilms 1ā folder to the library I used the browsing tools in the Add Library routine in Plex. I added āM:\Films 1ā. I didnāt type it in I selected it from the drop down box.
M: is the drive mapped in Explorer to a Folder on the NAS called āMediaā , āFilms 1ā is a folder I created in āMediaā.
Whatās confusing here is that my PMS has been running for years now on the same Lenovo hardware together with the WD PR4100 NAS without any issues at all. I created a folder on the C:\ drive of the PMS hardware and copied the three films into it so I could eliminate the network. The issue still persists. PMS still has the same error even though the library is on C:.
Surely this must be an internal Plex issue? Database corruption?
There is only one setting in the NAS box which is allowing the box to set the drives to sleep. This has always been on but I have turned it off for now. I have to say, I donāt want the drives permanently spinning. Itās greater wear and also waste of energy.
There are no SMB settings or other sleep settings I can see.
In the PMS hardware I have turned off āAllow the computer to turn off the NIC to save powerā. It was on. As I said earlier though, the problem occurs with a new library on the internal SSD. So, network only used for external lookups by PMS?
Hi Otto,
I think I may have found the problem. I looked at another app that runs on my PMS hardware - Qbittorrent. Have a look at the execution log vis: Qbittorrent-log.txt (15.2 KB)
Qbittorrent is experiencing the same issues as Plex. So, if I am correct, the issue is either windows or hardware. As my hardware is rather ageing Iām tempted to just buy a new unit. Do you concur?
The torrent logs show āInvalid Handleā multiple times. Obviously reported by the O.S.
Anti Virus is Panda Security and is Admin controlled by my engineers. I will get them to pause it tomorrow. It is an excellent product and I wonāt stay without AV for long. Again, Panda has been on this unit for years.
Iāll get the volume and RAM checked out tomorrow.
Even if you uninstall it, the default Windows defender kicks in automatically. And itās sufficient for regular users, btw.
That doesnāt mean anything, because an anti virus app has to do updates all the time in order to stay effective. One of these updates could have caused the issue.
Hi again,
Panda has been switched off completely. No change, exactly the same.
The āInvalid File Handleā error report still exists in both Plex and QBittorrent.
I have created folders for both apps solely on the PMS hardware so there is no connection to the NAS whatsoever.
I then installed QBittorrent on my laptop with the same folder names as the PMS and the Invalid File Handle error does not occur.
I then turned off Windows Defender, problem still persists.
The error of āError 6: Invalid File Handleā is reported by the Windows O.S. and both Apps report it. It does not occur on a different PC. The Windows O.S. is up to date with all updates installed. This must surely be either a Windows O.S. or hardware issue. The fact that the error occurs on an App other than Plex, in my view, puts Plex in the clear. Out of the two, the Windows O.S. seems the most likely culprit. Should I try a Windows āover the topā re-install? I could investigate an upgrade to Windows 11 but Iām not sure that the ageing hardware will be compatible.
Hi everyone,
As thereās been no further suggestions posted over the last four days I guess weāve run out of ideas on this one? I still have the same issue with Plex not seeing any new additions when scanning and some of my previously added media in libraries being lost from the Plex libraries.
The only possible ways forward that I can see are to perhaps try the following
Carry out a repair āover the topā re-install of windows.
If 1. doesnāt work, replace the O.S. and/or hardware.
What do you think? Should I perhaps consider using Linux as the O.S.?
If youāre interested in further troubleshooting, try this.
Create a sub-directory on your C: drive named Media and within it create another named Movies. Within Movies, create a sub-directory reflecting the name of a movie which, when you tried to add it, resulted in the āInvalid file handleā error. For example, John Wick (2014).
In Plex edit your movies library and add C:\Media\Movies\ in the āAdd folderā tab.
Open a command prompt and run the following to create a file with random content (this will represent the movie):
`fsutil file createnew āJohn Wick (2014).mkvā 15000000
This will create a 15 MB file with random content that PMS will treat as a movie.
Back in Plex, scan your movie library. (If you have automatic scanning enabled PMS may have already detected it.)
If all went well, you should now have āJohn Wickā in your library. Obviously it wonāt be playable since thereās just garbage in the file.
Assuming the above worked:
Remove C:\Media\Movies\ from the folder list for the library.
Rescan the library (and empty trash) and ensure the movie is removed.
Move the āJohn Wick (2014)\John Wick (2014).mkvā path to your real movies folder on your M: drive.
Scan the library to see if it is correctly added.
I picked on John Wick since it was an example you provided as failing. If thatās no longer the case, just pick another failing movie.
Hi, thanks for helping.
I did as you suggested but no joy Iām afraid. The film wasnāt added. However, there doesnāt appear to be any Invalid Handle Errors in the server log. Iāve attached it for you. Plex Media Server 01-05-2025.log (620.2 KB)
Thanks for the log. Itās weird, because it thinks itās found and added it:
May 01, 2025 20:26:17.210 [20996] DEBUG - Scanner [Plex Movie]: found agent match for file 'C:\Media\Movies\John Wick (2014)\John Wick (2014).mkv': 'John Wick'
May 01, 2025 20:26:17.233 [12772] DEBUG - Added new metadata item (John Wick) with ID 93503
...
May 01, 2025 20:26:24.885 [18576] DEBUG - There was a change for metadata item 93503 (John Wick), saving.
May 01, 2025 20:26:24.885 [18576] DEBUG - Updating metadata item (save) (John Wick) with ID 93503
I did the same test and the movie did show in my library and produced the same logging (ignore that paths, I used my Linux-based server for the test):
May 01, 2025 16:12:47.767 [139887878683448] DEBUG - Scanner [Plex Movie]: found agent match for file '/mnt/storage/dvr/movies/John Wick (2014)/John Wick (2014).mkv': 'John Wick'
May 01, 2025 16:12:47.782 [139887878683448] DEBUG - Added new metadata item (John Wick) with ID 1760
...
May 01, 2025 16:12:50.412 [139887816387384] DEBUG - There was a change for metadata item 1760 (John Wick), saving.
May 01, 2025 16:12:50.412 [139887816387384] DEBUG - Updating metadata item (save) (John Wick) with ID 1760
It really should have shown in the library. Can you check the library view and apply the Duplicates filter to see if perhaps it got glommed onto another movie for some reason?
Hi again,
My mistake. I looked at the wrong library. The new library on the C: drive as you suggested was found. I did as you requested and moved the John Wick folder back to the M: drive, Following your empty trash etc,. instructions. On re-scanning it failed as before with Invalid Handle.
I thought it may be a file naming issue so I decided to put the original .mp4 and .srt files back on the C drive of PMS and rescan to see if that worked. I didnāt get that far. I renamed the file to āJohn Wick (2014).mp4ā and that was fine. However, when I tried to rename the .srt file to the same convention i.e. āJohn Wick (2014).srtā As soon as I tried to rename it an error popped up vis:
Hi, I think weāre getting somewhere.
I copied the .srt file on the PMS and then pasted it to my laptop. It copied fine but when I went to edit and rename it, it had been pasted as a Folder, not a file.
Itās surely pretty conclusive that there is some thing seriously amiss on my PMS - Windows O.S. or hardware. It could be corrupt Windows Explorer software?
Thatās ok, I was just going to try to look at it on a macOS (APFS) or Linux (ext4) filesystem to see if it showed similar issues. Itās pretty obvious that it was corrupted somehow now (being seen as a directory). Where that happened will probably be a bit trickier to find.
If you can, Iād recommend deleting and re-sourcing all of the affected files. And a virus scan of the system might be in order.