Create Project via API: Connection time out

Hi when creating a project using the api, i keep getting connection time out, but the project does get created after few seconds. Any suggestions as to why this might be happening.

Could you share your example code snippet that fails?

  • Are you just creating a project? Or bulk generating folders, etc. too?

  • Can you share the relevant server logs? (e.g. event viewer of server and the docker server logs)?

  • Are you using the docker build, or a custom running solution?

sorry for the late reply, there is not much info, this is the error i get

Traceback (most recent call last):
File “E:\Pavith\dev\ayon_patch\create_update_project.py”, line 24, in
result = ayon_api.create_project(project_name=project_name, project_code=project_name.lower().strip())
File “C:\Python310\lib\site-packages\ayon_api_api.py”, line 5879, in create_project
return con.create_project(
File “C:\Python310\lib\site-packages\ayon_api\server_api.py”, line 7829, in create_project
raise ValueError(“Failed to create project "{}": {}”.format(
ValueError: Failed to create project “PIPE_TEST”: Connection timed out.

How do check the logs in the server ?

Hello, I’ve created this one for you

So by seeing the logs, it seems to have an unhandled exception

ayon-docker_server_1 | 2025-01-13T03:53:05.070415708Z 2025-01-13 09:23:05 ERROR anonymous [GET] /info: UNHANDLED EXCEPTION
ayon-docker_server_1 | 2025-01-13T03:53:05.070434872Z 2025-01-13 09:23:05 ERROR server
ayon-docker_server_1 | 2025-01-13T03:53:05.073302817Z [2025-01-13 09:23:05 +0530] [138149] [ERROR] Exception in ASGI application
ayon-docker_server_1 | 2025-01-13T03:53:05.073316499Z Traceback (most recent call last):
ayon-docker_server_1 | 2025-01-13T03:53:05.073322277Z File “/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py”, line 426, in run_asgi
ayon-docker_server_1 | 2025-01-13T03:53:05.073327858Z result = await app( # type: ignore[func-returns-value]
ayon-docker_server_1 | 2025-01-13T03:53:05.073333311Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073338764Z File “/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py”, line 84, in call
ayon-docker_server_1 | 2025-01-13T03:53:05.073346065Z return await self.app(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073351555Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073356948Z File “/usr/local/lib/python3.11/site-packages/fastapi/applications.py”, line 1054, in call
ayon-docker_server_1 | 2025-01-13T03:53:05.073362498Z await super().call(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073380456Z File “/usr/local/lib/python3.11/site-packages/starlette/applications.py”, line 123, in call
ayon-docker_server_1 | 2025-01-13T03:53:05.073384706Z await self.middleware_stack(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073388246Z File “/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py”, line 186, in call
ayon-docker_server_1 | 2025-01-13T03:53:05.073392018Z raise exc
ayon-docker_server_1 | 2025-01-13T03:53:05.073395580Z File “/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py”, line 164, in call
ayon-docker_server_1 | 2025-01-13T03:53:05.073399277Z await self.app(scope, receive, _send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073402782Z File “/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py”, line 65, in call
ayon-docker_server_1 | 2025-01-13T03:53:05.073406524Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073410062Z File “/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py”, line 64, in wrapped_app
ayon-docker_server_1 | 2025-01-13T03:53:05.073413688Z raise exc
ayon-docker_server_1 | 2025-01-13T03:53:05.073417187Z File “/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py”, line 53, in wrapped_app
ayon-docker_server_1 | 2025-01-13T03:53:05.073420795Z await app(scope, receive, sender)
ayon-docker_server_1 | 2025-01-13T03:53:05.073424342Z File “/usr/local/lib/python3.11/site-packages/starlette/routing.py”, line 756, in call
ayon-docker_server_1 | 2025-01-13T03:53:05.073428002Z await self.middleware_stack(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073431478Z File “/usr/local/lib/python3.11/site-packages/starlette/routing.py”, line 776, in app
ayon-docker_server_1 | 2025-01-13T03:53:05.073435154Z await route.handle(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073438719Z File “/usr/local/lib/python3.11/site-packages/starlette/routing.py”, line 297, in handle
ayon-docker_server_1 | 2025-01-13T03:53:05.073442322Z await self.app(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073446450Z File “/usr/local/lib/python3.11/site-packages/starlette/routing.py”, line 77, in app
ayon-docker_server_1 | 2025-01-13T03:53:05.073450132Z await wrap_app_handling_exceptions(app, request)(scope, receive, send)
ayon-docker_server_1 | 2025-01-13T03:53:05.073453663Z File “/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py”, line 64, in wrapped_app
ayon-docker_server_1 | 2025-01-13T03:53:05.073457375Z raise exc
ayon-docker_server_1 | 2025-01-13T03:53:05.073460772Z File “/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py”, line 53, in wrapped_app
ayon-docker_server_1 | 2025-01-13T03:53:05.073464498Z await app(scope, receive, sender)
ayon-docker_server_1 | 2025-01-13T03:53:05.073467926Z File “/usr/local/lib/python3.11/site-packages/starlette/routing.py”, line 72, in app
ayon-docker_server_1 | 2025-01-13T03:53:05.073471741Z response = await func(request)
ayon-docker_server_1 | 2025-01-13T03:53:05.073494258Z ^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073506806Z File “/usr/local/lib/python3.11/site-packages/fastapi/routing.py”, line 278, in app
ayon-docker_server_1 | 2025-01-13T03:53:05.073513282Z raw_response = await run_endpoint_function(
ayon-docker_server_1 | 2025-01-13T03:53:05.073521041Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073538347Z File “/usr/local/lib/python3.11/site-packages/fastapi/routing.py”, line 191, in run_endpoint_function
ayon-docker_server_1 | 2025-01-13T03:53:05.073542775Z return await dependant.call(**values)
ayon-docker_server_1 | 2025-01-13T03:53:05.073546221Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073549784Z File “/backend/api/system/info.py”, line 195, in get_site_info
ayon-docker_server_1 | 2025-01-13T03:53:05.073553487Z additional_info = await get_additional_info(current_user, request)
ayon-docker_server_1 | 2025-01-13T03:53:05.073557026Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073560563Z File “/backend/api/system/info.py”, line 145, in get_additional_info
ayon-docker_server_1 | 2025-01-13T03:53:05.073564280Z await Postgres.execute(
ayon-docker_server_1 | 2025-01-13T03:53:05.073567756Z File “/backend/ayon_server/lib/postgres.py”, line 116, in execute
ayon-docker_server_1 | 2025-01-13T03:53:05.073571474Z return await connection.execute(query, *args, timeout=timeout)
ayon-docker_server_1 | 2025-01-13T03:53:05.073574996Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073578515Z File “/usr/local/lib/python3.11/site-packages/asyncpg/connection.py”, line 353, in execute
ayon-docker_server_1 | 2025-01-13T03:53:05.073582230Z _, status, _ = await self._execute(
ayon-docker_server_1 | 2025-01-13T03:53:05.073585720Z ^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073589194Z File “/usr/local/lib/python3.11/site-packages/asyncpg/connection.py”, line 1794, in _execute
ayon-docker_server_1 | 2025-01-13T03:53:05.073592841Z result, _ = await self.__execute(
ayon-docker_server_1 | 2025-01-13T03:53:05.073596304Z ^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073599794Z File “/usr/local/lib/python3.11/site-packages/asyncpg/connection.py”, line 1892, in __execute
ayon-docker_server_1 | 2025-01-13T03:53:05.073603420Z result, stmt = await self._do_execute(
ayon-docker_server_1 | 2025-01-13T03:53:05.073606883Z ^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073610356Z File “/usr/local/lib/python3.11/site-packages/asyncpg/connection.py”, line 1933, in _do_execute
ayon-docker_server_1 | 2025-01-13T03:53:05.073614000Z stmt = await self._get_statement(
ayon-docker_server_1 | 2025-01-13T03:53:05.073618250Z ^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073621926Z File “/usr/local/lib/python3.11/site-packages/asyncpg/connection.py”, line 433, in _get_statement
ayon-docker_server_1 | 2025-01-13T03:53:05.073625956Z statement = await self._protocol.prepare(
ayon-docker_server_1 | 2025-01-13T03:53:05.073629536Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ayon-docker_server_1 | 2025-01-13T03:53:05.073633011Z File “asyncpg/protocol/protocol.pyx”, line 166, in prepare
ayon-docker_server_1 | 2025-01-13T03:53:05.073636680Z TimeoutError