IBM Security QRadar SOAR

 View Only
  • 1.  Assigning Value Throws nonetype error

    Posted Wed February 19, 2020 01:18 PM
      |   view attached
    Hey there, 

    We recently noticed that our script for parsing email messages sent to Resilient started to throw the following error: 'Nonetype' object is not iterable. 

    We were able to narrow it down to the following line:
    incident.properties.incident_origin = "Email"


    The field incident_origin is a select field with the following values: 
    SIEM
    Email
    Hotline
    SOC Analyst
    Hotline Call
    Threat Hunting 

    We previously had that assigned and nothing was modified in either the field or the script but yet it mysteriously broke this week. 

    I attempted to see if it was all select fields but when I tested against another one it worked.  

    I have attached a picture of what the field looks like. Any ideas as to why this occurred would be helpful. 

    Thanks!



    ------------------------------
    Adina Bodkins
    ------------------------------


  • 2.  RE: Assigning Value Throws nonetype error

    IBM Champion
    Posted Mon February 24, 2020 01:57 PM
    Hey Adina,

    I believe it needs to be this since it's a select field, not a text field:​

    incident.properties.incident_origin = ["Email"]

    ------------------------------
    Jared Fagel
    Cyber Security Analyst I
    Public Utility
    ------------------------------



  • 3.  RE: Assigning Value Throws nonetype error

    Posted Mon February 24, 2020 02:47 PM
    I set up my system with the field as you have shown and was able to set it properly:

    I would suggest something else is causing this issue.

    Do you have the actual error message?

    Ben

    ------------------------------
    Ben Lurie
    ------------------------------



  • 4.  RE: Assigning Value Throws nonetype error

    Posted Tue September 13, 2022 02:38 AM
    This error means that python is trying to iterate over a None object. With Python, you can only iterate over an object if that object has a value. This is because iterable objects only have a next item which can be accessed if their value is not equal to None. If you try to iterate over a None object, you encounter the TypeError: 'NoneType' object is not iterable error.

    For example, list.sort() only change the list but return None.

    Python's interpreter converted your code to pyc bytecode. The Python virtual machine processed the bytecode, it encountered a looping construct which said iterate over a variable containing None. The operation was performed by invoking the `__iter__` method on the None. None has no `__iter__` method defined, so Python's virtual machine tells you what it sees: that NoneType has no `__iter__` method.

    Technically, you can avoid the NoneType exception by checking if a value is equal to None before you iterate over that value.


    ------------------------------
    rick slator
    ------------------------------