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

Trollmoves Server should crash if "origin" directory doesn't exist #118

Open
pnuu opened this issue May 13, 2022 · 3 comments
Open

Trollmoves Server should crash if "origin" directory doesn't exist #118

pnuu opened this issue May 13, 2022 · 3 comments
Assignees
Labels

Comments

@pnuu
Copy link
Member

pnuu commented May 13, 2022

Describe the bug
Trollmoves Server (move_it_server.py) should crash if the followed data directory (origin in config) doesn't exist. At the moment only ERROR pyinotify] add_watch: cannot watch /path/to/dir WD=-1, Errno=No such file or directory (ENOENT) is logged and the process hangs. If the directory is created without a restart, the process doesn't notice it.

To Reproduce

Create a test.ini file:

[test]
origin = /path/to/nonexistent/directory
topic = /foo
request_port = 9201

Start Trollmoves Server:

move_it_server.py -v test.ini

Expected behavior
The process should crash so that the problem would be evident ASAP.

Actual results

[2022-05-13 10:28:33,036 INFO     move_it_server] Starting up.
[2022-05-13 10:28:33,040 DEBUG    trollmoves.server] New config file detected: test.ini
[2022-05-13 10:28:33,040 WARNING  trollmoves.server] Station is not defined in config file
[2022-05-13 10:28:33,040 DEBUG    trollmoves.server] Station is 'unknown'
[2022-05-13 10:28:33,040 DEBUG    trollmoves.server] Created request manager on port 9201
[2022-05-13 10:28:33,040 INFO     trollmoves.server] Using inotify notifier
[2022-05-13 10:28:33,043 ERROR    pyinotify] add_watch: cannot watch /path/to/nonexistent WD=-1, Errno=No such file or directory (ENOENT)
[2022-05-13 10:28:33,043 ERROR    pyinotify] add_watch: cannot watch /path/to/nonexistent WD=-1, Errno=No such file or directory (ENOENT)
[2022-05-13 10:28:33,044 DEBUG    trollmoves.server] Added test
[2022-05-13 10:28:33,044 DEBUG    trollmoves.server] Reloaded config from test.ini
[2022-05-13 10:28:36,044 DEBUG    trollmoves.server] done reloading config
[2022-05-13 10:28:37,045 DEBUG    posttroll.publisher] Publish heartbeat (min_interval is 30.0 sec)

Environment Info:

  • OS: Linux
  • Trollmoves Version: any
@pnuu pnuu added the bug label May 13, 2022
@pnuu pnuu self-assigned this May 13, 2022
@mraspaud
Copy link
Member

I agree.

Two quick thoughts though:

  • The move_it_mirror should not crash in this case
  • I don't remember if this is the case, but if move_it_server accepts posttroll message as input for files, this will need to be taken into account.

@pnuu
Copy link
Member Author

pnuu commented May 13, 2022

Yeah, I think this should happen only for the inotify variant. And will need to have a look how Mirror handles this case.

@mraspaud
Copy link
Member

I did quite some refactoring in my latest PR, hopefully it doesn't come in the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants