Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "An uncaught exception occurred" #56

Open
sharp004 opened this issue Jan 29, 2023 · 4 comments
Open

Error "An uncaught exception occurred" #56

sharp004 opened this issue Jan 29, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sharp004
Copy link

sharp004 commented Jan 29, 2023

Hello,

I used your code to auto-generate the script and it succesfully run at boot, with a config file where I added my watched folder. I restarted the syno and opened /var/log/synoindexwatcher.log, I get this error :

2023-01-29 23:16:46,561 INFO Adding watch for path: /volume1/video
2023-01-29 23:16:48,102 INFO Waiting for media file changes...
2023-01-29 23:20:53,335 ERROR An uncaught exception occurred
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/synoindexwatcher/__main__.py", line 225, in <module>
    start()
  File "/usr/lib/python3.8/site-packages/synoindexwatcher/__main__.py", line 202, in start
    fullpath = os.path.join(inotify.get_path(event.wd), event.name)
  File "/usr/lib/python3.8/site-packages/inotifyrecursive/inotifyrecursive.py", line 122, in get_path
    path = self.__info[wd]["name"]
KeyError: -1

FYI, I've set fs.inotify.max_user_watches = 204800 at boot with the readme method.
What am I missing?

@letorbi letorbi self-assigned this Feb 1, 2023
@letorbi
Copy link
Owner

letorbi commented Feb 1, 2023

Hi sharp,

unfortunately I cannot identify the problem right away from your description. I will investigate into it, but it may take some time, since I'm quite busy right now.

Could you run synoindexwatcher with the --loglevel=DEBUG option? This should print more information, which might point to the root of the problem.

@LapinFou
Copy link

LapinFou commented Jul 17, 2023

Running DSM7, I encountered the same error. Something went wring in the inotifyrecursive package.

[...]
2023-07-17 18:34:10,259 DEBUG Removed info for watch 41
2023-07-17 18:34:10,259 DEBUG Removed info for watch 40
2023-07-17 18:34:10,260 DEBUG Removed info for watch 6
2023-07-17 18:34:10,260 ERROR An uncaught exception occurred
Traceback (most recent call last):
  File "/usr/local/var/venv/synoindexwatcher/lib/python3.8/site-packages/synoindexwatcher/__main__.py", line 225, in <module>
    start()
  File "/usr/local/var/venv/synoindexwatcher/lib/python3.8/site-packages/synoindexwatcher/__main__.py", line 200, in start
    for event in inotify.read():
  File "/usr/local/var/venv/synoindexwatcher/lib/python3.8/site-packages/inotifyrecursive/inotifyrecursive.py", line 131, in read
    self.__clr_infos()
  File "/usr/local/var/venv/synoindexwatcher/lib/python3.8/site-packages/inotifyrecursive/inotifyrecursive.py", line 53, in __clr_infos
    self.__rm_info(wd)
  File "/usr/local/var/venv/synoindexwatcher/lib/python3.8/site-packages/inotifyrecursive/inotifyrecursive.py", line 70, in __rm_info
    del self.__info[parent]["children"][name]
KeyError: -1
2023-07-17 18:36:51,774 INFO Adding watch for path: /volume1/download/Backup
2023-07-17 18:36:51,786 DEBUG Added watch 1
2023-07-17 18:36:51,786 DEBUG Added info for watch 1: {'children': {}, 'filter': <function build_filter.<locals>.filter at 0x7f46cc430790>, 'mask': 970, 'name': '/volume1/downloa
d/Backup', 'parent': -1}
2023-07-17 18:36:51,814 DEBUG Added watch 2
[...]

It seems to occur when the NAS is rebooting and stopping the synoindexwatcher service. At least, that's my guess based on the log timestamp.

@letorbi letorbi added the bug Something isn't working label Jul 17, 2023
@letorbi
Copy link
Owner

letorbi commented Jul 17, 2023

Thanks for the debug output - I actually gave me some hints where to look. I won't have time to work on the issue until end of August due to other time-intensive plans, but I won't forget about it.

@LapinFou
Copy link

You're very welcome.
If you need more information, don't hesitate to ask.
The interesting thing is that when I manually stop the service through an SSH connection, I don't see the DEBUG Removed info in the log file. I only get this debug message: INFO Process received SIGTERM signal.
The "removed" message appears only when the NAS is rebooting. 😟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants