|
SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Mass File Deletion when Moving Recordings
I'm a pretty enthusiastic SageTV user, having the software running in one form or another for over a decade. I offer my thanks to the entire community of supporters of this software, everyone from Narflex to the most recent committer, for their efforts to keep this incredibly useful software alive.
Because this software is so useful I'd like to get your help with an issue where SageTV conducted a mass-deletion of about half of all the recordings I had on a test server. The recording purge event happened immediately after I moved several recordings between my TV storage directories using the "advanced_video_file_recovery=true" method. I'd like the community's advice on how to prevent the purge event from happening in the first place and to understand how I may have caused it. If any project contributors read this, I'd also be interested if you'd recommend filing an issue on GitHub, or if this is just user error. While my description of this problem includes an overview of my work-around to it, I don't really consider that setting some of my TV recording directories as read-only is a viable option in the long-term. SageTV expects to be able to create, delete and modify all TV recording directories (and it usually does a fine job of it) so if there is another work-around to this issue in 9.2.2 I'm all ears. For now, I've designated a specific TV recording directory as read-only and am using "seeker/video_storage" size limits to fool SageTV into thinking it should not ever record there. I move recordings that SageTV shouldn't be deleting (keep-all favorites, etc) to the read-only share, and leave recordings that SageTV should be manipulating on the read-write share. Steps for Replication
One last thing to mention just in case it is relevant. All recordings in this test server are HEVC and AAC in an MPEG-TS container. As a result, you'll see SageTV logs saying "Using external format detector because we only detected audio on the internal format". I don't think this is related to why SageTV decides to purge the recordings, but that is why I'm consulting you all for help. As a side note, I'm watching jvl711's MediaFormatParserPlugin project with interest and would also be interested in hearing folks' experience with it. Full logs, Wiz database and other files available on request via Private Message. Thanks for any comments or suggestions Last edited by sagetvuser489; 01-11-2021 at 11:04 PM. Reason: Fixing my reference to Opus4's instructions for moving recordings |
#2
|
|||
|
|||
Quote:
|
#3
|
|||
|
|||
Thanks for reaching out trk2!
You are absolutely right, I referenced the wrong post when talking about Opus4's instructions about the Advanced Method of moving recordings. The right posting URL is actually: https://forums.sagetv.com/forums/showthread.php?t=30697. When you check this posting out, the procedure you are looking to read is mentioned under "The Advanced Method (for SageTV version 6.3.9 and later)" I've edited my original post to correct this error. |
#4
|
||||
|
||||
I don’t know for sure what’s happening, but here is a theory.
When you setup the new instance of Sage, did you copy over your wiz.bin before doing the advanced file recovery? If not, when Sage scanned the recordings, it may not have recognized them as Favorites or Manual recordings. Therefore it may have treated them like intelligent recordings. Depending on other settings, these can be deleted by Sage to make room if more space is needed. Here is an alternate theory: You said these were all HEVC format recordings. I’m not sure how you made these since Sage doesn’t normally handle HEVC (although steps have been made recently to start adding support for this). It’s possible that when Sage scanned the files, it’s format detector didn’t recognize them as valid video files, so it assumed they were corrupt and deleted them. Someone who is familiar with the Sage code would need to look to see if this is a real possibility.
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2),USBUIRT (multi-zone) Source: Comcast/Xfinity X1 Cable Primary Client: Server Other Clients: (1) HD200, (1) HD300 Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE, HDHR, HVR-2250, HD-PVR |
#5
|
|||
|
|||
Hi Tiki - thanks for your advice!
When I originally set up this test install of SageTV on Ubuntu I started with a blank Wiz.bin because I had no recordings. Since then, I chose to move recordings around among the three pre-existing recording directories that SageTV knew about. Yes, before I moved the recordings around from folder to folder I stored off a backup copy of my Wiz.bin. While I was moving the recordings between recording directories (after step 4), I did not re-install SageTV. On your "manual recordings" theory, I used the SageTV placeshifter to examine the markings on each recording (i.e. what I got after step 17). The ones that I would expect to be marked as favorites are actually marked as favorites. Same with manual recordings. Still, the Wiz.bin I am looking at is after I replaced it with a backup (in step 12), so you might still be right. I'll have to examine what the "broken" Wiz.bin looks like (that was overwritten in step 12), but that will take a bit more testing to replicate. Correct - SageTV has only just begun to support HEVC and the setup required to get them into the system is more involved than anything I'd done previously. Now that hardware encoders for HEVC are widely available, I'm eager to make use of them and take advantage of the storage savings. It turns out that if you are using OpenDCT (https://forums.sagetv.com/forums/showthread.php?t=62774) as a network encoder, SageTV will accept the files as long as you are using it's RawSageTVConsumerImpl and what you provide it is a MPEG-TS container containing some stream it can parse. Your theory about SageTV thinking that the recordings are invalid somehow was my first thought too. After all, the seeker logs seem to call them "Seeker clearing unwanted and partial files...". However, when I looked at the actual Seeker code I didn't see any code path that would have deleted files just because the didn't have an identifiable video stream. There were 7 files ("phase 1" in step 8) for which destroyFile was called while the Seeker was "Verifying existence of all TV media files in database fixDurs=true avoidArchive=false". Now that I've taken a closer look at each one of these deletions, I see that all 7 of them were actually moved from '/var/media/tv/' to '/media/01/media01/tv', as in the case of the log line "MediaFile failing verify testFile=/var/media/tv/Today-S2021E01-4017851-0.ts isFile=false len=0 isTV=true isRecording=false" To my mind these 7 deletions should have been identified as moved files as SageTV was starting in step 6, but they were instead recognized as files that were missing and should be deleted. I'm left wondering if there is some kind of race condition between whatever is running the advanced file recovery process and the Seeker, which at SageTV boot time is trying to validate that all the recordings are where they should be. If the advanced file recovery thread was running, but hadn't finished correcting file location metadata for each recording before the Seeker comes in and starts deleting recordings it can't find that might explain why only part of the database is deleted. I am no expert in the SageTV code though, so like you I could really use the advice of someone who knows the code better than I do. I could also use advice on a test that could confirm\refute the race condition theory. Last edited by sagetvuser489; 01-13-2021 at 11:35 PM. |
#6
|
|||
|
|||
I have been having a similar problem under Windows where sage is deleting files from a media folder -- one that it should not be managing. I can easily recover these files since this is an NAS and I can move/rename the #recycle/TVRecordings/...delete files and the associated .my, .edl, etc. files to another folder where I am hoping that they stay (a recordings folder that is mostly empty).
At one point in time, I was using the NAS as a sage recordings folder but had issues with speed with overlapping recordings (probably since fixed, but I haven't added it back). I've quadruple checked that it's still not a recording directory and it is not. This is an OLD system that was migrated from XP and is now running 8.1 -- but reconfiguring all of the little things that I had to do to make it work with my ancient HD PVR/cable box/USB-UIRT and 2 silicon dust dual recorders (now doing OTA) has kept me from a reinstall. I've tried to upgrade to x64 but have been unsuccessful. As I said, complex old system. Does anyone have any suggestions?
__________________
HDHomeRun x2 Cable Box via Hauppauge HD PVR and USB-UIRT 2 SageTV's HD300 Intel Core 2 Quad Q9650 @4025 MHz, 8G G.Skill Performance DFI Lanparty DK X48-T2RS Plus; SilverStone Decathlon DA1000 (died - back to an ancient enermax) eVGA 7900 GT KO RoHS -- Zalman VP900CU Cooling Synology NAS 22TB |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
File deletion, metadata, and SageEvent timing | tmiranda | SageTV v7 Customizations | 0 | 12-14-2015 07:00 PM |
Media file durations messed up after moving recordings. | redondo_se | SageTV Software | 1 | 10-21-2010 07:45 AM |
UI slowdown after file deletion | John@TunerUK | SageTV Software | 0 | 12-15-2008 06:49 PM |
Allow file Deletion under File Browser Options question | carlgar | SageTV Software | 1 | 06-17-2008 11:29 AM |
Immediate deletion of recordings - windows update? | maurohair | SageTV Software | 3 | 12-16-2005 07:07 PM |