[2024-10-13 18:34:20,153] ERROR in app: Exception on /tracks [GET]
Traceback (most recent call last):
  File "/home/philip/.local/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/philip/.local/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/philip/.local/lib/python3.11/site-packages/flask_restful/__init__.py", line 298, in error_router
    return original_handler(e)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/philip/.local/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/philip/.local/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/philip/bd0812f2-6d94-4fdd-83d6-0b09ca3b4549/Downloads/asq123/main2.py", line 346, in tracks
    all_albums = Album.query.order_by(Album.upload_date.desc()).limit(5).all()
                 ^^^^^^^^^^^
  File "/home/philip/.local/lib/python3.11/site-packages/flask_sqlalchemy/model.py", line 30, in __get__
    return cls.query_class(
           ^^^^^^^^^^^^^^^^
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 275, in __init__
    self._set_entities(entities)
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 287, in _set_entities
    self._raw_columns = [
                        ^
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 288, in <listcomp>
    coercions.expect(
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/sql/coercions.py", line 389, in expect
    insp._post_inspect
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 1253, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
                                           ^^^^^^^^^^^^^^
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/orm/mapper.py", line 2711, in _post_inspect
    self._check_configure()
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/orm/mapper.py", line 2388, in _check_configure
    _configure_registries({self.registry}, cascade=True)
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/orm/mapper.py", line 4203, in _configure_registries
    _do_configure_registries(registries, cascade)
  File "/home/philip/.local/lib/python3.11/site-packages/sqlalchemy/orm/mapper.py", line 4240, in _do_configure_registries
    raise e
sqlalchemy.exc.InvalidRequestError: One or more mappers failed to initialize - can't proceed with initialization of other mappers. Triggering mapper: 'Mapper[User(users)]'. Original exception was: Could not determine join condition between parent/child tables on relationship User.tracks - there are no foreign keys linking these tables.  Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify a 'primaryjoin' expression.
10.0.0.18 - - [13/Oct/2024 18:34:20] "GET /tracks HTTP/1.1" 500 -