Closed aguidotti closed 5 years ago
Can you provide an example where this is a problem?
I reproduced the problem by commenting LOG.error and restoring LOG.exception LOG.exception(u"%s (%s): %s", repr(fevent), repr(etype), message)
We have a custom integration module with HPSM, but the same problem occurrs with email integration (rc_email). I left my additional tracing in the except module. Below the extract from app.log. I don't know if this is context-related, i.e., due to some particularity in our environment. What kind of additional information do you need?
2018-09-19 15:29:32,430 INFO [app] Configuration file: app.config 2018-09-19 15:29:32,431 INFO [app] Resilient server: xx.xx.xx.xx 2018-09-19 15:29:32,431 INFO [app] Resilient user: resadmin@xxxx.eu 2018-09-19 15:29:32,432 INFO [app] Resilient org: xxxx 2018-09-19 15:29:32,432 INFO [app] Logging Level: INFO 2018-09-19 15:29:32,435 WARNING [co3] Unverified HTTPS requests (cafile=false). 2018-09-19 15:29:34,069 INFO [app] Components auto-load directory: /home/ee50256/.resilient/components 2018-09-19 15:29:34,094 INFO [query_update] Setting basestring to str for python 2/3 compatibility 2018-09-19 15:29:34,122 INFO [component_loader] Loading 2 components 2018-09-19 15:29:34,123 INFO [component_loader] 'query_runner.components.splunk_search.SplunkQueryRunner' loading 2018-09-19 15:29:34,128 INFO [component_loader] 'rc_email.components.email_actions.EmailConnector' loading 2018-09-19 15:29:34,130 INFO [email_actions] Using template directory:/home/ee50256/.resilient/jinja 2018-09-19 15:29:34,131 INFO [component_loader] Loading 'hpsm_integration' from /home/ee50256/.resilient/components/hpsm_integration.py 2018-09-19 15:29:34,132 WARNING [actions_component] Unverified STOMP TLS certificate (cafile=false) 2018-09-19 15:29:34,143 INFO [stomp_component] Connect to xx.xx.xx.xx.53:65001 2018-09-19 15:29:34,144 INFO [actions_component] 'query_runner.lib.misc.InterruptibleWorker' actions registered to 'siem_query' 2018-09-19 15:29:34,145 INFO [actions_component] 'query_runner.components.splunk_search.SplunkQueryRunner' actions registered to 'siem_query' 2018-09-19 15:29:34,146 INFO [actions_component] 'rc_email.components.email_actions.EmailConnector' actions registered to 'xxxx_email_queue' 2018-09-19 15:29:34,146 INFO [app] App Started 2018-09-19 15:29:34,286 INFO [actions_component] 'hpsm_integration.HpsmIntegrationComponent' actions registered to 'hpsm' 2018-09-19 15:29:34,287 INFO [component_loader] Loaded and registered component 'hpsm_integration' 2018-09-19 15:29:34,287 INFO [actions_component] STOMP attempting to connect 2018-09-19 15:29:34,288 INFO [app] Components loaded 2018-09-19 15:29:34,290 INFO [stomp_component] Connect to Stomp... 2018-09-19 15:29:34,291 INFO [client] Connecting to xx.xx.xx.xx:65001 ... 2018-09-19 15:29:34,346 INFO [client] Connection established 2018-09-19 15:29:34,520 INFO [client] Connected to stomp broker [session=ID:resilient.localdomain-45214-1536586512092-3:102, version=1.2] 2018-09-19 15:29:34,521 INFO [stomp_component] Connected to failover:(ssl://xx.xx.xx.xx:65001)?maxReconnectAttempts=1,startupMaxReconnectAttempts=1 2018-09-19 15:29:34,521 INFO [stomp_component] Client HB: 0 Server HB: 15000 2018-09-19 15:29:34,522 INFO [stomp_component] No Client heartbeats will be sent 2018-09-19 15:29:34,522 INFO [stomp_component] Requested heartbeats from server. 2018-09-19 15:29:34,524 INFO [actions_component] Subscribe to message destination 'xxxx_email_queue' 2018-09-19 15:29:34,524 INFO [actions_component] Subscribe to message destination 'hpsm' 2018-09-19 15:29:34,525 INFO [actions_component] Subscribe to message destination 'siem_query' 2018-09-19 15:29:34,526 INFO [actions_component] STOMP connected. 2018-09-19 15:29:34,527 INFO [stomp_component] Subscribe to message destination actions.201.xxxx_email_queue 2018-09-19 15:29:34,528 INFO [stomp_component] Subscribe to message destination actions.201.hpsm 2018-09-19 15:29:34,529 INFO [stomp_component] Subscribe to message destination actions.201.siem_query 2018-09-19 15:29:34,744 INFO [actions_component] Event: <open_ticket_to_hpsm[] (id=71, workflow=None, user=fabrizio.manzo@ibm.com) 2018-09-19 13:23:37.648999> Channel: actions.hpsm 2018-09-19 15:29:34,845 INFO [hpsm_integration] handle_xxxx_hpsm_open_ticket: (test_alice_123) - (7450) 2018-09-19 15:29:34,846 INFO [hpsm_integration] get_datatable: (hpsm_tickets) (7450) 2018-09-19 15:29:34,963 INFO [hpsm_integration] get_datatable_row: (hpsm_tickets) (338) 2018-09-19 15:29:34,964 INFO [hpsm_integration] set_hpsm_entry: (hpsm_tickets) (338) 2018-09-19 15:29:34,966 ERROR [actions_component] Exception handler threw exception! Response to action module may not have sent. 2018-09-19 15:29:34,967 ERROR [actions_component] 'NoneType' object has no attribute 'context' 2018-09-19 15:29:34,967 ERROR [actions_component] Original exception traceback. 2018-09-19 15:29:34,967 ERROR [actions_component] [' File "/opt/rh/rh-python34/root/usr/lib/python3.4/site-packages/circuits/core/manager.py", line 814, in processTask\n value = next(task)\n', ' File "/home/ee50256/.resilient/components/hpsm_integration.py", line 109, in xxxx_hpsm_ticket_action\n actionReturMsg = self.handle_xxxx_hpsm_open_ticket(event)\n', ' File "/home/ee50256/.resilient/components/hpsm_integration.py", line 143, in handle_xxxx_hpsm_open_ticket\n HPSM_ENTRY = self.set_hpsm_entry(hpsm_table,event.message[\'row\'][\'id\'])\n', ' File "/home/ee50256/.resilient/components/hpsm_integration.py", line 936, in set_hpsm_entry\n html_description = str(HPSM_ENTRY[\'hpsm_description\'][\'content\']) + "\n"\n']
The handler is calling LOG.exception, which generates a new exception, thus preventing the handler from completing successfully and properly processing the event. I modified the except block in the handler to print the error message associated with the exception generated in the handler and caught. This should facilitate the troubleshooting in case the handler fails.