fdm-monster / fdm-monster

3D printer farm management platform for local or in-cloud usage using OctoPrint.
https://docs.fdm-monster.net/
GNU Affero General Public License v3.0
72 stars 9 forks source link

Database connection test at boot quits and causes BOOT_TASKS not to fire at the second attempt #2001

Closed tophattwaffle closed 1 year ago

tophattwaffle commented 1 year ago

To Reproduce

  1. Import printers from Octofarm
  2. Paste Octofarm JSON
  3. Click Create
  4. Page won't show new printers until you leave the page and come back.

https://github.com/fdm-monster/fdm-monster/assets/6774125/91c1d0bd-6c96-4abc-93dc-a385311dfb20

davidzwa commented 1 year ago

Same here, I think I have an idea. I'll validate an import test to exclude docker and mongodb startup issues. If that's not the issue, I'll get back to you here.

Since 1.4.0 a lot of the printer socket setup has been touched, so a lot of surface area for bugs was created.

davidzwa commented 1 year ago

I've tried to test things locally. I believe the BOOT_TASKS are being skipped due to an unforeseen edge case at start. This is the log entry to look for: 20:03:08 0|FDM | 2023-06-28T20:03:08: 28/06/2023, 20:03:08 | WARN | BootTask | Starting in safe mode due to SAFEMODE_ENABLED

I fixed it by carefully scanning the code for issues and in the end I found a flag that was being defaulted to "boot in safe mode" on the second boot attempt. This flag I've removed altogether as it was not meant for this and its purpose was not being used to advantage anymore (testing).