Donkie / Spoolman

Keep track of your inventory of 3D-printer filament spools.
MIT License
757 stars 77 forks source link

Can't locate revision identified by '5f069e51bd89' #389

Closed Aergernis closed 1 month ago

Aergernis commented 1 month ago

Hi,

one of my Spoolman instances is not starting anymore. Another spoolman install (on different machine) is starting without problem.

Docker version: 26.1.3 OS: Armbian (24.2.0-trunk) aarch64

spoolman-1  | INFO:     Started server process [1]
spoolman-1  | INFO:     Waiting for application startup.
spoolman-1  | spoolman.main              INFO     Starting Spoolman v0.16.1 (commit: babb95d) (built: 2024-02-04 10:12:19+00:00)
spoolman-1  | spoolman.main              INFO     Using data directory: /home/app/.local/share/spoolman
spoolman-1  | spoolman.main              INFO     Using logs directory: /home/app/.local/share/spoolman
spoolman-1  | spoolman.main              INFO     Using backups directory: /home/app/.local/share/spoolman/backups
spoolman-1  | spoolman.main              INFO     Setting up database...
spoolman-1  | spoolman.database.database INFO     Connecting to database of type "DatabaseType.MYSQL" at "mariadb.localdomain:3306"
spoolman-1  | spoolman.main              INFO     Performing migrations...
spoolman-1  | alembic.runtime.migration  INFO     Context impl MySQLImpl.
spoolman-1  | alembic.runtime.migration  INFO     Will assume non-transactional DDL.
spoolman-1  | alembic.util.messaging     ERROR    Can't locate revision identified by '5f069e51bd89'
spoolman-1  | FAILED: Can't locate revision identified by '5f069e51bd89'
spoolman-1  | ERROR:    Traceback (most recent call last):
spoolman-1  |   File "/home/app/spoolman/.venv/lib/python3.11/site-packages/starlette/routing.py", line 677, in lifespan
spoolman-1  |     async with self.lifespan_context(app) as maybe_state:
spoolman-1  |   File "/home/app/spoolman/.venv/lib/python3.11/site-packages/starlette/routing.py", line 566, in __aenter__
spoolman-1  |     await self._router.startup()
spoolman-1  |   File "/home/app/spoolman/.venv/lib/python3.11/site-packages/starlette/routing.py", line 654, in startup
spoolman-1  |     await handler()
spoolman-1  |   File "/home/app/spoolman/spoolman/main.py", line 94, in startup
spoolman-1  |     subprocess.run(["alembic", "upgrade", "head"], check=True, cwd=project_root)  # noqa: S603, S607, ASYNC101
spoolman-1  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spoolman-1  |   File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
spoolman-1  |     raise CalledProcessError(retcode, process.args,
spoolman-1  | subprocess.CalledProcessError: Command '['alembic', 'upgrade', 'head']' returned non-zero exit status 255.
spoolman-1  |
spoolman-1  | ERROR:    Application startup failed. Exiting.
spoolman-1 exited with code 0
Donkie commented 1 month ago

Are you using multiple spoolman instances pointing to the same database?

Aergernis commented 1 month ago

yes

Donkie commented 1 month ago

That is not supported, and you will end up in issues like this. This has happened because your spoolman instance versions are not the same.

Why do you need multiple instances pointing at the same database?

Aergernis commented 1 month ago

Okay. Thought it would be the best way to shre Spools betwenn different Printers.

So, installing Spoolman on a different Machine and pointing to it in moonracker.conf is the solution i guess?

Donkie commented 1 month ago

Ok, well there is no benefit in hosting multiple Spoolman instances. You can have multiple Moonraker instances pointing to the single Spoolman if you're using multiple printers, that's fine.

Yes that's how you normally do it. Install Spoolman on some central machine and then point all printer's Moonraker instances to that. If you install the latest Spoolman then your issue should go away.

Aergernis commented 1 month ago

Thanks for help. It's working now.