Jump to content

Rules based VirtualTV channels not working (referencing old JSON files after migration to another NAS)


Go to solution Solved by pünktchen,

Recommended Posts

s1mwest
Posted

Hey, I'm doing a test run of migrating Emby server from one NAS to another, but I've run into an issue that's only affecting creating rule-based channels in VirtualTV on the target server. Can anyone give me an idea if I can fix this, and provide any pointers if so? Thank you.

Migration has generally been ok but VirtualTV plugin on the target NAS fails to include any videos for rule based channels that I create. Playlist based and Collection based channels work fine. From what I have seen in logs, something keeps referring to old JSON files (eg Could not find file ... VirtualTV-07332953b2e5403fb61268cc17caacc8.json), which I believe did not come across in the migration, I guess. But I'm confused as to what is remembering the reference to these files after I've performed a cleanup, or how to clear it. This seems to be the blocker for me.

I've attempted various steps such as uninstalling VirtualTV, using SSH to delete it's cache and checking [MediaItems] table via SQL to ensure previous channels aren't remaining. I clear what I can find but somehow the old JSON file is still being referenced and therefore creating new rules based channels fails because of this. Well, I say fail, but I mean that the channel is created, but no videos are included when i refresh or force refresh guide data.  The criteria & channel settings are same as what was used on the source server.

I'd really like to keep the config that I imported, so any help is appreciated.

DSM 7.3.2 Update 3 Emby server v4.10.0.11 - VIrtualTV v2.1.7.0

Migration steps:

Source server

1. Export emby config

Target server

2. Import emby config

3. Update folder location for each library on new server & check local system user 'emby' has read/write access

4. Scan libraries

5. Refresh Metadata for all libraries

6. Install VirtualTV plugin on target server (Should this have been installed before import?)

7. Create Collection based and Playlist based channels -> Refresh Guide = ok

8. Create Rules based channel -> Refresh gude = no files are included "Returning 0 TVShows Items" shows in log

9. Then mutiple failed attempts to rememdy, as described above

 

 

pünktchen
Posted
21 hours ago, s1mwest said:

From what I have seen in logs, something keeps referring to old JSON files

The json files are part of the program cache option of each channel. But they should be re-created if they do not exist, so what is the exact log message you are referring to?

 

21 hours ago, s1mwest said:

Update folder location for each library on new server

And those new folder locations do show up in the channel editor if you select "Channel Rules"?

s1mwest
Posted

Thanks.  Here's the log:

2026-05-16 12:44:38.746 Error VirtualTV: TVService > Channel: 70's Test, Error getting programs from cache file: /var/packages/EmbyServer/var/cache/virtualtv/VirtualTV-eee89b7aa451445bbe6fba4aa8cb140c.json
*** Error Report ***
Version: 4.10.0.11
Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology72_{version}_x86_64.spk -noautorunwebapp
Operating system: Linux version 4.4.302+ (root@build7) (gcc version 12.2.0 (GCC) ) #86009 SMP Wed Nov 26 18:45:09 CST 2025
OS/Process: x64/x64
Framework: .NET 8.0.25
Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
Processor count: 4
Data path: /var/packages/EmbyServer/var
Application path: /volume1/@appstore/EmbyServer/system
System.IO.DirectoryNotFoundException: System.IO.DirectoryNotFoundException: Could not find a part of the path '/var/packages/EmbyServer/var/cache/virtualtv/VirtualTV-eee89b7aa451445bbe6fba4aa8cb140c.json'.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.FileStream..ctor(String path, FileStreamOptions options)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, Int32 bufferSize, FileOpenOptions fileOpenOptions, Int64 preAllocationSize)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, FileOpenOptions fileOpenOptions, Int64 preAllocationSize)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileOpenOptions fileOpenOptions, Int64 preAllocationSize)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileOpenOptions fileOpenOptions)
at Emby.Common.Implementations.Serialization.JsonSerializer.DeserializeFromFile[T](String file)
at VirtualTV.Services.TVService.TVService.GetProgramFromFileCache(VirtualChannel virtualChannel, DateTimeOffset programStartDate)
Source: System.Private.CoreLib
TargetSite: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean)

 

Re the Channel Editor... I'm not seeing checkboxes here with libraries that relate to the Channel Content Type selected higher up. If I change the Channel Content Source to Collections - I do see checkboxes for collections. But it's blank if Rules is selected.

image.thumb.png.a04e9ea8f73c90000e72eed8d1af3e73.png

Thank you

  • Solution
pünktchen
Posted
30 minutes ago, s1mwest said:

I'm not seeing checkboxes here with libraries that relate to the Channel Content Type selected higher up.

And that's the problem. Please make sure that the Emby library user you have selected in the channel editor also has permissions to access your libraries in his Emby user profile. If the user already has those permissions - remove and reapply them.

s1mwest
Posted

Removing and reapplying permissions worked - thank you very much indeed!

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...