I am getting a very vague error when trying to upload media to shotgun using the python API. I first got an SSL error but, after looking through some of the forums, I found that one solution to this problem was to manually update the ca_certs field when initializing the shotgun object. I did this, and pointed the object to the “shotgun_api3/lib/httplib2/python3/cacerts.txt” file. After doing that, I got a new error, which i will paste below, along with the code which prompted that error. If anyone has any insight into this error, or has experienced the same problem, I would really appreciate the help. Thank you for your time. Also, I starred out some info, but that shouldn’t change the meaning of any code.
The code is:
sg = shotgun_api3.Shotgun(serverPath, scriptName, scriptKey, ca_certs=“*******/includes/pythonTools/pycharmProjects/shotgunProject/newEnvironment/lib/python2.7/shotgun_api3/lib/httplib2/python3/cacerts.txt”)
fileName = “/********/110_004_010_comp_v008_breakdown.mov”
result2 = sg.upload(“Shot”, 7113, fileName, display_name=“test_shot”)
print(result2)
data = { ‘project’: {‘type’: ‘Project’, ‘id’: 466},
‘code’: ‘test_shot_010’,
‘description’: ‘test uploading a shot’,
‘sg_path_to_frames’: fileName,
‘sg_status_list’: ‘rev’}
result = sg.create(‘Version’, data)
and the error is:
Traceback (most recent call last):
File "//sandbox/includes/pythonTools/pycharmProjects/shotgunProject/main.py", line 16, in
result2 = sg.upload(“Shot”, 7113, fileName, display_name=“test_shot”)
File "//Library/Python/3.9/lib/python/site-packages/shotgun_api3/shotgun.py", line 2431, in upload
return self._upload_to_storage(entity_type, entity_id, path, field_name, display_name,
File "//Library/Python/3.9/lib/python/site-packages/shotgun_api3/shotgun.py", line 2499, in _upload_to_storage
raise ShotgunError("Could not upload file successfully, but "
shotgun_api3.shotgun.ShotgunError: Could not upload file successfully, but not sure why.
Path: //110_004_010_comp_v008_breakdown.mov
Url: https://****.shotgunstudio.com/upload/api_link_file
Error: 0
Value is not legal.