AWS Thinkbox Discussion Forums

Force fail job if a word is detected in render log?

We are running into a Redshift error that the final image would randomly not be produced properly. The final few lines of the log looks like this.

[Redshift] Failed to save file '\\PATH\TO\OUTPUT.FRAME.exr'
[Redshift] Frame done - total time for layer 'LAYER', frame xxx (1/1): 44m:46s
[Redshift] Rendering layer 'LAYER' done - total time for 1 frames: 44m:46s
STDOUT: Render completed.

The output file gets created, but with size 0 kb.

My question is, how can I force the task to fail if this phrase Failed to save file showed up? . I tried adding it in the plugin file MayaBatch.py under HandleErrorMessage function, but I think it never gets triggered because the message was not considered an error message?

If the handler matches it correctly, it should be called. I’d think the issue is in your Regex. Can you pass your code this way?

For others who are curious how to write these handlers, there are a few threads around the forums and some info in the docs:


https://docs.thinkboxsoftware.com/products/deadline/10.0/1_User%20Manual/manual/application-plugins.html?highlight=stdouthandler

Ah, thank you. Looks like I got it wrong all along. This is probably what I need, under InitializeProcess ?

if self.Renderer == "redshift":
    self.AddStdoutHandlerCallback( "\\[Redshift\\] Failed to save file.*" ).HandleCallback += self.HandleFatalError

Looks fairly right. I don’t know if “self.Renderer” is set yet, but that looks good to me!

That one didn’t work, I’m adding another one. They can just be partially matched?

The self.Renderer check was part of the original code so hopefully it would be set. :smiley:

    if self.Renderer == "redshift":
        self.AddStdoutHandlerCallback( r"Frame rendering aborted." ).HandleCallback += self.HandleFatalError
        self.AddStdoutHandlerCallback( r"Rendering was internally aborted" ).HandleCallback += self.HandleFatalError
        self.AddStdoutHandlerCallback( r'Cannot find procedure "rsPreference"' ).HandleCallback += self.HandleFatalError
        self.AddStdoutHandlerCallback( "Rendering frame \\d+ \\((\\d+)/(\\d+)\\)" ).HandleCallback += self.HandleRedshiftNewFrameProgress
        self.AddStdoutHandlerCallback( "Block (\\d+)/(\\d+) .+ rendered" ).HandleCallback += self.HandleRedshiftBlockRendered
        self.AddStdoutHandlerCallback( r'Failed to save file' ).HandleCallback += self.HandleFatalError

edit - this one works!

Excellent!

One thing to note too which throws folks off (including me): We stop trying to match after we find a line, so if there is a rule that will grab a part of the message (say it starts with “Error”) then your custom rule may never be called.

Privacy | Site terms | Cookie preferences