emsm icon indicating copy to clipboard operation
emsm copied to clipboard

Guard plugin won't restart worlds after upgrade to Debian 9

Open SilkAndSlug opened this issue 5 years ago • 1 comments

I upgraded to Debian 9 over the weekend, and Guard didn't (re)start my worlds.

Initially, Guard couldn't restart any of my worlds. I've since specified Java 8 for the Forge-powered worlds (see Issue #86) and Guard can now restart those -- but not the Vanilla worlds. I can start the Vanilla worlds with the Worlds plugin.

Cronjob minecraft -W guard --error-action restart --output-format text gives e.g. :

creative
========

failed_test:   status
test_message:  world is offline
test_time:     Sun Jul 21 11:01:01 2019
error_action:  restart

Command sudo minecraft -w creative worlds --start gives :

creative:
     the world is now online

Command sudo minecraft -w creative worlds --status gives :

creative:
     online

This is with 6.0.3b0

SilkAndSlug avatar Jul 21 '19 11:07 SilkAndSlug

I've finally had time to (clumsily) look into this. The proximal cause is line 445 in plugins/guard.py. It only restarts the world if db_record.error_action is None -- it never is, so never runs. Deleting the if-statement (and de-indenting the self._handle_error() line) enables the guard plugin to restart the worlds.

I.e.

            if db_record.get("error_action") is None \
               or db_record.get("error_action") != args.guard_error_action:
                self._handle_error(world, args)

becomes

            self._handle_error(world, args)

Maybe someone who's comfortable in Python would either raise a Pull Request, or dig deeper into that error_action=None ?

SilkAndSlug avatar Aug 31 '19 13:08 SilkAndSlug