Houdini Plug-in doesn't include full error message when handling Operation Failed errors

Issue

When Houdini will error during rendering of a ROP node it can produce a Python error in stdout like so:

Error: Caught exception: The attempted operation failed.

The Houdini plug-in handles this error by default and directly triggers FailRender with GetRegexMatch(1) as the message . Which will just list the Caught Exception message. However, the more important parts of why Houdini is failing are not reported since the rest of the error is excluded which comes after that line.

For example we have a case that was producing this error:

2022-03-29 10:16:41:  0: PYTHON: Error:       Failed to save output to file "".

(only in Deadline; due to a bug on how it handles referenced parameters in the output path for a ROP node)
This log line comes from an altered Houdini plugin where I briefly disabled the HandleStdOutError method.

We’ve had this issue more often where Deadline would just fail on Caught Exception but didn’t allow a trace to the full error Houdini is producing. Similarly I’d also like the full traceback:

2022-03-29 10:17:00:  0: STDOUT: Traceback (most recent call last):
2022-03-29 10:17:00:  0: STDOUT:   File "C:\ProgramData\Thinkbox\Deadline10\workers\machine\plugins\6241cfc7e7aa406aa87ce554\hrender_dl.py", line 896, in <module>
2022-03-29 10:17:00:  0: STDOUT:     rop.render( frameTuple, resolution, ignore_inputs=ignoreInputs )
2022-03-29 10:17:00:  0: STDOUT:   File "/houdini/python3.7libs\hou.py", line 72237, in render
2022-03-29 10:17:00:  0: STDOUT:     return _hou.RopNode_render(self, *args, **kwargs)
2022-03-29 10:17:00:  0: STDOUT: hou.OperationFailed: The attempted operation failed.

Question

How could I set up the capturing of the error so that we can still capture the full traceback of the error in the Deadline logs?

1 Like

Unfortunately we discovered this problem the hard way also.
The way we solved it is that the error handler checks the error contents and decides whether to fail the job. So we have “Attempted operation failed” and other errors that get ignored until we hit the actual error.

Does that mean you have removed the default handlers for Error:, etc. and added more explicit handlers?

Would you be able to share your specific changes just as a reference?

It’s pretty straightforward actually (though not optimized at all):

    def HandleStdoutError(self):
        if "attempted operation failed" not in self.GetRegexMatch(1) and \
           "Unable to save geometry" not in self.GetRegexMatch(1) and \
           "Invalid source" not in self.GetRegexMatch(1):
            self.FailRender(self.GetRegexMatch(1))

You might want to add more errors to ignore. I recommend putting all of them in a list and checking iteratively through it.

1 Like