Skip to content

fix(updater): install Happy-Hare mmu_server Moonraker component - #366

Open
gmmcosta15 wants to merge 9 commits into
devfrom
fix/updater-mmu-server
Open

gmmcosta15 wants to merge 9 commits into
devfrom
fix/updater-mmu-server

Conversation

@gmmcosta15

@gmmcosta15 gmmcosta15 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Feature
  • Bug Fix
  • Code Refactor
  • Documentation

Every RF50 box has [mmu_server] in moonraker.conf but no moonraker/components/mmu_server.py. Happy-Hare's interactive installer was dropped from components.yaml because it edits printer.cfg, and that also dropped its Moonraker component. Without the component, every UI gate-map edit on an AMU box fails spoolman_push_gate_map and shows an ERROR popup. The slicer placeholder preprocessor (!referenced_tools!, !colors!, ...) is missing as well, so MMU_START_SETUP gets num_colors=-1. This PR ships a pinned Happy-Hare checkout through the updater and links only mmu_server.py into Moonraker, without running HH's installer.

Changes

  • components.yaml: Happy-Hare v3 component pinned to d5cce9f9 (v3.4.2 mmu_server + Moonraker PATCH-body fix), install_if_missing, no service
  • hooks/Happy-Hare.sh: symlink mmu_server.py into Moonraker components, as HH link_mmu_plugins does, and add it to Moonraker's info/exclude (best effort, WARN on failure)
  • hooks/Happy-Hare.sh: restart Moonraker only when the link or mmu_server.py changed and [mmu_server] is configured; the argv matches the install-updater.sh sudoers rule
  • hooks/Happy-Hare.sh: no restart when the caller restarts Moonraker itself (BS_UPDATER_PENDING_RESTARTS) or a print is running (BS_UPDATER_PRINTING)
  • hooks/moonraker.sh: new; a Moonraker reclone gets the link and exclude line back, restarts only after a boot reclone, removes a link left by a failed HH provision, never fails the Moonraker update
  • executor.run_hook: extra_env, which can never override COMPONENT_PATH/NEW_HASH/PREV_HASH
  • service: batch and provision hooks get the batch's pending verified restarts; a pending service the batch never restarted gets a verified restart afterwards
  • service: the boot-reclone hook flags a running print
  • service: a failed follow-up retries up to 3 times instead of once; the count is kept in the marker so a crash or reboot still counts, and the dbus pass skips apt while a retry is pending

Motivation

The updater shipped [mmu_server] in moonraker.conf without the module that implements it, so Moonraker logs ModuleNotFoundError plus an "Unparsed config section" warning on every start, and Happy-Hare's Spoolman sync fails. There is deliberately no service: key. _undo_provision disables the component's service when a provision fails, and with service: moonraker.service that would disable Moonraker. mmu_server also takes over Moonraker's METADATA_SCRIPT for every upload, so upload metadata and thumbnails should be checked on the simulator.

Tests

  • TestHappyHareHook (14): provision, sudoers argv vs installer + manifest, pending/other pending restarts, link-only, printing, unwritable exclude, idempotent update, changed file, no section, copied file replaced, exclude without newline, no Moonraker, bad checkout
  • TestMoonrakerHook (7): update relinks without restart, boot reclone restarts, intact link restores exclude, no HH, failed-provision link removed, foreign link kept, relink failure never fails the hook
  • TestPinnedCheckoutIsEnforced (3), test_shipped_happy_hare_is_pinned_without_service
  • Service: pending restarts per hook, dropped component, provision defers to batch, fallback restart after a failed batch, boot-reclone print flag, follow-up retry and try limit; dbus: retrying follow-up emits status without apt; executor: extra_env never overrides component vars

@gmmcosta15
gmmcosta15 requested a review from a team October 23, 2026 08:35
@gmmcosta15 gmmcosta15 self-assigned this Oct 23, 2026
@gmmcosta15 gmmcosta15 added bug Something is broken, or a fix for it updater Field updates and self-heal labels Oct 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken, or a fix for it updater Field updates and self-heal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants