Shotgrid Integration addon

I will try update my OpenPype fork to ayon-core on the following weeks so I will try create PRs for the differences that I encounter to get this to work

EDIT:
Here it is the first PR to get this to work Fix AYON shotgrid username passed to Deadline by fabiaserra · Pull Request #379 · ynput/ayon-core · GitHub

I’m back. For some reason I get a CRUD error when deadline attempts to publish anything to SG. The full error is below. I have double checked both the Ayon and SG ID’s for the task (as I had assumed that was the error) but they match on both ends. Where should I be looking to solve this. Fyi these are tasks that were created in SG then synced to Ayon if that makes a difference and I havent manually changed anything, these are just as they come.

Error
DEBUG:pyblish.CollectResourcesPath:publishDir: "Y:\TestAyon\BJ0003_Ayon_SGCreated_Test\SGC\0010\publish\render\renderLayoutMantra_ropMain_beauty\v001"
DEBUG:pyblish.CollectResourcesPath:resourcesDir: "Y:\TestAyon\BJ0003_Ayon_SGCreated_Test\SGC\0010\publish\render\renderLayoutMantra_ropMain_beauty\v001\resources"
DEBUG:pyblish.CollectSourceForSource:Parsing paths for {root[work]}/BJ0003_Ayon_SGCreated_Test/SGC/0010/work/Layout/BJ0003_0010_Layout_v003.hip
DEBUG:pyblish.CollectCustomStagingDir:Not adding custom staging dir for instance with 'render'
INFO:pyblish.CollectShotgridEntities:Collected corresponding shotgrid project: {'type': 'Project', 'id': 519}
ERROR:pyblish.plugin:Traceback (most recent call last):
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\addons\shotgrid_0.3.2\ayon_shotgrid\plugins\publish\collect_shotgrid_entities.py", line 43, in process
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\addons\shotgrid_0.3.2\ayon_shotgrid\plugins\publish\collect_shotgrid_entities.py", line 117, in _get_sg_entities_by_id
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\addons\shotgrid_0.3.2\ayon_shotgrid\plugins\publish\collect_shotgrid_entities.py", line 165, in _get_sg_tasks_by_id
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\shotgun_api3\shotgun.py", line 1057, in find
    result = self._call_rpc("read", params)
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\shotgun_api3\shotgun.py", line 3423, in _call_rpc
    self._response_errors(response)
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\shotgun_api3\shotgun.py", line 3740, in _response_errors
    raise Fault(sg_response.get("message", "Unknown Error"))
shotgun_api3.shotgun.Fault: API read() CRUD ERROR #10: Read failed for entity type [Task]
Traceback (most recent call last):
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "<string>", line 43, in process
  File "<string>", line 117, in _get_sg_entities_by_id
  File "<string>", line 165, in _get_sg_tasks_by_id
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\shotgun_api3\shotgun.py", line 1057, in find
    result = self._call_rpc("read", params)
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\shotgun_api3\shotgun.py", line 3423, in _call_rpc
    self._response_errors(response)
  File "C:\Users\deadline\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\shotgun_api3\shotgun.py", line 3740, in _response_errors
    raise Fault(sg_response.get("message", "Unknown Error"))
shotgun_api3.shotgun.Fault: API read() CRUD ERROR #10: Read failed for entity type [Task]
!!! ERR: 2024-04-16 09:51:38,815 >>> { CLI-publish }: [ Failed CollectShotgridEntities: API read() CRUD ERROR #10: Read failed for entity type [Task] -- ('C:\\Users\\deadline\\AppData\\Local\\Ynput\\AYON\\addons\\shotgrid_0.3.2\\ayon_shotgrid\\plugins\\publish\\collect_shotgrid_entities.py', 3740, '_response_errors', 'raise Fault(sg_response.get("message", "Unknown Error"))') ]

Hi there, Also running into this same issue when Deadline Attempts to publish to SG. Likewise AYON and Shotgrids ID task do match, and we are Syncing our SG to Ayon too. Seems like the error is replicable, unsure on what could be causing it however.

Glad to see others are affected to as it means I haven’t done anything too dumb hopefully. I haven’t tried it yet but I would like to try on a task that is created in Ayon first though I was weary of how well SG would handle that. Might need to consult @fabiaserra or @Minkiu as I am not aware of best practices when it comes to this sort of stuff.

I haven’t had a chance to test the addon fully from end to end yet as we are still running OpenPype in production and I think I will hold a while until we move to AYON given is not really stable yet. However, to debug this error you guys are running into I’d probably attach a debugger or add a few prints on this function ayon-shotgrid/client/ayon_shotgrid/plugins/publish/collect_shotgrid_entities.py at 2bdc5bb3a187c8fc4ac85f91d87ee387bff26430 · ynput/ayon-shotgrid · GitHub . At the end, the error is boiling down to this call, which is using the ShotGrid API:

        sg_tasks = sg_session.find(
            "Task",
            filters=filters,
            fields=["content", "entity"],
            filter_operator="any"
        )

so as long as you find what’s the content of filters, you should be able to replicate it on a console to try figure out what’s wrong with the filters or that call, perhaps it’s a corrupted task in your SG?

2 Likes

Cheers, thanks for reaching back. Agreed, I believe that there is a filter, incorrect task or something not syncing. Will give it a couple more tests in a few weeks when im back in an office.

1 Like

Ok I finally came across this same bug… I had raised this issue already in the OpenPype AYON branch a few months ago and I created a PR but I guess it fell into the void when Ynput migrated into ayon-core. Here it is again: Add `task` to skeleton instance passed to Deadline by fabiaserra · Pull Request #457 · ynput/ayon-core · GitHub

3 Likes

Hi here, some fixes had been included in new release for user publishing Release 0.4.1 · ynput/ayon-shotgrid · GitHub

Hey, testing out 0.4.1 - I can’t get the module to initialize :frowning:
0.4.0 and lower works just fine, but no luck with 0.4.1 and the current 0.4.2-dev

The console shows whether the module is loaded or not (0.4.1, the line where ‘ShotgridAddon’ should be is blank), but where can I check for errors?

Same issue over here… Somehow the addon seems not to be loaded for the launcher and no publishes to Flow are happening. While the leecher, processor and transmitter are running fine…
Btw. could somebody explain a bit more about the client login types? How exactly are the Environment variables working? And is the client login used for uploading the Versions to SG? Is it in that case based on the Login of the machine doing the publish or on the login from the artist machine that submitted the publish?

Thank you in advance