Introduction
This document describes how to show python traceback and error stack in "Execute Python Stack" activity.
Problem
When you try to use an "Execute Python Script" block, it fails. You get "Value cannot be null" error which does not help you troubleshoot the actual issue.
Solution
In order to help send back the error to the GUI, you need to make use of the traceback library in python. You need to try, except the blocks around the code you believe have issues and then use the traceback.print_exc function.
In this example, you can try to import the Crypto library in case you do not have it installed. Normally, the code will just be:
from Crypto.Hash import SHA256
If that fails, you can use this code to get the actual error:
import sys,traceback
try:
from Crypto.Hash import SHA256
except:
traceback.print_exc(file=sys.stdout)
This is the type of output you will see in Cisco Process Orchestrator (CPO):