joaovitoriasilva/endurain

Backend won't start up.

Closed this issue · 4 comments

I've been trying all night to get this stack to start up. I'm using Docker with the latest image. All of the containers start, except the backend.
This is the error I get, regardless of what I do.

TypeError: 'NoneType' object is not iterable
ERROR:    Application startup failed. Exiting.
Backend startup event
INFO:     Started server process [1]
INFO:     Waiting for application startup.
ERROR:    Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 693, in lifespan
    async with self.lifespan_context(app) as maybe_state:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 569, in __aenter__
    await self._router.startup()
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 672, in startup
    handler()
  File "/app/main.py", line 41, in startup_event
    check_migrations()
  File "/app/main.py", line 71, in check_migrations
    migrations_utils.check_migrations_not_executed(db)
  File "/app/migrations/utils.py", line 53, in check_migrations_not_executed
    process_migration_1(db)
  File "/app/migrations/utils.py", line 67, in process_migration_1
    for activity in activities:

Any idea what is going on?

Hello. Thanks for reaching out. I have a hunch on what might be. The validation that skips the migration if no activities exist may be failing.

If it is confirmed, today or tomorrow I will release a fix.

This should be fixed in v0.5.2. Can you please confirm?

Thank you.

Looks like it's fixed. Everything started up as expected. I can now test out a few things and get to know the application. Thanks for making this happen!

Thank you and sorry for the bug.