Annotation download issue

We have set up an event daemon that copies client notes and annotations from clients SG to the local SG. For every [‘attachments’] in the Notes, I am using sg.download_attachment() to a local path and sg.upload() to the Note created on local SG.

However, there have been few instances lately where the annotations are uploaded to local SG but are not viewable/blank image.

Is it something related to sg fix but the issue we have faced is dated 10th July.

Please suggest how to ensure a successful download, I have also added time.sleep(2) before and after attachment download.
Kindly, let know if there is a better way to address the same.


We noticed the same behavior in a similar circumstance. All works fine most of the time and then suddenly we have like 10 minutes or so where shotgun.download_attachment will download something that looks like an html file and not the media from the attachment.
There is no error or anything. Just the content of the file is wrong. Since we download shortly after the creation of the attachment I added multiple delays but that does not seem to help.

The content of the files looks like this (just the start and end since there seemed to be session key inside):

<!DOCTYPE html>
<html lang="en" class="sg_reset_html sgds-theme-root sgds-theme-root--default">
        <script src="/javascripts/util/esdetect.js?23727fe"></script>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">


    <div id="container" />
    <div id="shotgun_version" class="build_no">
        v8.34.0.9596 (build 23727fe)

        // Internationalization (i18n)
        SG.init_i18n('en', SG.globals.i18n_data);

But it’s not an error or 404 message or anything.

It would be nice know what’s going on here and how to avoid this.


You probably already figured out a solution, and not sure if this is exactly the issue you were having, but I think any file that gets uploaded to SG needs to get transcoded so you can’t download the file that is just been uploaded. I think you need to wait till the file is finished transcoded.

I think the event plugin needs to be triggered based on the sg_uploaded_movie_transcoding_status attribute name. Once an entity, like Version or Attachment, is created and transcoded, and event is triggered with this attribute name that you can catch and download the file.

I hope that helps.

1 Like