ibm-dev-incubator / demoparser

Apache License 2.0
34 stars 10 forks source link

Handling New Danger-Zone Demos #11

Closed kpei closed 5 years ago

kpei commented 5 years ago

I'm having trouble on a particular small set of demos that are making the entire python script exit due to some exceptions with the parser unable to read the entities as they get returned Null.

Example demo URL

Example of errors (lot's of them, this is a snippet)

ec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: Exception ignored in: 'demoparser.demofile.DemoFile.handle_packet_entities'
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: Traceback (most recent call last):
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: File "/usr/local/lib64/python3.7/site-packages/demoparser/entities/entity_list.py", line 26, in __getitem__
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: return self._entities.__getitem__(index)
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: IndexError: list index out of range
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: AttributeError: 'NoneType' object has no attribute 'class_id'
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: Exception ignored in: 'demoparser.demofile.DemoFile.read_new_entity'
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: AttributeError: 'NoneType' object has no attribute 'class_id'
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: Traceback (most recent call last):
Dec 31 03:45:06 ip-10-0-0-217.ec2.internal python3[31301]: File "/usr/local/lib64/python3.7/site-packages/demoparser/entities/entity_list.py", line 26, in __getitem__

Normally in some cases when these errors pop up, the exceptions are ignored and the demo parses fine, however a small set of these are creating so many errors that eventually the script will exit. Is there something we can write in the code to either handle these errors or allow it to raise an exception in the python interpreter rather than ignoring it?

Thanks

kpei commented 5 years ago

Just noticed that this started happening to all demos after Danger zone came out. Don't think it's the protobuf files although they have changed since the protobufs remain the same in DemoInfo and it works