Jump to content

Losing library


Recommended Posts

sa2000
Posted

At this moment, the cause is unknown and thoughts are it might be to do with the QuFirewall on the QNAP. It may require extra emby server logging and/or tcpdump traffic capture run on the QNAP.

We may need to have the algorithm refined for determing the difference between a folder being removed by the user and a folder being inaccessible for whatever reason - for the latter we should not remove the media items from the database

Ford Fairlane
Posted
20 hours ago, sa2000 said:

At this moment, the cause is unknown and thoughts are it might be to do with the QuFirewall on the QNAP. It may require extra emby server logging and/or tcpdump traffic capture run on the QNAP.

We may need to have the algorithm refined for determing the difference between a folder being removed by the user and a folder being inaccessible for whatever reason - for the latter we should not remove the media items from the database

there is another strange thing that happens when the libary is empty.

when it starts to repopulate, if all the folders are back but all empty and its just the folder name viewable.

if i go to any folder and identify it, come back out and refresh.

The folder is repopulated with all seasons and episodes, its as if emby has deleted the entire libary at the surface level but doesnt realise everything is possibly still there.

Posted
On 1/20/2026 at 11:36 AM, sa2000 said:

It happened at 11:49 am on the 20th - starting at this time

2026-01-20 11:49:06.363 Info App: ValidatePhysicalRoots start validating 192739 Tv smb://192.168.0.112/Tv
2026-01-20 11:49:11.515 Info App: Removing item from database, Type: Series, Name: The Simpsons, Path: smb://192.168.0.112/Tv/The Simpsons, Id: 278843

No indication in the log as to why. A similar action the day before did not remove the paths from the database

2026-01-19 11:49:29.616 Info App: ValidatePhysicalRoots start validating 192739 Tv smb://192.168.0.112/Tv

You then restored the database at 12:26

Maybe enabling debug logging would have extra clues for next time it happens

the only errors relating to the network are much earlier relating to 239.255.255.250:1900 being unreachable.

I don't know if the underlying reason for these errors affects smb operation in anyway - but it was the first scan after these errors

Example:

2026-01-20 02:44:07.042 Error App: Error sending socket message from 0.0.0.0:1900 to 239.255.255.250:1900
System.Net.Sockets.SocketException: System.Net.Sockets.SocketException (101): Network is unreachable

This shows 3 scans with the 3rd one removing the media items from the database

2026-01-19 11:49:29.616 Info App: ValidatePhysicalRoots start validating 192739 Tv smb://192.168.0.112/Tv
2026-01-19 11:55:04.717 Info App: ValidatePhysicalRoots completed validating 192739 Tv smb://192.168.0.112/Tv

2026-01-19 23:49:23.158 Info App: ValidatePhysicalRoots start validating 192739 Tv smb://192.168.0.112/Tv
2026-01-19 23:54:44.980 Info App: ValidatePhysicalRoots completed validating 192739 Tv smb://192.168.0.112/Tv

2026-01-20 11:49:06.363 Info App: ValidatePhysicalRoots start validating 192739 Tv smb://192.168.0.112/Tv
2026-01-20 11:49:11.515 Info App: Removing item from database, Type: Series, Name: The Simpsons, Path: smb://192.168.0.112/Tv/The Simpsons, Id: 278843
2026-01-20 11:49:15.016 Info App: Removing item from database, Type: Series, Name: American Dad!, Path: smb://192.168.0.112/Tv/American Dad, Id: 278844

. . . etc . . .  in total 189 shows removed from the database

2026-01-20 11:49:59.914 Info App: Removing item from database, Type: Folder, Name: Derry Gi, Path: smb://192.168.0.112/Tv/Derry Gi, Id: 279031
2026-01-20 11:50:00.063 Info App: ValidatePhysicalRoots completed validating 192739 Tv smb://192.168.0.112/Tv

May require adding additional logging - cc @Luke

 

When the server queries for the contents of smb://192.168.0.112/Tv, the smb server is acting like it's available but returning an empty set. Currently the way Emby Server works with this is that if the SMB server throws an error, then it will treat it as offline and won't remove anything. But this is not what's happening here.

Posted
On 1/20/2026 at 12:46 PM, Ford Fairlane said:


previously it would remove everything, then i disabled real time monitoring and was fine, then a few updates later it was just constantly removing everything

 

 

the realtime monitor doesn't do anything with the smb protocol, so whether you have it enabled or not for this library makes no difference. The fact that you saw different behavior is purely coincidental.

Posted

To prove this, we could add some logging of the scanned directory contents to show that it's coming up as an empty list of files. But then the question is what do we do about it.

So this smb share is on your WD? Is it running OS 5?

Ford Fairlane
Posted
7 hours ago, Luke said:

To prove this, we could add some logging of the scanned directory contents to show that it's coming up as an empty list of files. But then the question is what do we do about it.

So this smb share is on your WD? Is it running OS 5?

yes and yes.

i did a test and re started firewall on qnap, libary has returned as empty, repopulating now and firewall disabled.

will give it 4 days once populated to see if this is whats triggering it.

  • Thanks 1
sa2000
Posted (edited)

What could be interesting to establish, is to see if there is a WD angle here or purely the way the QNAP QuFirewall blocks access.

So one thing to try, at some point,  is to have a test library on the QNAP with an smb path to, say, a windows PC folder and see if that gets lost with the QuFirewall enabled

 

Edited by sa2000
Ford Fairlane
Posted

repopulating od drive took forever, its now about 98% complete.

hopefully over the next 5 days will be uneventful and it wont delete all.

  • Thanks 2
Ford Fairlane
Posted

thats it been a week and the folder is still populated.

i disabled firewall but also the daily checks and scans.

 

everything seems fine.

  • Thanks 1
sa2000
Posted
On 07/02/2026 at 09:39, Ford Fairlane said:

disabled firewall but also the daily checks and scans.

You could try now to keep the QNAP firewall disabled but re-introducing daily scans 

Ford Fairlane
Posted
On 09/02/2026 at 13:27, sa2000 said:

You could try now to keep the QNAP firewall disabled but re-introducing daily scans 

ive restarted scheduled tasks.

if it turns out to be firewall, what do you suppose would be best option for me to fix it?

  • Thanks 1
sa2000
Posted
1 hour ago, Ford Fairlane said:

if it turns out to be firewall, what do you suppose would be best option for me to fix it?

I don't know if there would be a way for Emby Server to detect that it is a firewall block and treat it in same way as the path is not available. 

Maybe the firewall has configuration options for whitelisting specific paths. Lets wait until that is confirmed and then would require you to look into what firewall options exist and if QNAP support can help you. May be some web search on the qnap firewall and smb

My understanding that access to the smb path is not being failed but an empty directory listing is being returned - which is causing the problem

 

  • Like 1
Ford Fairlane
Posted
48 minutes ago, sa2000 said:

I don't know if there would be a way for Emby Server to detect that it is a firewall block and treat it in same way as the path is not available. 

Maybe the firewall has configuration options for whitelisting specific paths. Lets wait until that is confirmed and then would require you to look into what firewall options exist and if QNAP support can help you. May be some web search on the qnap firewall and smb

My understanding that access to the smb path is not being failed but an empty directory listing is being returned - which is causing the problem

 

i had mentioned in an earlier post that when the folder appears empty, i start a libary scan to repopulate.

 

now when this happens, all named folders appear, but with no content inside folders.

but if i went to a series and did identify, and i can back out within a few seconds the folder would be completely repopulated with everything back.

but if i didnt do this it would take a day or two to repopulate

sa2000
Posted
4 minutes ago, Ford Fairlane said:

i had mentioned in an earlier post that when the folder appears empty,

That is the earlier removals from the database - the removals is what we need to try to overcome. Hopefully there would be some firewall settings. Lets wait and confirm it is a firewall issue

 

  • Like 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...