[GH-ISSUE #523] [Bug]: Queue not loading unless filter is applied. WAL file causes malformed schema on startup #335

Closed
opened 2026-05-06 12:28:23 +02:00 by BreizhHardware · 12 comments

Originally created by @Percy2Live on GitHub (Feb 25, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/523

Originally assigned to: @maziggy on GitHub.

Bug Description

Hi,

after updating to the latest version, I ran into an issue where the print queue does not load correctly. I observed this behavior before, hence it's likely not related to the update but due to a corruption of the database when the container is restarted.

Symptoms
The queue page appears empty after a restart of the container.
As soon as I apply any filter, entries suddenly appear. Restarting the container did not help.

Deleting the bambuddy.db files did fix the issue, but then of course the data is gone

Root Cause (identified)
The problem turned out to be related to SQLite WAL mode. The following files are present:

bambuddy.db
bambuddy.db-wal
bambuddy.db-shm

The issue persisted until I stopped the container and deleted the -wal and -shm files (keeping the .db)
After removing the application started normally and the queue worked again.
This strongly suggests that: The WAL file contained inconsistent or corrupted schema data or the application does not properly checkpoint/clean WAL during updates/restarts, or schema migrations are not WAL-safe

Environment
Installation method: Docker via Docker Compose
Database: SQLite (default configuration, WAL mode enabled)
Issue appeared after updating Bambuddy to v0.2.1b3

Attached
I am attaching the original files which caused the issue:
bambuddy.db
bambuddy.db-wal
bambuddy.db-shm

If required I can also share the newly generated wal and shm files for comparison
The issue should be reproducible with these files.

Thanks for your work on Bambuddy 👍

Expected Behavior

Queue should be displayed normally even with no filters applied

Steps to Reproduce

not 100%. Happens sometimes after updates and restarts of the container:

  1. Shutdown container
  2. pull latest image
  3. restart container
  4. queue is empty ("loading")

Printer Model

P1S

Bambuddy Version

0.2.1b3

Printer Firmware Version

01.09.01.00

Installation Method

Docker

Operating System

Docker

Relevant Logs / Support Package

db.zip

Screenshots

No response

Additional Context

No response

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 @Percy2Live on GitHub (Feb 25, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/523 Originally assigned to: @maziggy on GitHub. ### Bug Description Hi, after updating to the latest version, I ran into an issue where the print queue does not load correctly. I observed this behavior before, hence it's likely not related to the update but due to a corruption of the database when the container is restarted. **Symptoms** The queue page appears empty after a restart of the container. As soon as I apply any filter, entries suddenly appear. Restarting the container did not help. Deleting the bambuddy.db files did fix the issue, but then of course the data is gone **Root Cause (identified)** The problem turned out to be related to SQLite WAL mode. The following files are present: bambuddy.db bambuddy.db-wal bambuddy.db-shm The issue persisted until I stopped the container and deleted the -wal and -shm files (keeping the .db) After removing the application started normally and the queue worked again. This strongly suggests that: The WAL file contained inconsistent or corrupted schema data or the application does not properly checkpoint/clean WAL during updates/restarts, or schema migrations are not WAL-safe **Environment** Installation method: Docker via Docker Compose Database: SQLite (default configuration, WAL mode enabled) Issue appeared after updating Bambuddy to v0.2.1b3 **Attached** I am attaching the original files which caused the issue: bambuddy.db bambuddy.db-wal bambuddy.db-shm If required I can also share the newly generated wal and shm files for comparison The issue should be reproducible with these files. Thanks for your work on Bambuddy 👍 ### Expected Behavior Queue should be displayed normally even with no filters applied ### Steps to Reproduce not 100%. Happens sometimes after updates and restarts of the container: 1. Shutdown container 2. pull latest image 3. restart container 4. queue is empty ("loading") ### Printer Model P1S ### Bambuddy Version 0.2.1b3 ### Printer Firmware Version 01.09.01.00 ### Installation Method Docker ### Operating System Docker ### Relevant Logs / Support Package [db.zip](https://github.com/user-attachments/files/25539673/db.zip) ### Screenshots _No response_ ### Additional Context _No response_ ### 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:28:23 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@maziggy commented on GitHub (Feb 25, 2026):

Need a support package please.

<!-- gh-comment-id:3958365137 --> @maziggy commented on GitHub (Feb 25, 2026): Need a support package please.
Author
Owner

@Percy2Live commented on GitHub (Feb 25, 2026):

Put in the broken files and created a loading package:
bambuddy-support-20260225-154500.zip
Queue looks like this:

Image
<!-- gh-comment-id:3959751325 --> @Percy2Live commented on GitHub (Feb 25, 2026): Put in the broken files and created a loading package: [bambuddy-support-20260225-154500.zip](https://github.com/user-attachments/files/25548614/bambuddy-support-20260225-154500.zip) Queue looks like this: <img width="1009" height="720" alt="Image" src="https://github.com/user-attachments/assets/da2b20d6-ca34-406c-a606-557755e6524d" />
Author
Owner

@maziggy commented on GitHub (Feb 25, 2026):

There's something wrong with your setup. Bambuddy cannot connect to your printer via FTPS and MQTT connection is stale.

Do you really have devdeloper mode enabled on the printer?

<!-- gh-comment-id:3960370459 --> @maziggy commented on GitHub (Feb 25, 2026): There's something wrong with your setup. Bambuddy cannot connect to your printer via FTPS and MQTT connection is stale. Do you really have devdeloper mode enabled on the printer?
Author
Owner

@Percy2Live commented on GitHub (Feb 26, 2026):

Yes, verified it - it's enabled
PXL_20260226_163318087.MP~2.jpg

Beside the reported bug everything runs fine

<!-- gh-comment-id:3967753705 --> @Percy2Live commented on GitHub (Feb 26, 2026): Yes, verified it - it's enabled ![PXL_20260226_163318087.MP~2.jpg](https://github.com/user-attachments/assets/00cb51c3-befb-4c11-9378-cc647277298c) Beside the reported bug everything runs fine
Author
Owner

@maziggy commented on GitHub (Feb 26, 2026):

Very weird. Did you reboot the printers after enabling developer mode?

<!-- gh-comment-id:3968116549 --> @maziggy commented on GitHub (Feb 26, 2026): Very weird. Did you reboot the printers after enabling developer mode?
Author
Owner

@maziggy commented on GitHub (Feb 26, 2026):

Ah wait, never asked before: iptables rules are there?

<!-- gh-comment-id:3968124944 --> @maziggy commented on GitHub (Feb 26, 2026): Ah wait, never asked before: iptables rules are there?
Author
Owner

@Percy2Live commented on GitHub (Feb 26, 2026):

Printer rebooted, yes. iptable rules are applied, and you verified that at another bug report.
This is a new support package:
bambuddy-support-20260227-004643.zip

How does this look? The only difference is I deleted the WAL and SHM (same db) and started the container again

<!-- gh-comment-id:3969904730 --> @Percy2Live commented on GitHub (Feb 26, 2026): Printer rebooted, yes. iptable rules are applied, and you verified that at another bug report. This is a new support package: [bambuddy-support-20260227-004643.zip](https://github.com/user-attachments/files/25589777/bambuddy-support-20260227-004643.zip) How does this look? The only difference is I deleted the WAL and SHM (same db) and started the container again
Author
Owner

@maziggy commented on GitHub (Feb 27, 2026):

Fixed in branch 0.2.1. Please let me know if it works now for you.

<!-- gh-comment-id:3971126715 --> @maziggy commented on GitHub (Feb 27, 2026): Fixed in branch 0.2.1. Please let me know if it works now for you.
Author
Owner

@Percy2Live commented on GitHub (Feb 27, 2026):

I'll test, unfortunately this takes time as the issue appears random and cannot be triggered.
After updating to 0.2.1 I noticed the certificate handshake wasn't working anymore, had to use new certificates in bambu studio to connect to bambuddy again. Took me some time to figure this out. Don't know what caused this, just so you know in case you receive more reports after people upgraded to 0.2.1. For now this can be closed, in case the db bug appears again I'll reopen it.
Thanks for fixing!

<!-- gh-comment-id:3973057426 --> @Percy2Live commented on GitHub (Feb 27, 2026): I'll test, unfortunately this takes time as the issue appears random and cannot be triggered. After updating to 0.2.1 I noticed the certificate handshake wasn't working anymore, had to use new certificates in bambu studio to connect to bambuddy again. Took me some time to figure this out. Don't know what caused this, just so you know in case you receive more reports after people upgraded to 0.2.1. For now this can be closed, in case the db bug appears again I'll reopen it. Thanks for fixing!
Author
Owner

@maziggy commented on GitHub (Feb 27, 2026):

Image
<!-- gh-comment-id:3973091277 --> @maziggy commented on GitHub (Feb 27, 2026): <img width="1103" height="613" alt="Image" src="https://github.com/user-attachments/assets/a46b2277-9edc-41da-ac50-25ca4551b719" />
Author
Owner

@Percy2Live commented on GitHub (Feb 27, 2026):

I am aware of this. But I have persistent certificates through the volume, did not change hosts or update the slicer (at least not knowingly)

<!-- gh-comment-id:3973160563 --> @Percy2Live commented on GitHub (Feb 27, 2026): I am aware of this. But I have persistent certificates through the volume, did not change hosts or update the slicer (at least not knowingly)
Author
Owner

@maziggy commented on GitHub (Feb 27, 2026):

When you reinstall Bambuddy it creates new certs.

<!-- gh-comment-id:3973176212 --> @maziggy commented on GitHub (Feb 27, 2026): When you reinstall Bambuddy it creates new certs.
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#335
No description provided.