Can't authenticate deadline_integration script for Shotgun

I am trying to connect deadline 10.1.20.3 to shotgun and followed the instructions to set up a deadline integration script in Shotgun and added the API Key to deadline in the Shotgun event configuration, but I get an error during render that it can’t authenticate the deadline integration script. The test integration script works. And the create shotgun version script works. but not the deadline_integration. I assume it hasn’t ‘blessed’ the script? I am NOT using secrets management. I do have a PAT. What am I missing?

is this a fresh node? I found deleting the Thinkbox folder from user prefs cleared an error for me and allowed authentication

Not sure where on a Mac that might be? Perhaps ~/Library/Application Support/Thinkbox?

Is this the same question I answered on the Shotgun forum? It might have to do with the user name being a byte string, which needs to be decoded.
In general you should post the stack trace for such issues.

Yes, I think so. Some Python 2->3 issue. Hope the devs work it out. Here is my stack trace.

=======================================================

Error

Event Error (OnJobSubmitted): AuthenticationFault : Can’t authenticate script ‘b’deadline_integration2’’

=======================================================

Type

PythonException

=======================================================

Stack Trace

File “none”, line 210, in OnJobSubmitted
File “none”, line 140, in CreateShotgunVersion
File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/cache/AE8TNb1jzgr5p2YgSauzYq5SxM/events/Shotgun/ShotgunUtils.py”, line 333, in AddNewVersion
user = sg.find_one(“HumanUser”,filters=[[“login”,“is”,userName]],fields=[‘login’,‘name’])
File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 882, in find_one
additional_filter_presets=additional_filter_presets)
File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 1025, in find
records = self._call_rpc(“read”, params).get(“entities”, )
File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 3314, in _call_rpc
self._response_errors(response)
File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 3601, in _response_errors
raise AuthenticationFault(sg_response.get(“message”, “Unknown Authentication Error”))
at Python.Runtime.Dispatcher.Dispatch(ArrayList args)
at __FranticX_GenericDelegate1`1[[Deadline_Jobs_Job, deadline, Version=10_1_20_3, Culture=neutral, PublicKeyToken=5db103c5a9cd1f1e]]Dispatcher.Invoke(Job )
at Deadline.Events.DeadlineEventListener.OnJobSubmitted(Job job)
at Deadline.Events.DeadlineEventPlugin.OnJobSubmitted(Job job)

=======================================================

Log

2022-03-03 12:02:06: ‘/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/TpInYK90tHRGHkkk07Og==’ already exists. Skipping extraction of PythonSync.
2022-03-03 12:02:06: INFO: Importing Shotgun API from ‘/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==’…
2022-03-03 12:02:06: INFO: Output path: /Volumes/R4i/Shotgun/projects/the_ferry/assets/Prop/coin1/MDL/work/maya/images/coin1_MDL.v003_v001_t01/coin1_MDL.v003__perspShape_beauty.####.exr
2022-03-03 12:02:06: An error occurred in the “OnJobSubmitted” function in events plugin ‘Shotgun’: AuthenticationFault : Can’t authenticate script ‘b’deadline_integration2’’ (Python.Runtime.PythonException)
2022-03-03 12:02:06: File “none”, line 210, in OnJobSubmitted
2022-03-03 12:02:06: File “none”, line 140, in CreateShotgunVersion
2022-03-03 12:02:06: File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/cache/AE8TNb1jzgr5p2YgSauzYq5SxM/events/Shotgun/ShotgunUtils.py”, line 333, in AddNewVersion
2022-03-03 12:02:06: user = sg.find_one(“HumanUser”,filters=[[“login”,“is”,userName]],fields=[‘login’,‘name’])
2022-03-03 12:02:06: File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 882, in find_one
2022-03-03 12:02:06: additional_filter_presets=additional_filter_presets)
2022-03-03 12:02:06: File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 1025, in find
2022-03-03 12:02:06: records = self._call_rpc(“read”, params).get(“entities”, )
2022-03-03 12:02:06: File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 3314, in _call_rpc
2022-03-03 12:02:06: self._response_errors(response)
2022-03-03 12:02:06: File “/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py”, line 3601, in _response_errors
2022-03-03 12:02:06: raise AuthenticationFault(sg_response.get(“message”, “Unknown Authentication Error”))
2022-03-03 12:02:06: at Python.Runtime.Dispatcher.Dispatch(ArrayList args)
2022-03-03 12:02:06: at __FranticX_GenericDelegate11\[\[Deadline_Jobs_Job\, deadline\, Version=10_1_20_3\, Culture=neutral\, PublicKeyToken=5db103c5a9cd1f1e\]\]Dispatcher.Invoke(Job ) 2022-03-03 12:02:06: at Deadline.Events.DeadlineEventListener.OnJobSubmitted(Job job) 2022-03-03 12:02:06: at Deadline.Events.DeadlineEventPlugin.OnJobSubmitted(Job job) (Deadline.Events.DeadlineEventPluginException) 2022-03-03 12:02:06: at Deadline.Events.DeadlineEventPlugin.b(String cbr, Exception cbs) 2022-03-03 12:02:06: at Deadline.Events.DeadlineEventPlugin.OnJobSubmitted(Job job) 2022-03-03 12:02:06: at Deadline.Events.DeadlineEventManager.OnJobSubmitted(Job job, DataController dataController) 2022-03-03 12:02:06: ---------- Inner Stack Trace (Python.Runtime.PythonException) ---------- 2022-03-03 12:02:06: File "none", line 210, in OnJobSubmitted 2022-03-03 12:02:06: File "none", line 140, in CreateShotgunVersion 2022-03-03 12:02:06: File "/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/cache/AE8TNb1jzgr5p2YgSauzYq5SxM/events/Shotgun/ShotgunUtils.py", line 333, in AddNewVersion 2022-03-03 12:02:06: user = sg.find_one("HumanUser",filters=[["login","is",userName]],fields=['login','name']) 2022-03-03 12:02:06: File "/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py", line 882, in find_one 2022-03-03 12:02:06: additional_filter_presets=additional_filter_presets) 2022-03-03 12:02:06: File "/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py", line 1025, in find 2022-03-03 12:02:06: records = self._call_rpc("read", params).get("entities", []) 2022-03-03 12:02:06: File "/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py", line 3314, in _call_rpc 2022-03-03 12:02:06: self._response_errors(response) 2022-03-03 12:02:06: File "/Users/mgoetsch/Library/Application Support/Thinkbox/Deadline10/pythonAPIs/GuKglf2daWWQuMxjuFjQKw==/shotgun_api3/shotgun.py", line 3601, in _response_errors 2022-03-03 12:02:06: raise AuthenticationFault(sg_response.get("message", "Unknown Authentication Error")) 2022-03-03 12:02:06: at Python.Runtime.Dispatcher.Dispatch(ArrayList args) 2022-03-03 12:02:06: at __FranticX_GenericDelegate11[[Deadline_Jobs_Job, deadline, Version=10_1_20_3, Culture=neutral, PublicKeyToken=5db103c5a9cd1f1e]]Dispatcher.Invoke(Job )
2022-03-03 12:02:06: at Deadline.Events.DeadlineEventListener.OnJobSubmitted(Job job)
2022-03-03 12:02:06: at Deadline.Events.DeadlineEventPlugin.OnJobSubmitted(Job job)

=======================================================

Details

Date: 03/03/2022 12:02:06
Event Type: OnJobSubmitted
Job Submit Date: 03/03/2022 12:02:05
Job User: mgoetsch

I’m having this issue as well, has anyone resolved it? I can’t figure out what’s causing the issue because my own functions to create versions on shotgun using the same humanusers and script API are working fine. Our draft versions are set up to use Deadline’s shotgun integration though and I’d rather not reconfigure the pipeline to bypass a feature of the program that should be working.

The username isn’t a byte string, I checked that.

It only seems to error when trying to create the initial version on the job with the OnJobSubmitted “no task” part. But this is a problem since every other update is tied to that version, and the movie doesn’t upload properly if it’s not initially created.

Was working fine on Deadline 10.1.9 and now broken on 10.1.20

That’s a weird one, because it is an “Unknown Authentication Error”.
I suppose if you try the same flow in an interactive python shell it works?

Out of curiosity, why not use script users everywhere (I know kylero said they use it in some places)? HumanUser auth is better suited for interactive programs.

https://help.autodesk.com/view/SGSUB/ENU/?guid=SG_Migration_mi_migration_account_mi_end_user_account_html#configure-your-personal-access-token
The documentation mentions that you have to “Save your PAT to your profile”, check the last section of the page.

I believe on mine, (and also on their’s) the workflow is that the ScriptUser is actually creating the version entity but the HumanUser gets the credit, with the Artist/CreatedBy fields being set to the HumanUser. So it shouldn’t need to authenticate the HumanUser at all, and I’m not 100% sure it was trying to.

Thinkbox Support sent me down the PAT road as well, linking a guide written for cinesync below. But since I don’t think authenticating the human user was the issue, it didn’t seem to really fit in or do anything when I made one.

https://www.cinesync.com/manual/latest/ShotGrid_Username_Login.html

I’ve stopped trying to figure it out from here though, too many unknowns, especially with the Python 3 change happening. To get the studio up and running again, I ended up just using my own shotgun version upload functions at the end of the Draft script. Probably more futureproof anyway!