Skip to content

Ctrl + C on monitor causes attribute error #37

@vdloo

Description

@vdloo

This happens which is kind of ugly:

root@uaijay-vdloo-magweb-cmbl /tmp # /usr/bin/python3 /usr/bin/nginx_config_reloader --monitor
2020-05-07 09:08:51,622 nginx_config_reloader INFO     /data/web/nginx
2020-05-07 09:08:51,696 nginx_config_reloader INFO     Reloading nginx config
2020-05-07 09:08:51,696 nginx_config_reloader INFO     Listening for changes to /data/web/nginx
^C[2020-05-07 09:08:52,851 pyinotify ERROR] add_watch: cannot watch /data/web/nginx WD=-1, Errno=Bad file descriptor (EBADF)
[2020-05-07 09:08:52,851 pyinotify ERROR] add_watch: cannot watch /data/web WD=-1, Errno=Bad file descriptor (EBADF)
2020-05-07 09:08:52,924 nginx_config_reloader INFO     Reloading nginx config
2020-05-07 09:08:52,924 nginx_config_reloader INFO     Listening for changes to /data/web/nginx
Traceback (most recent call last):
  File "/usr/bin/nginx_config_reloader", line 9, in <module>
    load_entry_point('nginx-config-reloader==20200507.105824', 'console_scripts', 'nginx_config_reloader')()
  File "/usr/lib/python3/dist-packages/nginx_config_reloader/__init__.py", line 378, in main
    recursive_watch=args.recursivewatch
  File "/usr/lib/python3/dist-packages/nginx_config_reloader/__init__.py", line 333, in wait_loop
    notifier.loop()
  File "/usr/lib/python3/dist-packages/pyinotify.py", line 1376, in loop
    self.process_events()
  File "/usr/lib/python3/dist-packages/pyinotify.py", line 1276, in process_events
    self._sys_proc_fun.cleanup()  # remove olds MOVED_* events records
AttributeError: 'NoneType' object has no attribute 'cleanup'
root@uaijay-vdloo-magweb-cmbl /tmp # 
root@uaijay-vdloo-magweb-cmbl ~ # python3 --version
Python 3.7.3


root@abbsgf-testtest-magweb-cmbl ~ # nginx_config_reloader --monitor 
2020-05-07 09:09:18,328 nginx_config_reloader INFO     /data/web/nginx
2020-05-07 09:09:18,345 nginx_config_reloader INFO     Failed fixing permissions on watched directory
2020-05-07 09:09:18,396 nginx_config_reloader INFO     Config check failed
2020-05-07 09:09:18,397 nginx_config_reloader INFO     Listening for changes to /data/web/nginx
^C[2020-05-07 09:09:19,093 pyinotify ERROR] add_watch: cannot watch /data/web/nginx WD=-1, Errno=Bad file descriptor (EBADF)
[2020-05-07 09:09:19,094 pyinotify ERROR] add_watch: cannot watch /data/web WD=-1, Errno=Bad file descriptor (EBADF)
2020-05-07 09:09:19,111 nginx_config_reloader INFO     Failed fixing permissions on watched directory
2020-05-07 09:09:19,138 nginx_config_reloader INFO     Config check failed
2020-05-07 09:09:19,139 nginx_config_reloader INFO     Listening for changes to /data/web/nginx
Traceback (most recent call last):
  File "/usr/bin/nginx_config_reloader", line 9, in <module>
    load_entry_point('nginx-config-reloader==20190731.120623', 'console_scripts', 'nginx_config_reloader')()
  File "/usr/lib/python2.7/dist-packages/nginx_config_reloader/__init__.py", line 377, in main
    recursive_watch=args.recursivewatch
  File "/usr/lib/python2.7/dist-packages/nginx_config_reloader/__init__.py", line 332, in wait_loop
    notifier.loop()
  File "/usr/lib/python2.7/dist-packages/pyinotify.py", line 1390, in loop
    self.process_events()
  File "/usr/lib/python2.7/dist-packages/pyinotify.py", line 1288, in process_events
    self._sys_proc_fun.cleanup()  # remove olds MOVED_* events records
AttributeError: 'NoneType' object has no attribute 'cleanup'
root@abbsgf-testtest-magweb-cmbl ~ # python --version
Python 2.7.12

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