[GH-ISSUE #967] [Bug]: Queue item permanently stuck in "printing" state if physical printer drops or ignores MQTT start command #672

Closed
opened 2026-05-06 12:31:48 +02:00 by BreizhHardware · 1 comment

Originally created by @stringham on GitHub (Apr 13, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/967

Originally assigned to: @maziggy on GitHub.

Bug Description

Bambuddy uses an optimistic state update when dispatching prints from the queue. As soon as the MQTT start command is sent, the queue item is updated to printing in the database, and the printer is locked (plate_cleared=False). However, if the physical printer drops, ignores, or fails to execute the MQTT command, Bambuddy never receives a PRINT START event. Because there is no timeout or watchdog mechanism, the queue item becomes permanently orphaned in the printing state (100% in UI) and cannot be recovered without manually editing the SQLite database.

Expected Behavior

Bambuddy should implement a watchdog timer when a print is dispatched. If an MQTT command is sent but the PRINT START event is not detected within a reasonable timeframe (e.g., 30-60 seconds), Bambuddy should assume the command failed, revert the printer's plate_cleared lock, and revert the queue item status to pending.

Steps to Reproduce

This is hard to reproduce consistently because it is a networking issue, but you can simulate it with:

  1. Clear the plate and allow the scheduler to assign a queue item to a printer.
  2. The FTP upload completes successfully.
  3. Bambuddy sends the MQTT start command, marks the database as printing, and sets plate_cleared=False to lock the scheduler.
  4. Simulate failure: The physical printer drops the packet or silently rejects the start command.
  5. The queue item remains stuck in the printing state indefinitely.

Printer Model

P1S

Bambuddy Version

0.2.2.2

Printer Firmware Version

01.09.01.00

Installation Method

Docker

Operating System

Linux (Ubuntu/Debian)

Relevant Logs / Support Package

1. The Failed Print (Job 369) - Stuck in "Printing"
(Notice the successful dispatch, but the total absence of a subsequent PRINT START detected event).

2026-04-13 15:52:24,576 INFO [backend.app.services.bambu_ftp] FTP upload complete: /my-print.3mf
2026-04-13 15:52:24,590 INFO [backend.app.services.print_scheduler] Queue item 369: Status set to 'printing', sending print command...
2026-04-13 15:52:24,590 INFO [backend.app.services.bambu_mqtt] [01P...] Sending print command: {"print": {"sequence_id": "20000", "command": "project_file"...
2026-04-13 15:52:24,590 INFO [backend.app.services.print_scheduler] Queue item 369: Print started successfully - my-print.3mf
2026-04-13 15:52:24,592 INFO [backend.app.services.print_scheduler] Queue: printer 2 not available — connected=True, state=FINISH, plate_cleared=False

2. A Successful Print (Job 370) - For Comparison
(Notice the MQTT command locks the plate at 16:04:03, and exactly 8 seconds later, the printer acknowledges with PRINT START detected).

2026-04-13 16:04:03,182 INFO [backend.app.services.print_scheduler] Queue item 370: Status set to 'printing', sending print command...
2026-04-13 16:04:03,182 INFO [backend.app.services.bambu_mqtt] [01P...] Sending print command: {"print": {"sequence_id": "20000", "command": "project_file"...
2026-04-13 16:04:03,182 INFO [backend.app.services.print_scheduler] Queue item 370: Print started successfully - my-print-2.gcode.3mf
2026-04-13 16:04:03,184 INFO [backend.app.services.print_scheduler] Queue: printer 1 not available — connected=True, state=FINISH, plate_cleared=False
2026-04-13 16:04:11,555 INFO [backend.app.services.bambu_mqtt] [01P...] PRINT START detected - file: my-print-2.3mf, subtask: my-print-2, is_new: True, is_file_change: False

Screenshots

No response

Additional Context

Workaround Used: Manually updated the print_queue SQLite table using the Python interpreter inside the container to change the status of the orphaned job from printing back to pending.

Checklist

  • I have searched existing issues to ensure this bug hasn't already been reported
  • I am using the latest version of Bambuddy
  • My printer is set to LAN Only mode
  • My printer has Developer Mode enabled
Originally created by @stringham on GitHub (Apr 13, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/967 Originally assigned to: @maziggy on GitHub. ### Bug Description Bambuddy uses an optimistic state update when dispatching prints from the queue. As soon as the MQTT start command is sent, the queue item is updated to `printing` in the database, and the printer is locked (`plate_cleared=False`). However, if the physical printer drops, ignores, or fails to execute the MQTT command, Bambuddy never receives a `PRINT START` event. Because there is no timeout or watchdog mechanism, the queue item becomes permanently orphaned in the `printing` state (100% in UI) and cannot be recovered without manually editing the SQLite database. ### Expected Behavior Bambuddy should implement a watchdog timer when a print is dispatched. If an MQTT command is sent but the `PRINT START` event is not detected within a reasonable timeframe (e.g., 30-60 seconds), Bambuddy should assume the command failed, revert the printer's `plate_cleared` lock, and revert the queue item status to `pending`. ### Steps to Reproduce This is hard to reproduce consistently because it is a networking issue, but you can simulate it with: 1. Clear the plate and allow the scheduler to assign a queue item to a printer. 2. The FTP upload completes successfully. 3. Bambuddy sends the MQTT start command, marks the database as `printing`, and sets `plate_cleared=False` to lock the scheduler. 4. Simulate failure: The physical printer drops the packet or silently rejects the start command. 5. The queue item remains stuck in the printing state indefinitely. ### Printer Model P1S ### Bambuddy Version 0.2.2.2 ### Printer Firmware Version 01.09.01.00 ### Installation Method Docker ### Operating System Linux (Ubuntu/Debian) ### Relevant Logs / Support Package **1. The Failed Print (Job 369) - Stuck in "Printing"** (Notice the successful dispatch, but the total absence of a subsequent PRINT START detected event). ``` 2026-04-13 15:52:24,576 INFO [backend.app.services.bambu_ftp] FTP upload complete: /my-print.3mf 2026-04-13 15:52:24,590 INFO [backend.app.services.print_scheduler] Queue item 369: Status set to 'printing', sending print command... 2026-04-13 15:52:24,590 INFO [backend.app.services.bambu_mqtt] [01P...] Sending print command: {"print": {"sequence_id": "20000", "command": "project_file"... 2026-04-13 15:52:24,590 INFO [backend.app.services.print_scheduler] Queue item 369: Print started successfully - my-print.3mf 2026-04-13 15:52:24,592 INFO [backend.app.services.print_scheduler] Queue: printer 2 not available — connected=True, state=FINISH, plate_cleared=False ``` **2. A Successful Print (Job 370) - For Comparison** (Notice the MQTT command locks the plate at 16:04:03, and exactly 8 seconds later, the printer acknowledges with PRINT START detected). ``` 2026-04-13 16:04:03,182 INFO [backend.app.services.print_scheduler] Queue item 370: Status set to 'printing', sending print command... 2026-04-13 16:04:03,182 INFO [backend.app.services.bambu_mqtt] [01P...] Sending print command: {"print": {"sequence_id": "20000", "command": "project_file"... 2026-04-13 16:04:03,182 INFO [backend.app.services.print_scheduler] Queue item 370: Print started successfully - my-print-2.gcode.3mf 2026-04-13 16:04:03,184 INFO [backend.app.services.print_scheduler] Queue: printer 1 not available — connected=True, state=FINISH, plate_cleared=False 2026-04-13 16:04:11,555 INFO [backend.app.services.bambu_mqtt] [01P...] PRINT START detected - file: my-print-2.3mf, subtask: my-print-2, is_new: True, is_file_change: False ``` ### Screenshots _No response_ ### Additional Context **Workaround Used**: Manually updated the print_queue SQLite table using the Python interpreter inside the container to change the status of the orphaned job from printing back to pending. ### Checklist - [x] I have searched existing issues to ensure this bug hasn't already been reported - [x] I am using the latest version of Bambuddy - [x] My printer is set to LAN Only mode - [x] My printer has Developer Mode enabled
BreizhHardware 2026-05-06 12:31:48 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@maziggy commented on GitHub (Apr 14, 2026):

This is already fixed and available in branch dev, with the next release or daily build. Please let me know if it works for you now.


If you find Bambuddy useful, please consider giving it a on GitHub — it helps others discover the project!

<!-- gh-comment-id:4241909385 --> @maziggy commented on GitHub (Apr 14, 2026): This is already fixed and available in branch dev, with the next release or daily build. Please let me know if it works for you now. ----- If you find Bambuddy useful, please consider giving it a ⭐ on [GitHub](https://github.com/maziggy/bambuddy) — it helps others discover the project!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#672
No description provided.