sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "subscriber" does not exist
Working around the issue in #87 (closed) shows yet another problem:
tor_weather_db | 2024-01-08 12:03:47.072 UTC [69] ERROR: relation "subscriber" does not exist at character 309
tor_weather_db | 2024-01-08 12:03:47.072 UTC [69] STATEMENT: SELECT count(*) AS count_1
tor_weather_db | FROM (SELECT subscriber.id AS subscriber_id, subscriber.email AS subscriber_email, subscriber.password AS subscriber_password, subscriber.is_confirmed AS subscriber_is_confirmed, subscriber.created_on AS subscriber_created_on, subscriber.updated_on AS subscriber_updated_on
tor_weather_db | FROM subscriber) AS anon_1
tor_weather_seeder | Traceback (most recent call last):
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
tor_weather_seeder | self.dialect.do_execute(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
tor_weather_seeder | cursor.execute(statement, parameters)
tor_weather_seeder | psycopg2.errors.UndefinedTable: relation "subscriber" does not exist
tor_weather_seeder | LINE 3: FROM subscriber) AS anon_1
tor_weather_seeder | ^
tor_weather_seeder |
tor_weather_seeder |
tor_weather_seeder | The above exception was the direct cause of the following exception:
tor_weather_seeder |
tor_weather_seeder | Traceback (most recent call last):
tor_weather_seeder | File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
tor_weather_seeder | return _run_code(code, main_globals, None,
tor_weather_seeder | File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
tor_weather_seeder | exec(code, run_globals)
tor_weather_seeder | File "/app/scripts/seed.py", line 69, in <module>
tor_weather_seeder | if not db_session.query(Subscriber).count():
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 3132, in count
tor_weather_seeder | self._legacy_from_self(col).enable_eagerloads(False).scalar()
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2825, in scalar
tor_weather_seeder | ret = self.one()
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2798, in one
tor_weather_seeder | return self._iter().one() # type: ignore
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2847, in _iter
tor_weather_seeder | result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2308, in execute
tor_weather_seeder | return self._execute_internal(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2190, in _execute_internal
tor_weather_seeder | result: Result[Any] = compile_state_cls.orm_execute_statement(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/context.py", line 293, in orm_execute_statement
tor_weather_seeder | result = conn.execute(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
tor_weather_seeder | return meth(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection
tor_weather_seeder | return connection._execute_clauseelement(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1639, in _execute_clauseelement
tor_weather_seeder | ret = self._execute_context(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1848, in _execute_context
tor_weather_seeder | return self._exec_single_context(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1988, in _exec_single_context
tor_weather_seeder | self._handle_dbapi_exception(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2343, in _handle_dbapi_exception
tor_weather_seeder | raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
tor_weather_seeder | self.dialect.do_execute(
tor_weather_seeder | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
tor_weather_seeder | cursor.execute(statement, parameters)
tor_weather_seeder | sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "subscriber" does not exist
tor_weather_seeder | LINE 3: FROM subscriber) AS anon_1
tor_weather_seeder | ^
tor_weather_seeder |
tor_weather_seeder | [SQL: SELECT count(*) AS count_1
tor_weather_seeder | FROM (SELECT subscriber.id AS subscriber_id, subscriber.email AS subscriber_email, subscriber.password AS subscriber_password, subscriber.is_confirmed AS subscriber_is_confirmed, subscriber.created_on AS subscriber_created_on, subscriber.updated_on AS subscriber_updated_on
tor_weather_seeder | FROM subscriber) AS anon_1]
tor_weather_seeder | (Background on this error at: https://sqlalche.me/e/20/f405)
tor_weather_app_server | INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
tor_weather_app_server | INFO [alembic.runtime.migration] Will assume transactional DDL.
tor_weather_app_server | INFO [alembic.runtime.migration] Running upgrade -> 15bc4ace8bbd, Initial migration
tor_weather_seeder exited with code 1