Ayon Docker Server: error starting the server

I have an issue, I cannot properly start the ayon server, these are the steps I followed:

  1. Clone ayon-docker repository on my local machine
  2. Run the stack using docker compose up -d

For info, I did not perform anything else, like tweaking the docker-compose.yml or modified the default settings settings/template.json

After performing the docker compose If I check the logs of the ayon-docker-server-1, I see:

start.sh: Starting server
2023-10-11 12:46:26 INFO       Log collector initialized
Exception in thread Thread-1 (execute):
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
  File "/usr/local/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/backend/ayon_server/entities/core/attrib.py", line 37, in execute
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "/backend/ayon_server/entities/core/attrib.py", line 47, in load
    async for row in Postgres.iterate(query):
  File "/backend/ayon_server/lib/postgres.py", line 102, in iterate
    statement = await connection.prepare(query)
  File "/usr/local/lib/python3.11/site-packages/asyncpg/connection.py", line 565, in prepare
    return await self._prepare(
  File "/usr/local/lib/python3.11/site-packages/asyncpg/connection.py", line 583, in _prepare
    stmt = await self._get_statement(
  File "/usr/local/lib/python3.11/site-packages/asyncpg/connection.py", line 397, in _get_statement
    statement = await self._protocol.prepare(
  File "asyncpg/protocol/protocol.pyx", line 168, in prepare
asyncpg.exceptions.UndefinedTableError: relation "public.attributes" does not exist
[2023-10-11 12:46:27 +0200] [14] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
  File "/usr/local/lib/python3.11/site-packages/uvicorn/workers.py", line 66, in init_process
    super(UvicornWorker, self).init_process()
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/backend/ayon_server/api/server.py", line 26, in <module>
    from ayon_server.graphql import router as graphql_router
  File "/backend/ayon_server/graphql/__init__.py", line 27, in <module>
    from ayon_server.graphql.nodes.folder import folder_from_record
  File "/backend/ayon_server/graphql/nodes/folder.py", line 9, in <module>
    from ayon_server.graphql.resolvers.products import get_products
  File "/backend/ayon_server/graphql/resolvers/products.py", line 8, in <module>
    from ayon_server.graphql.nodes.product import ProductNode
  File "/backend/ayon_server/graphql/nodes/product.py", line 9, in <module>
    from ayon_server.graphql.resolvers.versions import get_versions
  File "/backend/ayon_server/graphql/resolvers/versions.py", line 7, in <module>
    from ayon_server.graphql.nodes.version import VersionNode
  File "/backend/ayon_server/graphql/nodes/version.py", line 9, in <module>
    from ayon_server.graphql.resolvers.representations import get_representations
  File "/backend/ayon_server/graphql/resolvers/representations.py", line 7, in <module>
    from ayon_server.graphql.nodes.representation import RepresentationNode
  File "/backend/ayon_server/graphql/nodes/representation.py", line 49, in <module>
  File "/usr/local/lib/python3.11/site-packages/strawberry/experimental/pydantic/object_type.py", line 168, in wrap
    raise MissingFieldsListError(cls)
strawberry.experimental.pydantic.exceptions.MissingFieldsListError: List of fields to copy from <class 'ayon_server.graphql.nodes.representation.RepresentationAttribType'> is empty. Add fields with the `auto` type annotation

This seems to be an issue with the PostgreSQL database, someone have an idea?

Don’t know if it’s an issue on my side, a missed step or a bug.

Hey man,
I’ve checked this out and you should pull the latest ayon image with dev tag

For sake of clarity - could you share the commands needed to do so? :slight_smile:

I’m not an expert in Docker, so take my suggestion with a pinch of salt.

If you are using ayon-docker repo

dev tag is already set in compose file. so we’d only need to docker compose pull

sudo docker compose pull
sudo docker compose up -d

If you are pulling docker image from docker hub, I believe you’d need to specify dev tag
similar to this:

sudo docker pull ynput/ayon:dev
1 Like