0

Shotgun query crashing Nuke 6.1v1 on CentOS 5.3

This has happened to me on a few occasions and as a result I've given up on querying Shotgun from inside Nuke on CentOS.

When I query Shotgun from Nuke - for example to check what is the latest version for a specific shot, the first query goes through, but the second crashes Nuke. It happens in Nuke 6.1v1 on CentOS 5.3 64-bit. The Shotgun query is fired when an user presses a custom PyScript button. If I remember correctly, the same thing happens when the query is run from the Nuke Script editor.

It also happened when I tried Frank's ShotGunDropper tool on http://www.nukepedia.com/gizmos/python-scripts/nodegraph/shotgundropper/. In that case, when I drag and drop an URL for a given version the tool works fine. When I drag & drop the same URL one more time, it still works fine and creates another Read node. When I go to another version's page and drag and drop it's URL, Nuke crashes. However, this is not happening when I try it from Nuke 6.1v1 on a Mac mini running OS X 10.6.5. PS: The tool finds the version id doing a pattern match on the URL, then runs a Shotgun query against the version ID.

5 comments

  • 0
    Avatar
    Mihail Temelkov

    Just did a simple test using the Nuke Script editor in Nuke.

    first, queried for a version with id 498. then queried for a version with id 499. on CentOS Nuke crashed during the second query. on Mac Nuke did not crash.

  • 0
    Avatar
    John McLaughlin

    I had the same problem running Shotgun in within the Google App Engine environment.  I did a little bit of poking into the shotgun API source code, but quickly got lost in the XMLRPC.  My best guess is that there may be confusion about the keep-alive for the Shotgun http socket.  

    What I ended up doing is writing wrapper functions that reinitialize the Shotgun object on every API call.  See attached.

  • 0
    Avatar
    Mihail Temelkov

    Thanks, John. I will try this after the holiday break.

  • 0
    Avatar
    Mihail Temelkov

    I got it working in Nuke 6.2v1+ by using a new Shotgun instance for each query. Thanks for the help guys.

    ps: Nuke 6.1v3 and older are still crashing (I'd guess it has to do with the rather old Python 2.5.1 used by Nuke 6.1), but we are moving to Nuke 6.2 anyway.

  • 0
    Avatar
    Rob Blau

    I've got a theory as to why the crashes are happening (I'm seeing the same thing when trying to talk to shotgun through some google APIs).  It looks like the shotgun code uses the HTTP/1.1 keep-alive tag to reuse a connection multiple times (good thing), but if your transport (the google API or maybe something in Nuke) or server don''t support keep-alive, then you'll start getting errors after the first request.

    A little more digging is needed, but it seems like there should be a change to the keep-alive support in the API to try to reconnect on certain errors, especially since even when keep-alive is supported, the connection could still time out.

    In shotgun_api3.py v3.0.5, the keep-alive logic is on lines 2113, 2231, and 2271.  If the connection there is not reused, the need for your wrapper should be eliminated.

Please sign in to leave a comment.