Skip to content

Conversation

@LindsayHill
Copy link
Contributor

These errors in a default installation get tedious

2017-03-16 02:16:11,449 140717658023568 ERROR (unknown file) [-] Traceback (most recent call last):

2017-03-16 02:16:11,449 140717658023568 ERROR (unknown file) [-]   File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2reactor/container/sensor_wrapper.py", line 357, in <module>

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]
2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-] obj.run()

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]   File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2reactor/container/sensor_wrapper.py", line 214, in run

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]
2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-] self._sensor_instance.setup()

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]   File "/opt/stackstorm/packs/linux/sensors/file_watch_sensor.py", line 20, in setup

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]
2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-] raise ValueError('No file_paths configured to monitor')

This change sets the sensor to disabled by default, so people will need to enable it.

These errors in a default installation get tedious
```
2017-03-16 02:16:11,449 140717658023568 ERROR (unknown file) [-] Traceback (most recent call last):

2017-03-16 02:16:11,449 140717658023568 ERROR (unknown file) [-]   File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2reactor/container/sensor_wrapper.py", line 357, in <module>

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]
2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-] obj.run()

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]   File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2reactor/container/sensor_wrapper.py", line 214, in run

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]
2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-] self._sensor_instance.setup()

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]   File "/opt/stackstorm/packs/linux/sensors/file_watch_sensor.py", line 20, in setup

2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-]
2017-03-16 02:16:11,450 140717658023568 ERROR (unknown file) [-] raise ValueError('No file_paths configured to monitor')
```

This change sets the sensor to disabled by default, so people will need to enable it.
Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 those errors are annoying.

Just a side note:
Curious how it will work in packaging. For example, user changed the file which is part of the st2 core code, ex: enabled: true for the rule. On next package upgrade the file most probably will be overwritten back to its initial state: enabled: false and sensor will be disabled on st2ctl reload.
Good to think how to improve this story.

@LindsayHill
Copy link
Contributor Author

Yeah, that could be a problem. Issue is that we're mixing configuration with code. Our moves to separate pack config helped a lot, but they don't address this particular issue. Maybe we need to break out sensor state to a separate config?

@Kami
Copy link
Member

Kami commented Mar 16, 2017

In general I'm fine with this change, but yes, I also see the problem @armab mentioned, but sadly I see no quick or easy solution for it.

@LindsayHill
Copy link
Contributor Author

Nope, no easy fix right now. I think that most people don't use this sensor, but they do get the error messages. So we're better off defaulting to disabling it. One of the wrinkles here is that it's a pack, but it's distributed as part of core code. Would be better if it was a pack on ST2 Exchange, and we only installed it if required (this is also related to pack install idempotency I guess)

@Kami
Copy link
Member

Kami commented Mar 16, 2017

Yeah, we (dzmine) made that decision to install linux pack by default quite a while ago.

I do think it's not a bad idea to have it available by default, but yeah, we eventually need to figure out a better solution but this should do for now (we already do a similar thing for rules).

Let's just make sure this is documented in changelog / similar so people won't be surprised if they configure a sensor and it doesn't work.

@Kami Kami self-requested a review March 16, 2017 16:30
@LindsayHill LindsayHill merged commit f534b14 into master Mar 16, 2017
@LindsayHill LindsayHill deleted the LH/filewatch_disable branch March 16, 2017 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants