Jump to content

Real time monitoring not working


HawkXP71

Recommended Posts

HawkXP71

DSM 7, Synolology 918+

My libraries dont seem to update when new media is added.  Ill drop a couple of new MKV files into appropriate directories, and until I manually "Scan Library Files" the new media isnt picked up.  I do have "Enable Real time monitoring" checked.  

What should I look for in the log file?  Or do I need to enable a debug flag to help track this down?

Link to comment
Share on other sites

HawkXP71

Going through the thread now.  Thanks.  I followed your thread for migration to DSM 7, this should probably be added to the information there. 

I am not seeing any inotify type messages in the log, but Ill update the inotify config

Link to comment
Share on other sites

HawkXP71

I did a reboot of the Emby server (not the NAS box) to confirm I was getting inotify messages, and I was

021-10-07 09:08:06.241 Error LibraryMonitor: Error in Directory watcher for: /volume2/video/Movies
    *** Error Report ***
    Version: 4.6.4.0
    Command line: /volume2/@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 -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
    Operating system: Linux version 4.4.180+ (root@build15) (gcc version 7.5.0 (GCC) ) #41890 SMP Thu Jul 15 03:43:42 CST 2021
    Framework: .NET Core 3.1.13
    OS/Process: x64/x64
    Runtime: volume2/@appstore/EmbyServer/system/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /var/packages/EmbyServer/var
    Application path: /volume2/@appstore/EmbyServer/system
    System.IO.IOException: System.IO.IOException: The configured user limit (8192) on the number of inotify watches has been reached, or the operating system failed to allocate a required resource.
    Source: 
    TargetSite: 
    No Stack Trace Available

So I ran
$ sudo sysctl -w fs.inotify.max_user_watches=204800

and confirmed the file contains the new number

scott@mediabox:/proc/sys/fs/inotify$ cat max_user_watches
204800

I rebooted emby, and no errors :) Then I touched a mkv and saw the update working.  Thanks for all the help.



 

  • Like 1
Link to comment
Share on other sites

@HawkXP71 You should make a scheduled task in Synology to do this on every reboot (of the NAS, not Emby), then you shouldn't encounter any problems in the future

  • Like 1
Link to comment
Share on other sites

HawkXP71
Just now, kaj said:

@HawkXP71 You should make a scheduled task in Synology to do this on every reboot (of the NAS, not Emby), then you shouldn't encounter any problems in the future

That is exactly what i did once I confirmed it worked. 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
Happy2Play
2 minutes ago, Ninko said:

Might seem a silly question, but isn't this something that should be fixed within emby?

But it is a platform/OS issue not a Emby issue.  I guess in theory Emby could script update inotify for you but I don't believe Emby should be modifying system files like this.

  • Like 1
Link to comment
Share on other sites

Oh right ok, didn't know that.

Is this a bug that was introduced in DSM 7.0 or was it always there?

Link to comment
Share on other sites

Happy2Play
1 minute ago, Ninko said:

Oh right ok, didn't know that.

Is this a bug that was introduced in DSM 7.0 or was it always there?

No it has always existed in I believe all Linux/MacOS platforms.  It is just these standards inotify values are not large enough.

Link to comment
Share on other sites

If I was to turn real time monitoring off in emby would that stop the errors in the log?

I assume the scheduled task of scanning media library would continue working?

Link to comment
Share on other sites

Happy2Play
Just now, Ninko said:

If I was to turn real time monitoring off in emby would that stop the errors in the log?

I assume the scheduled task of scanning media library would continue working?

Correct this error is from the filesystem exceeding the inotify set values.  It only affects Real Time Monitoring and has no effect on Library scans.

But is a easy fix provided above or here.

Link to comment
Share on other sites

3 hours ago, Happy2Play said:

But it is a platform/OS issue not a Emby issue.  I guess in theory Emby could script update inotify for you but I don't believe Emby should be modifying system files like this.

Agreed, Emby shouldn't be run as a user that has access to sudo type commands so it would be difficult to do because of permissions. 

Only a system admin should be making changes like this to the system, even though it's a trivial change.

Link to comment
Share on other sites

FrostByte

Maybe this should be in the kb?   

This seems to come up every week and we're always linking to an old thread for someone to sift through.  There are a couple ways to fix it with me preferring to use a bootup task to change both values, but maybe cayars can use one with a little explanation of why/what.

  • Like 1
Link to comment
Share on other sites

I have been meaning to add this info to the KB.

There seems to be a couple different ways to do this.  For example you use the GUI to set this on startup and I tend to use a "sudo" command to make a permanent change.

I seem to recall this working slightly different on a couple OSes as well but can't remember specifics right now.

It probably wouldn't hurt to start a new thread to ask a few people to try changing this value using specific commands to make sure it sticks on restart to verify commands that work and keep updating the KB as we go.  Gotta start somewhere. :)

Edited by cayars
  • Like 1
Link to comment
Share on other sites

Happy2Play
4 hours ago, cayars said:

I have been meaning to add this info to the KB.

Either KB or a Tutorials and Guides topic.

  • Like 2
Link to comment
Share on other sites

HawkXP71
On 10/16/2021 at 9:13 PM, cayars said:

Agreed, Emby shouldn't be run as a user that has access to sudo type commands so it would be difficult to do because of permissions. 

Only a system admin should be making changes like this to the system, even though it's a trivial change.

WHile Emby shouldnt be run as a admin normally, during setup it should be fine to have that level of permissions.  

I dont see why on install, it couldnt verify the value, and on startup log a message saying the message is too small.

Link to comment
Share on other sites

Not possible to do on many OSes.
For example part of DSM 7 update forbids this from taking place.
That's why the user ends up having to do the migration vs our setup scripts (we tried).

Link to comment
Share on other sites

HawkXP71
On 10/18/2021 at 8:50 AM, cayars said:

Not possible to do on many OSes.
For example part of DSM 7 update forbids this from taking place.
That's why the user ends up having to do the migration vs our setup scripts (we tried).

unfortunately that sucks.. :(

Two possible suggestions to easy the issue.

1) In the log, for known issues like this, put a link to the knowledge base page.  So if someone is reviewing their log and see an error that concerns them, they can simply click it, and learn how to fix the issue.

2) On the dashboard page, add a "Run a Checkup" button.  When clicked, it would analyze the log files looking for known issues.  Then list them with their likely solutions (or links to them).



 

Link to comment
Share on other sites

HawkXP71
1 minute ago, Luke said:

Has this helped you resolve this?

Yes. Its fully resolved for me .  Thanks for all your help

  • Like 2
Link to comment
Share on other sites

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