SSL certificate error on sgtk.util.regiter_publish

Hi, im developing some tools for digital assets in Houdini 17.5 …

while using a build toolkit app, I execute a hook which try to register the published file.

At the moment the script executes the code:

    args = {
        "tk": self.parent.tank,
        "context": self.parent.engine.context,
        "path": esto['operator'],
        "name": os.path.basename(esto['operator']),
        "version_number": 6,
        "published_file_type": "Library item",
    print 'sgtk: ', sgtk.__file__
    sg_publish = sgtk.util.register_publish(**args)

The published files is registered correctly in shotgun , but it also drop the following error.

[ERROR publish_creation] <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>
Traceback (most recent call last):
  File "/home/cvizcarra/ollinDev/PIGS_kDev/install/core/python/tank/util/shotgun/", line 308, in register_publish
    tk.shotgun.upload_thumbnail(published_file_entity_type, entity.get("id"), no_thumb)
  File "/home/cvizcarra/ollinDev/PIGS_kDev/install/core/python/tank_vendor/shotgun_api3/", line 2173, in upload_thumbnail
    field_name="thumb_image", **kwargs)
  File "/home/cvizcarra/ollinDev/PIGS_kDev/install/core/python/tank_vendor/shotgun_api3/", line 2263, in upload
    tag_list, is_thumbnail)
  File "/home/cvizcarra/ollinDev/PIGS_kDev/install/core/python/tank_vendor/shotgun_api3/", line 2383, in _upload_to_sg
    result = self._send_form(url, params)
  File "/home/cvizcarra/ollinDev/PIGS_kDev/install/core/python/tank_vendor/shotgun_api3/", line 3806, in _send_form
    resp =, params)
  File "/opt/hfs17.5.173/python/lib/python2.7/", line 429, in open
    response = self._open(req, data)
  File "/opt/hfs17.5.173/python/lib/python2.7/", line 447, in _open
    '_open', req)
  File "/opt/hfs17.5.173/python/lib/python2.7/", line 407, in _call_chain
    result = func(*args)
  File "/opt/hfs17.5.173/python/lib/python2.7/", line 1241, in https_open
  File "/opt/hfs17.5.173/python/lib/python2.7/", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>
Traceback (most recent call last):
  File "/home/cvizcarra/ollinDev/PIGS_kDev/config/hooks/", line 66, in register_publishedfile
    description='Alembic nodes.')
  File "/home/cvizcarra/ollinDev/PIGS_kDev/install/core/python/tank/", line 503, in wrapper
    response = func(*args, **kwargs)
  File "/home/cvizcarra/ollinDev/PIGS_kDev/install/core/python/tank/util/shotgun/", line 323, in register_publish
ShotgunPublishError: Unable to complete publishing because of the following error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>, although PublishedFile PIGS_libary_tool_hda_asasas_v017.hda (id: 114715
) was created.

I cant find why this error is coming out, If we use hooks and register_publish within nuke engine, everything works fine!!!

1 Like

Hi Christian

This is a bit tricky. I suspect that it is failing because it can’t upload a thumbnail. The register method always uploads a thumbnail. Even if you don’t provide it with one, it will upload a placeholder thumbnail.

So the question becomes why can’t it upload media.
To start with, I would check what version of core you are running, and try the latest if you’re not on it. Though I suspect that is not the issue as it’s working fine in Nuke. Really what you are looking to ensure here is that by updating core, you are also ensuring it’s bundled with and using the latest SG API.

Failing that, I would suggest checking out this doc and seeing if any of the suggestions there help. I suspect this is more likely to be the issue, as it’s probably tied to the version of Python being run in the software you’re using, and the certificates it ships with.


Weel I have upgrade true ./tank core upgrade

The version shown in Shotgun desktop About window with selected proyect is:

App Version v1.5.0
Startup version v1.10.5
Engine Version v2.4.12
Core v0.18.168 <-------- latest core updated!
toolkit Basic Configuration v1.2.9

Then via Shotgun Desktop, Houdini engine is launched …
open an asset or shot,
then if I open "Work are info… " window, it promp an error with the same SSL problem…

[INFO tk-multi-about] Could not get thumbnail for url ‘
e010076ccd529a1681043ac613c8d75fa97175cb4b’. Error: Could not download contents of url ‘https://sg-media-usor-01.s3-acc
-Signature=d65981cab95110b2e03873e010076ccd529a1681043ac613c8d75fa97175cb4b’. Error reported: <urlopen error [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>

if I try to publish, it turns again the SSL: CERTIFICATE_VERIFY_FAILED

This behave is just on Houdini engine but nor in Nuke and Maya.

It seems I was missing the cacert.pem and the required environment variable
SHOTGUN_API_CACERTS pointing to that location.

Now the error is not appearing any more.

Thanks : )


Hi all. Thank you for this post, it helped me out a bunch. In case anyone else runs across this issue but isn’t able to get the solution to work – watch the version of python being used just as @philip.scadding suggested in his solution. I was trying this with Houdini 17.0 and couldn’t make it happy. Turns out Houdini 17.0 comes with python 2.7.5 (as opposed to 2.7.15 for H17.5).

Thank you again!

1 Like