Channels reimporting my entire library after restart

Today, I restarted my Mac and after Channels started up, it decided to scan and reimport my entire library. This isn’t the first time this has happened and it has caused some issues as well as a lot of extra reading and writing to the hard drive. I’m using a spinning external 5TB hard drive for my library. After looking at the log files, it seems that Channels thought the files were either missing or new. I’ve included a small sample of the logs right before and after rebooting.

Any thoughts?

2024/07/04 15:24:11.672802 [SYS] Shutting down...
2024/07/04 15:24:11.673410 [ERR] Scanner error walking /Volumes/Backup/TV: quit while scanning
2024/07/04 15:24:11.673940 [ERR] Scanner error walking /Volumes/Backup/Channels/Imports/TV: quit while scanning
2024/07/04 15:24:11.673957 [ERR] Scanner error walking /Volumes/Backup/Channels/Imports/Videos: quit while scanning
2024/07/04 15:24:11.798052 [DVR] Recording engine stopped.
2024/07/04 15:24:11.840301 [SYS] Bonjour service stopped.
2024/07/04 15:24:12.213107 [SYS] Goodbye.
2024/07/04 15:25:13.608788 [SYS] Starting Channels DVR v2024.07.03.2236 (darwin-arm64 pid:701) in /Users/chuck/Library/Application Support/ChannelsDVR/data
2024/07/04 15:25:13.733314 [SYS] Started HTTP Server on 8089
2024/07/04 15:25:14.740366 [M3U] Refreshed lineup for FrndlyTV with 46 channels
2024/07/04 15:25:14.833999 [M3U] Refreshed lineup for SamsungTV with 356 channels
2024/07/04 15:25:15.091051 [M3U] Refreshed lineup for PBSTV with 1 channels
2024/07/04 15:25:15.152348 [M3U] Refreshed lineup for PlexTV with 549 channels
2024/07/04 15:25:15.420150 [M3U] Refreshed lineup for PlutoTV with 418 channels
2024/07/04 15:25:15.459756 [M3U] Refreshed lineup for STIRRTV with 65 channels
2024/07/04 15:25:18.939503 [TVE] action=cbs_station err=CBS stream is not available via your TV provider
2024/07/04 15:25:19.949957 [DVR] Waiting 17h34m40.050044s until next job 1720184400-131 Glenn Beck Radio
2024/07/04 15:25:20.008409 [DVR] Recording engine started in /Volumes/Backup/Channels
2024/07/04 15:25:20.625882 [ERR] Could not create backup: stat /Volumes/Backup/Channels: no such file or directory
2024/07/04 15:25:20.916824 [SYS] Bonjour service registered with Mac
2024/07/04 15:25:30.072329 [IDX] Pruned 5 expired airings from XMLTV-STIRRTV in 6ms.
2024/07/04 15:25:30.094432 [IDX] Pruned 86 expired airings from X-VIRTUAL in 21ms.
2024/07/04 15:25:30.125206 [IDX] Pruned 319 expired airings from X-M3U in 26ms.
2024/07/04 15:25:30.146667 [IDX] Pruned 9 expired airings from X-STRMLNK in 19ms.
2024/07/04 15:25:30.256315 [IDX] Pruned 423 expired airings from XMLTV-PlexTV in 109ms.
2024/07/04 15:25:30.350337 [IDX] Pruned 331 expired airings from XMLTV-PlutoTV in 93ms.
2024/07/04 15:25:30.388778 [IDX] Pruned 264 expired airings from XMLTV-SamsungTV in 35ms.
2024/07/04 15:25:30.439547 [IDX] Pruned 909 expired airings from X-TVE in 50ms.
2024/07/04 15:26:00.807846 [ERR] Could not create backup: stat /Volumes/Backup/Channels: no such file or directory
2024/07/04 15:26:00.984573 [ERR] Missing file to delete #24681 /Volumes/Backup/Videos/Channels/Processed/Glenn Beck/The Most Important Thing You Can Do This Fourth of July.mp4: stat /Volumes/Backup/Videos/Channels/Processed/Glenn Beck/The Most Important Thing You Can Do This Fourth of July.mp4: no such file or directory
2024/07/04 15:26:01.024885 [ERR] Could not create backup: stat /Volumes/Backup/Channels: no such file or directory

Either your DVR directory is set incorrectly, or it doesn't exist.
Does /Volumes/Backup/Channels exist on your Mac?
Is it an external drive (maybe it lost its connection)?

Everything is set up correctly and the hard drive is external connected via usb-c. The directory does exist. Nothing has changed on my end as this has been my set up for years. Also, I have recently replaced the hard drive just to be sure and this issue happened both before with the old drive and now with the new drive…

I'm not familiar with a Mac, but could it be the external drive spun down?
I had to change settings on my WIN10 laptop to prevent external USB 3 drives from spinning down.

Are you running any automated tasks that scan or prune your content using the server API's?

1 Like

So if the drive is set to sleep when not active, it would potentially cause this issue?

Yes.
The DVR server should run 24x7.
All my spinning rust drives run 24x7, except my laptop drives which power off when I shut down my laptop, and I don't run the servers on the laptop.

Just to be clear, the Channels server is run off of the internal SSD of my Mac, while the data drive which contains my video library is stored on a spinning external drive. In this case, should I still disable sleep on the external drive?

Thanks for your help… :grinning:

Definitely.

Ok, I changed it to never sleep. We’ll see what kind of affect that has. Thanks again for your help. :grinning:

You should not need to disable sleep on the external drive.

@chDVRuser is correct. This error means the volume called Backup was not properly mounted on your computer.

1 Like

If this is the case, then how was Channels able to reimport my entire library using the exact same mounted drive and file path that supposedly didn’t exist? None of my other backup utilities or other programs which use this same drive and file path have ever had a single issue. Something just doesn’t add up…

The uuid keeps changing on the drive when it’s mounted and unmounted. Channels sees it as a new drive with new data every time it changes. It’s not a channels problem, it’s a you problem.

Install one of the many automount apps for Mac. It will help.

Just to be clear, this is a usb-c connected drive. How do I make sure that the uuid doesn’t change?

Keep the Drive awake.

Make sure it has an external power source

It’s bus powered…

1 Like

Make it not bus powered

What do you mean by "reimport"? The DVR does not remove imports when a drive is not available — it will only remove them if the DVR is instructed to purge missing files by the user (or if the import settings on the DVR are changed to no longer have that imported directory).

You would have to submit diagnostics from the DVR for me to have any better idea of what's going on.

On macOS, drives are generally mounted in the same location (under /Volumes) when they are remounted. I'm not sure what UUID you are referring to.

This should not be necessary.

This should not be necessary for a Mac.

Eric, you’re a genius and because of your comments I think I now know what’s going on. I have a webhook that runs the Channels prune command in the background every few minutes. After a reboot, Channels is looking for the designated drive and if it hasn’t yet mounted and the prune command runs, Channels sees all of my files as missing and deletes the references to them.

Is my thinking correct?

Yes, if you are issuing the command to prune your imports, the DVR will do exactly as you requested and remove all of your imports that are not currently available.

This is the reason why we don't automatically prune imports and why we don't recommend people setup something to automatically do it.