ynput / ayon-ftrack

Apache License 2.0
3 stars 9 forks source link

Sync from ftrack fails: ValueError: Failed to update project #6

Closed sjt-rvx closed 3 weeks ago

sjt-rvx commented 1 year ago

No way am I sure this belongs in this repo, but here goes:

I was giving the services a whirl, but when I ran 'Sync from ftrack' I got this error

ERROR:SyncFromFtrackAction:Action "AYON Admin - Sync from ftrack": Failed (Failed to update project)
Traceback (most recent call last):
  File "/cache/dev/ayon-ftrack/ftrack_common/event_handlers/ftrack_action_handler.py", line 252, in wrapper_func
    output = func(*args, **kwargs)
  File "/cache/dev/ayon-ftrack/ftrack_common/event_handlers/ftrack_action_handler.py", line 284, in _launch
    response = self.launch(self.session, entities, event)
  File "/cache/dev/ayon-ftrack/services/processor/processor/default_handlers/action_sync_from_ftrack.py", line 35, in launch
    syncer.sync_to_server()
  File "/cache/dev/ayon-ftrack/services/processor/processor/lib/sync_from_ftrack.py", line 249, in sync_to_server
    self._entity_hub.commit_changes()
  File "/cache/dev/ayon-ftrack/venv/lib64/python3.9/site-packages/ayon_api/entity_hub.py", line 708, in commit_changes
    raise ValueError("Failed to update project")
ValueError: Failed to update project

a bit of digging got me this response from the ayon server

{'code': 500, 'detail': 'Internal server error', 'traceback': 'update or delete on table "folder_types" violates foreign key constraint "folders_folder_type_fkey" on table "folders"\nDETAIL:  Key (name)=(Asset) is still referenced from table "folders".', 'path': '[PATCH] /projects/pet_project', 'file': 'asyncpg/protocol/protocol.pyx', 'function': 'bind_execute', 'line': 201}

I'm running 0.0.2 of ftrack-ayon (the develop branch)

iLLiCiTiT commented 1 year ago

Thanks for report. After discussion with server backend developer I know why it is happening. It is because there is existing folder with folder type I'm trying to remove. Will look into the issue as soon as possible.

BigRoy commented 9 months ago

It seems this issue is quite old - has this been solved since?

iLLiCiTiT commented 3 weeks ago

This issue seems be resolved already, please create new one if issue still persist.