EmonHub "thread is dead"

I have had emonhub die a few times now, going into Setup, Emonhub, Restart bring it back into life. are they any log files i can look at? or anyway to monitor the Emonhub and restart it if the is a problem.

if i download the log all that is says is:

2017-05-04 10:54:18,664 WARNING  MainThread MQTT thread is dead
2017-05-04 10:54:18,665 WARNING  MainThread RFM2Pi thread is dead
2017-05-04 10:54:18,665 WARNING  MainThread BMWi3 thread is dead
2017-05-04 10:54:18,866 WARNING  MainThread ModbusTCP thread is dead
2017-05-04 10:54:18,867 WARNING  MainThread MQTT thread is dead
2017-05-04 10:54:18,868 WARNING  MainThread RFM2Pi thread is dead
2017-05-04 10:54:18,868 WARNING  MainThread BMWi3 thread is dead
2017-05-04 10:54:19,101 WARNING  MainThread ModbusTCP thread is dead
2017-05-04 10:54:19,102 WARNING  MainThread MQTT thread is dead
2017-05-04 10:54:19,103 WARNING  MainThread RFM2Pi thread is dead
2017-05-04 10:54:19,103 WARNING  MainThread BMWi3 thread is dead
2017-05-04 10:54:19,304 WARNING  MainThread ModbusTCP thread is dead
2017-05-04 10:54:19,305 WARNING  MainThread MQTT thread is dead
2017-05-04 10:54:19,306 WARNING  MainThread RFM2Pi thread is dead
2017-05-04 10:54:19,306 WARNING  MainThread BMWi3 thread is dead
2017-05-04 10:54:19,507 WARNING  MainThread ModbusTCP thread is dead
2017-05-04 10:54:19,508 WARNING  MainThread MQTT thread is dead
2017-05-04 10:54:19,508 WARNING  MainThread RFM2Pi thread is dead
2017-05-04 10:54:19,509 WARNING  MainThread BMWi3 thread is dead

Sorry to say others have had the same issue and there are a few topics relating to restarting the emonhub:
https://community.openenergymonitor.org/search?q=MQTT%20thread%20is%20dead

and if you search just “thread is dead” (omitting “mqtt”) it finds considerably more threads.

The reason all the threads are dead is because the emon-pi variant is not multi-thread safe and some interfacers are spawned from within other interfacer threads rather each interfacer being in it’s own thread. Once one falls they all tumble.

There is no information in the log files, the individual interfacers should have error handling and error messages so that it doesn’t fail and provides info on any issues, when that doesn’t happen the “thread is dead” error message is just there to ensure the interfacer cannot fail silently, the “thread is dead” message shouldn’t ever be seen.

All that can be assumed from that log is that one (or more) of those 4 interfacers is failing as it has a fault or it’s recieving data it cannot handle from the connected source. If you have made any changes recently thats the place to start looking, otherwise try disabling one of the interfacers at a time for a few days to see if the system runs ok at any time to narrow the search.