Skip to content

Conversation

@iLLiCiTiT
Copy link
Member

Changelog Description

Updated services to require at least 1.2.7.

Additional review information

One important addition to new ayon api is this PR ynput/ayon-python-api#293 .

Testing notes:

  1. Services do work.

@iLLiCiTiT iLLiCiTiT added the type: enhancement Improvement of existing functionality or minor addition label Dec 19, 2025
@iLLiCiTiT iLLiCiTiT self-assigned this Dec 19, 2025
@iLLiCiTiT iLLiCiTiT requested a review from kalisp December 19, 2025 15:29
@MilaKudr
Copy link

When I tried to run services from the Ayon UI, these errors occurred and the service did not start.
Screenshot 2025-12-22 093035

2025-12-22 08:23:55 INFO       ash             Starting Ash v0.4.0
2025-12-22 08:23:55 DEBUG      ash             Configured worker worker to connect to http://server:5000⁠
2025-12-22 08:23:56 INFO       ash             Logged in as service_worker
2025-12-22 08:23:56 INFO       ash             Starting shotgridleecher shotgrid:0.6.13+dev/ShotgridLeecher (image: ynput/ayon-shotgrid-leecher:0.6.13+dev)

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 275, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.52/containers/create?name=aysvc_shotgridleecher
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/ash/ash/__main__.py", line 55, in <module>
    main()
  File "/ash/ash/__main__.py", line 41, in main
   Services.ensure_running(
  File "/ash/ash/services.py", line 144, in ensure_running
    container = cls.spawn(
                ^^^^^^^^^^
  File "/ash/ash/services.py", line 60, in spawn
    container = cls.client.containers.run(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/models/containers.py", line 876, in run
    container = self.create(image=image, command=command,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/models/containers.py", line 935, in create
    resp = self.client.api.create_container(**create_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/api/container.py", line 440, in create_container
    return self.create_container_from_config(config, name, platform)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/api/container.py", line 457, in create_container_from_config
    return self._result(res, True)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 281, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 277, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.52/containers/create?name=aysvc_shotgridleecher: Bad Request ("invalid reference format")

Services run much better when I use the service tools. However, during the Flow to Ayon manual sync, there are errors related to playlists, although the playlist functionality works.

2025-12-22 09:36:42.661 | listener | start_listening | DEBUG: Leecher waiting 10 seconds...
2025-12-22 09:36:47.532 | __init__ | create_project | INFO: Project Mila_test_SG_1 (mtsg1) available in SG and AYON.
2025-12-22 09:36:48.851 | processor | start_processing | ERROR: Unable to process handler sync_projects
Traceback (most recent call last):
  File "C:\Code\ayon-shotgrid\services\processor\processor\processor.py", line 281, in start_processing
    handler.process_event(
  File "C:\Code\ayon-shotgrid\services\processor\processor\handlers\sync_projects.py", line 34, in process_event
    hub.synchronize_projects(source=sync_source)
  File "C:\Code\ayon-shotgrid\services\shotgrid_common\ayon_shotgrid_hub\__init__.py", line 281, in synchronize_projects
    create_sg_entities_in_ay(
  File "C:\Code\ayon-shotgrid\services\shotgrid_common\utils.py", line 417, in create_sg_entities_in_ay
    for status_code, status_name in get_sg_statuses(sg_session, sg_entity_type).items():
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Code\ayon-shotgrid\services\shotgrid_common\utils.py", line 1214, in get_sg_statuses
    entity_status = sg_session.schema_field_read(sg_entity_type, status_field)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Code\ayon-shotgrid\service_tools\.venv\Lib\site-packages\shotgun_api3\shotgun.py", line 2056, in schema_field_read
    return self._call_rpc("schema_field_read", params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Code\ayon-shotgrid\service_tools\.venv\Lib\site-packages\shotgun_api3\shotgun.py", line 3460, in _call_rpc
    self._response_errors(response)
  File "C:\Code\ayon-shotgrid\service_tools\.venv\Lib\site-packages\shotgun_api3\shotgun.py", line 3777, in _response_errors
    raise Fault(sg_response.get("message", "Unknown Error"))
shotgun_api3.shotgun.Fault: API schema_field_read() Playlist.sg_status_list doesn't exist:
{"type" => "Playlist", "field_name" => "sg_status_list"}
2025-12-22 09:36:49.093 | processor | start_processing | INFO: Running the Handler <module 'sync_projects'>
2025-12-22 09:36:49.163 | processor | start_processing | DEBUG: processing event {'action': 'sync-from-shotgrid',
 'project_code': 'mtsg1',
 'project_code_field': 'code',
 'project_name': 'Mila_test_SG_1'}
2025-12-22 09:36:52.980 | listener | start_listening | DEBUG: Last Event ID: 573339

@MilaKudr MilaKudr self-requested a review December 22, 2025 08:39
@kalisp
Copy link
Member

kalisp commented Dec 22, 2025

Errors are not connected to this PR, are being handled in different PR.

@iLLiCiTiT iLLiCiTiT merged commit e848078 into develop Dec 22, 2025
6 checks passed
@kalisp kalisp deleted the enhancement/update-ayon-api-in-services branch December 22, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants