IBM Security QRadar SOAR

 View Only
  • 1.  Error with workflow.addProperty and Python3

    IBM Champion
    Posted Fri November 20, 2020 12:35 PM

    Hey everyone,

    I'm experiencing an error when trying to run a Python 3 script within Resilient that contains the following line:

    workflow.addProperty("data", {"key": [1,2,3]})

    I get the error "Script 'data setter' from Workflow 'Workflow Property test' was unable to complete because: TypeError: 'NoneType' object is not callable".

    If I change the language of the script to Python 2, it works fine. Also worth noting that if I change the value from a list to a string as a Python 3 script, it works fine. So it seems there's an issue while trying to add a dictionary that contains a list to the workflow properties in Python 3.

    Note: I also tried creating the dictionary outside of the `workflow.addProperty()` call, e.g.:

    x = {"key": [1,2,3]}

    workflow.addProperty("data", x)

    and this didn't work either.

    Any ideas if I could be doing something wrong, or is this a bug? I can provide more details about my script / workflow / rule I was using to replicate the issue.



    ------------------------------
    Liam Mahoney
    ------------------------------


  • 2.  RE: Error with workflow.addProperty and Python3

    Posted Sat November 21, 2020 09:22 AM
    Edited by BENOIT ROSTAGNI Sat November 21, 2020 11:58 AM
    Hi Liam,

    Just tested on v39

    thisdict = {
    "brand": "Ford",
    "model": "Mustang",
    "year": 1964
    }
    workflow.addProperty("detail", thisdict)
    do work

    workflow.addProperty("detail", {"key": [1,2,3]})
    do not work
    ------------------------------
    BENOIT ROSTAGNI
    ------------------------------



  • 3.  RE: Error with workflow.addProperty and Python3

    Posted Mon November 23, 2020 06:15 AM
    Hi Liam,

    This is a bug with adding lists and nested dictionaries to workflow properties in Python 3. We are currently working on a fix targeted for V39.1 so until then you will have to use Python 2 for this particular script. I will reply to this thread when the fix is confirmed.

    Thanks,

    ------------------------------
    Sean Mc Cann
    ------------------------------



  • 4.  RE: Error with workflow.addProperty and Python3

    IBM Champion
    Posted Mon November 23, 2020 09:51 AM
    @BENOIT ROSTAGNI @Sean Mc Cann thanks for the update!​​

    ------------------------------
    Liam Mahoney
    ------------------------------



  • 5.  RE: Error with workflow.addProperty and Python3

    Posted Thu December 10, 2020 08:19 AM
    Liam,

    Just to let you know, you should see this fixed in the upcoming V39.1 release.

    Thanks again for highlighting this issue,

    ------------------------------
    Sean Mc Cann
    ------------------------------