Skip to content

Plugin breaks OctoPrint's startup if no Raspberry Pi is detected #16

@foosel

Description

@foosel

The problem lies with these lines:

if self.isRaspi == False:
self._logger.info("This is not a Raspberry Pi - Plugin halted")
sys.exit(1)

You are nuking the whole on_after_startup handler with the sys.exit(0) here. Never call sys.exit from plugin code, you might be nuking important threads or even the whole server.

This issue so far wasn't really visible due to nothing absolutely important for OctoPrint's core happening in on_after_startup and hence potentially after this plugin has nuked it (it probably interfered with quite a number of third party plugins though). Starting with 1.3.10 this will change however, and this plugin is now breaking the whole server due to that sys.exit(0).

Additionally that gets triggered on a Pi3 even though it definitely IS a Raspberry Pi:

2018-11-20 12:40:11,317 - octoprint.plugins.roomtemp - INFO - This is not a Raspberry Pi - Plugin halted
pi@octopi:~ $ cat /proc/cpuinfo
[...]
Hardware        : BCM2835
Revision        : a02082
[...]
pi@octopi:~ $ cat /proc/device-tree/model
Raspberry Pi 3 Model B Rev 1.2

I'm blacklisting this plugin until this issue is fixed so it doesn't continue to break OctoPrint installs out there, in subtle or potentially not so subtle ways. I've also added additional hardening to OctoPrint against issues like this one that will be part of 1.3.10rc3+.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions