After a DVR recording completes, an attempt is made to move the file from the .grab folder to the target library folder. This can fail with the following log message:
Sep 19, 2018 23:37:05.627 [14148] ERROR - Couldn’t rename file “D:\tv.grab\f928f8b28e7d375a0733df2180f7b9c0bc1b524b\The Late Show With Stephen Colbert (2015) - S04E11 - Jane Fonda; Willie Nelson.ts” to “D:\tv\The Late Show With Stephen Colbert (2015)\Season 04\The Late Show With Stephen Colbert (2015) - S04E11 - Jane Fonda; Willie Nelson.ts”: The process cannot access the file because it is being used by another process
The recording process likely still has a write lock on the file. Maybe a timer could be set when this condition is encountered in order to keep trying until the file has been unlocked. Then again, maybe the recording process is failing to close the file properly in some cases leading to the file remaining locked.
This appears to be a Windows only issue as you can rename files that are in use under Linux.
I just set up the DVR feature two days ago and it failed, as mentioned above, for my first recording. Last night the exact same thing happened.
Sep 20, 2018 23:37:04.481 [1752] ERROR - Couldn’t rename file “D:\tv.grab\72e1786f39be4ef759f6b7ed7c055990365026e9\The Late Show With Stephen Colbert (2015) - S04E12 - Tiffany Haddish; Iain Armitage.ts” to “D:\tv\The Late Show With Stephen Colbert (2015)\Season 04\The Late Show With Stephen Colbert (2015) - S04E12 - Tiffany Haddish; Iain Armitage.ts”: The process cannot access the file because it is being used by another process
I do not have any post processing configured.
I do not have skip commercials enabled.
Posting full logs would be good. The one line you posted seems odd. The folder should be:
D:\tv\.grab\ not D:\tv.grab\
In addition if you could specify more information about the Library such as how the Add Folders screen looks if you edit the library. In addition more information about the drive you are using, is it internal or external, how is the drive formatted, does it have adequate free space.
The missing \ appears to be a forum issue. As I write this I have pasted in the error from the log for the third night in a row where the issue has occurred. I can see in the preview on the right that the system had decided to delete that \ from what I have pasted. So I added an extra \ to get the preview to show the correct path.
Sep 21, 2018 23:37:05.460 [15048] ERROR - Couldn’t rename file “D:\tv\.grab\8903627499aa7042bf01659452431682f7e53df2\The Late Show With Stephen Colbert (2015) - S04E13 - Hillary Rodham Clinton; Nik Dodani.ts” to “D:\tv\The Late Show With Stephen Colbert (2015)\Season 04\The Late Show With Stephen Colbert (2015) - S04E13 - Hillary Rodham Clinton; Nik Dodani.ts”: The process cannot access the file because it is being used by another process
I have attached the full logs. I did not before as I had done the work to find the error and pasted the relevant information directly. The above error can be found in “Plex Media Server.2.log”.
I am not seeing anything that really stands out in the logs as to why this issue is occurring. Are you watching the show while it is recording? Is your antivirus or anything trying to scan the file that might keep it locked preventing Plex from moving it? Is the file being left in the grab folder or is it getting removed?
I don’t have anti-virus software installed other than what comes with Windows 10.
I am not watching anything. Really the only thing this is being used for at the moment is recording The Late Show so I can watch it in the morning.
The file remains in the grab folder and is never moved to the library. The recording is complete and if I manually move the file to the library, it works just fine.
Last night’s recording had the exact same issue.
My suggestion was that Plex set a timer and keep trying instead of giving up after one attempt. That would solve any anti-virus issues, concurrency issues with the recording process, and many other potential issues such as whatever is happening on my system.
This is also a very stripped down Windows 10 install that is only used as a server and has very little other software installed.
I have solved the issue. Your suggestion that it might be anti-virus got me to dig into the other services running on my system. I use Syncthing to mirror my media library for backup. I added an ignore rule for “.grab” and that resolved the issue.
I still think it would be great if Plex could natively handle situations like this by retrying the move operation until some (configurable?) timeout.