AWS Thinkbox Discussion Forums

Custom Deadline Events not executing

I’ve create an incredibly simple deadline event that just does a print statement .
However for whatever mysterious reason it does not execute on any of the render nodes. It only executes if i select the job in deadline, Right-click and go Requeue Job then immediately Right-click and select Complete Job. It’s only then it runs the custom events. I can confirm the events are Enabled globally in the Event Manager window. Does anyone have any advice on how to resolve this?

################################################################################
#  Imports
################################################################################
from System.Diagnostics import *
from System.IO import *

from Deadline.Events import *
from Deadline.Scripting import *

import sys
import os


################################################################################
# Give Deadline an instance of this class so it can use it.
################################################################################
def GetDeadlineEventListener():
    return MyEvent()


################################################################################
# Cleans up deadline event when it's no longer in use
################################################################################
def CleanupDeadlineEventListener(eventListener):
    eventListener.Cleanup()


################################################################################
# The Stats event listener class.
################################################################################
class MyEvent (DeadlineEventListener):


    def __init__( self ):
        self.OnJobFinishedCallback += self.OnJobFinished


    def Cleanup( self ):
        del self.OnJobFinishedCallback
            

    # This is called when the job finishes rendering.
    def OnJobFinished(self, job):
        print('dev...')
        print(sys.version)
        return True

That’s odd, everything seems in order.
Did you restart the render nodes after installing the plugin?

We have also problems with Deadline Events after updating to 10.2.0.10.
I’ve put the log message to the start of Shotgun event OnJobFinished, so it should be executed on every job finish.
It is working correctly on some machines, but there are some machines that sometimes don’t execute the event (I can’t see the Shotgun task with my message in the log). But it is not a rule, sometimes it also works on that machines :frowning:
I currently don’t know how to debug this…

Is this on Linux? I had an issue where the Event plugins sandbox was hanging or something similar. Since some versions ago, events run in a separate (daemon?) process.

The events plugin triggers when a specific callback events, so if you are triggering the Shotgun event with “OnJobFinished” which is invoked after the last Task in a Job is completed, or after the Job/Tasks are manually changed to complete. So only the last worker completed the job would trigger and log the event output.
Here is a documentation on Event Plugin: Event Plugins — Deadline 10.2.0.10 documentation

@mois.moshev Yes, it is on linux.
@karpreet Actually the problem is that the event is sometimes not executed after the last task.

Btw I’ve tried to switch the Event Sandbox Python Version to 3.
It still reports python 2 :frowning:

INFO: 2.7.13 | packaged by Thinkbox Software | (default, Jul 20 2021, 19:27:46)

EDIT: I’ve tried the deadlinemonitor -py-ver 3 and found that the libffi.so.6 was missing on my linux. Maybe it should be included with the Deadline installation (I’ve copied the file from the Rv app to /usr/lib64 and now it correctly reports: INFO: 3.7.6 | packaged by Thinkbox Software | (default, Jul 20 2021, 19:39:40)

1 Like

Hello @zavinator

I do not think we can ship it with the installer but we have reported this issue internally and we have got the workaround from our engineering team. I am just pasting it here:

  • Obtain a copy of libffi.so.6 rpm (for instance, from http://mirror.centos.org/centos/7/os/x86_64/Packages/libffi-3.0.13-19.el7.x86_64.rpm);
    • Extract rpm: rpm2cpio libffi-3.0.13-19.el7.x86_64.rpm | cpio -idmv;
    • Copy libffi.so.6.0.1 to some location, for example to /opt/libffi.so.6.0.1;
    • Created a symlink in /usr/lib64: ln -s /usr/lib64/libffi.so.6 <libffi.so.6.0.1 location>. If you have put the library into /opt
      then the command should look like ln -s /opt/libffi.so.6.0.1 /usr/lib64/libffi.so.6.

I cannot tell you ETA on when this will release in our docs, but we will definitely add these instructions in there.

There could be at least an error message in the log - if the sandbox version is set to py3 it quietly fallbacks to py2 without any message.

But this is not a primary issue. We are currently testing if moving to python 3 can solve the event issue. There is also no error message, why it skips the event…

I’ve found some python3 + Shotgun event issues (repositary 10.2.0.10):

  1. The shotgun api in pythonsync3 requires some parameters as str not bytes!
  • proxy parameter in GetShotgun (ShotgunUtils.py) should be converted to str:
proxy = six.ensure_str(proxy)
  • name and key parameters in GetShotgunForEventPlugin (ShotgunUtils.py) should be also str:
name = six.ensure_str(name)
key = six.ensure_str(key)
  1. It seems that there is a problem with reloading ShotgunUtils. Maybe this is related to the running sandbox (?)
    My workaround for this issue is force reloading (Shotgun.py):
import ShotgunUtils
from importlib import reload
reload(ShotgunUtils)

It seems that upgrading to python3 has solved the not executing issue…

1 Like
Privacy | Site terms | Cookie preferences