unstract
unstract copied to clipboard
fix: [ISSUE] Programming error at /api/v1/login
Describe the bug
I followed the steps to deploy it in my environment but faced an issue when trying to open the ui
To reproduce
Same steps as in docs - [docker-compose]
Screenshots
@TharunSivamani this indicates failure of running migration. Could you get the initial logs of unstract-backend container. That should contain logs related to the migration and should throw some light in to the issue
Logs of the following services:
UNSTRACT-BACKEND
WARNING : [2025-09-22 05:10:42,307]{module:authentication_plugin_registry process:78 thread:140055942773632 request_id:- trace_id:- span_id:-} :- Metadata is not active for auth_sample authentication module.
WARNING : [2025-09-22 05:10:42,307]{module:authentication_plugin_registry process:78 thread:140055942773632 request_id:- trace_id:- span_id:-} :- No authentication modules found.Application will start without authentication module
INFO : [2025-09-22 05:10:42,326]{module:wsgi process:78 thread:140055942773632 request_id:- trace_id:- span_id:-} :- WSGI application initialized in 16.326 seconds
INFO : [2025-09-22 05:10:42,427]{module:base process:79 thread:140055942773632 request_id:- trace_id:- span_id:-} :- DB connection (ID: 140052506768576) is established or reused.
WARNING : [2025-09-22 05:10:42,428]{module:execution_log_utils process:79 thread:140055942773632 request_id:- trace_id:- span_id:-} :- ProgrammingError occurred while creating log consumer scheduler. If you are currently running migrations for new environment, you can ignore this warning
WARNING : [2025-09-22 05:10:42,428]{module:execution_log_utils process:79 thread:140055942773632 request_id:- trace_id:- span_id:-} :- ProgrammingError details: relation "django_celery_beat_intervalschedule" does not exist
LINE 1: ...jango_celery_beat_intervalschedule"."period" FROM "django_ce...
^
WARNING : [2025-09-22 05:10:42,441]{module:authentication_plugin_registry process:79 thread:140055942773632 request_id:- trace_id:- span_id:-} :- Metadata is not active for auth_sample authentication module.
WARNING : [2025-09-22 05:10:42,441]{module:authentication_plugin_registry process:79 thread:140055942773632 request_id:- trace_id:- span_id:-} :- No authentication modules found.Application will start without authentication module
INFO : [2025-09-22 05:10:42,459]{module:wsgi process:79 thread:140055942773632 request_id:- trace_id:- span_id:-} :- WSGI application initialized in 16.353 seconds
unstract-x2text-service
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker
worker.init_process()
File "/app/.venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 135, in init_process
self.load_wsgi()
File "/app/.venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi
self.wsgi = self.app.wsgi()
^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 66, in wsgi
self.callable = self.load()
^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
return self.load_wsgiapp()
^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
return util.import_app(self.app_uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/gunicorn/util.py", line 370, in import_app
mod = importlib.import_module(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/app/run.py", line 3, in <module>
app = create_app()
^^^^^^^^^^^^
File "/app/app/config.py", line 20, in create_app
X2TextAudit.create_table()
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 7083, in create_table
cls._schema.create_all(safe, **options)
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 6176, in create_all
self.create_table(safe, **table_options)
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 6032, in create_table
self.database.execute(self._create_table(safe=safe, **options))
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 3330, in execute
return self.execute_sql(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 3320, in execute_sql
with __exception_wrapper__:
^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 3088, in __exit__
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 196, in reraise
raise value.with_traceback(tb)
File "/app/.venv/lib/python3.12/site-packages/peewee.py", line 3322, in execute_sql
cursor.execute(sql, params or ())
peewee.ProgrammingError: schema "unstract" does not exist
LINE 1: CREATE TABLE IF NOT EXISTS "unstract"."x2text_audit" ("id" U...
^
[2025-09-22 05:17:03 +0000] [6] [INFO] Worker exiting (pid: 6)
[2025-09-22 05:17:03 +0000] [1] [ERROR] Worker (pid:6) exited with code 3
[2025-09-22 05:17:03 +0000] [1] [ERROR] Shutting down: Master
[2025-09-22 05:17:03 +0000] [1] [ERROR] Reason: Worker failed to boot.
unstract-celery-beat
WARNING : [2025-09-22 05:17:41,050]{module:log process:1 thread:139628914465664 request_id:- trace_id:- span_id:-} :- :
WARNING : [2025-09-22 05:17:41,050]{module:log process:1 thread:139628914465664 request_id:- trace_id:- span_id:-} :- relation "django_celery_beat_periodictask" does not exist
LINE 1: ...ango_celery_beat_periodictask"."description" FROM "django_ce...
^
celery beat v5.4.0 (opalescent) is starting.
/app/.venv/lib/python3.12/site-packages/drf_yasg/__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import DistributionNotFound, get_distribution
WARNING : [2025-09-22 05:17:50,388]{module:register process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- No connector found.
WARNING : [2025-09-22 05:17:52,241]{module:register process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- Unable to import embedding adapters : No module named 'llama_index.embeddings.fastembed'
WARNING : [2025-09-22 05:17:59,346]{module:register process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- Unable to import embedding adapters : No module named 'llama_index.embeddings.huggingface'
WARNING : [2025-09-22 05:18:01,695]{module:register process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- Unable to import vectorDB adapters : No module named 'llama_index.vector_stores.supabase'
INFO : [2025-09-22 05:18:02,450]{module:base process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- DB connection (ID: 140377518667264) is established or reused.
WARNING : [2025-09-22 05:18:02,452]{module:execution_log_utils process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- ProgrammingError occurred while creating log consumer scheduler. If you are currently running migrations for new environment, you can ignore this warning
WARNING : [2025-09-22 05:18:02,452]{module:execution_log_utils process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- ProgrammingError details: relation "django_celery_beat_intervalschedule" does not exist
LINE 1: ...jango_celery_beat_intervalschedule"."period" FROM "django_ce...
^
WARNING : [2025-09-22 05:18:02,474]{module:authentication_plugin_registry process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- Metadata is not active for auth_sample authentication module.
WARNING : [2025-09-22 05:18:02,474]{module:authentication_plugin_registry process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- No authentication modules found.Application will start without authentication module
INFO : [2025-09-22 05:18:02,563]{module:processor_loader process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- No processor plugins found.
INFO : [2025-09-22 05:18:02,698]{module:processor_loader process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- No processor plugins found.
__ - ... __ - _
LocalTime -> 2025-09-22 05:18:02
Configuration ->
. broker -> amqp://admin:**@unstract-rabbitmq:5672//
. loader -> celery.loaders.app.AppLoader
. scheduler -> django_celery_beat.schedulers.DatabaseScheduler
. logfile -> [stderr]@%INFO
. maxinterval -> 5.00 seconds (5s)
INFO : [2025-09-22 05:18:02,781]{module:beat process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- beat: Starting...
INFO : [2025-09-22 05:18:02,799]{module:base process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- DB connection (ID: 140374277062016) is established or reused.
CRITICAL : [2025-09-22 05:18:02,800]{module:beat process:1 thread:140377730669440 request_id:- trace_id:- span_id:-} :- beat raised exception <class 'django.db.utils.ProgrammingError'>: ProgrammingError('relation "django_celery_beat_periodictask" does not exist\nLINE 1: ...ango_celery_beat_periodictask"."description" FROM "django_ce...\n ^\n')
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedTable: relation "django_celery_beat_periodictask" does not exist
LINE 1: ...ango_celery_beat_periodictask"."description" FROM "django_ce...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/celery/apps/beat.py", line 113, in start_scheduler
service.start()
File "/app/.venv/lib/python3.12/site-packages/celery/beat.py", line 634, in start
humanize_seconds(self.scheduler.max_interval))
^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/kombu/utils/objects.py", line 40, in __get__
return super().__get__(instance, owner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/functools.py", line 998, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/celery/beat.py", line 677, in scheduler
return self.get_scheduler()
^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/celery/beat.py", line 668, in get_scheduler
return symbol_by_name(self.scheduler_cls, aliases=aliases)(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django_celery_beat/schedulers.py", line 233, in __init__
Scheduler.__init__(self, *args, **kwargs)
File "/app/.venv/lib/python3.12/site-packages/celery/beat.py", line 264, in __init__
self.setup_schedule()
File "/app/.venv/lib/python3.12/site-packages/django_celery_beat/schedulers.py", line 241, in setup_schedule
self.install_default_entries(self.schedule)
^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django_celery_beat/schedulers.py", line 363, in schedule
self._schedule = self.all_as_schedule()
^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django_celery_beat/schedulers.py", line 247, in all_as_schedule
for model in self.Model.objects.enabled():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 398, in __iter__
self._fetch_all()
File "/app/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1881, in _fetch_all
self._result_cache = list(self._iterable_class(self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 91, in __iter__
results = compiler.execute_sql(
^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1560, in execute_sql
cursor.execute(sql, params)
File "/app/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/app/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.ProgrammingError: relation "django_celery_beat_periodictask" does not exist
LINE 1: ...ango_celery_beat_periodictask"."description" FROM "django_ce...
^