Skip to content

Crash in rb-inotify if file is not accessible is not handled gracefully #557

@sebbASF

Description

@sebbASF

I tried watching a directory on Ubuntu (20.04). This has a link to a directory containing some files which are not accessible to the logged in user.

When such a file is encountered, listen crashes (see sample below).
it would be better if it reported the issue and carried on - or at least provide the option to do so.

23: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/listener.rb:92:in `start'
22: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:72:in `transition'
21: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:105:in `transition_with_callbacks!'
20: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:124:in `call'
19: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:124:in `instance_eval'
18: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/listener.rb:71:in `block in <class:Listener>'
17: from /usr/lib/ruby/2.7.0/forwardable.rb:235:in `start'
16: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:66:in `start'
15: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:42:in `configure'
14: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:42:in `each'
13: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:47:in `block in configure'
12: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/linux.rb:30:in `_configure'
11: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `watch'
10: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `each'
 9: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:210:in `block in watch'
 8: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `watch'
 7: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `each'
 6: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:210:in `block in watch'
 5: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `watch'
 4: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `each'
 3: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:210:in `block in watch'
 2: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:200:in `watch'
 1: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:200:in `new'

/var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:200:in `initialize': Permission denied @ dir_initialize - path/to/file (Errno::EACCES)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions