martomi / chiadog

A watch dog providing a peace in mind that your Chia farm is running smoothly 24/7.
MIT License
458 stars 120 forks source link

[BUG] Handle ValueError in Windows Remote Log Consumer #258

Closed pieterhelsen closed 3 years ago

pieterhelsen commented 3 years ago

Describe the bug

ValueError in remote Windows log consumer needs to be handled better. See discussion #256 for more details.

[2021-07-12 21:11:42] [ DEBUG] --- [chan 1] EOF received (1) (channel.py:1212)
Exception in thread Thread-5:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
[2021-07-12 21:11:42] [ DEBUG] --- [chan 1] EOF sent (1) (channel.py:1212)
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/me/chiadog/src/chia_log/log_consumer.py", line 152, in _consume_loop
if self._has_rotated(self._remote_log_path):
File "/home/me/chiadog/src/chia_log/log_consumer.py", line 172, in _has_rotated
self._log_size = int(stdout.readline())
ValueError: invalid literal for int() with base 10: ''

Environment:

martomi commented 3 years ago

@pieterhelsen is this still relevant? I see in the discussion that it was resolved by one of the other fixes already? I just released all bug fixes from dev to main branch so this can be closed if that's the case.

pieterhelsen commented 3 years ago

Well, ideally it will still be handled better than it is now, but the chance of that ValueError being thrown is relatively small, so yeah, think we can just close this one.