gluster / gluster-health-report

Gluster Health Report Tool
GNU Lesser General Public License v3.0
23 stars 20 forks source link

errors_in_logs: Fix TypeError while parsing log message timestamp #15

Closed pdvian closed 6 years ago

pdvian commented 6 years ago

Signed-off-by: Prashant D pdhange@redhat.com

pdvian commented 6 years ago

Getting below TypeError when pline is None:

[2017-10-06 10:37:18.944972] E [utils:160:output_error] : [ ERROR] Report failure report=report_check_errors_in_glusterd_log [2017-10-06 10:37:18.945362] E [main:191:main] : Report failure report=report_check_errors_in_glusterd_log Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/gluster_health_report-0.1-py2.7.egg/glusterhealth/main.py", line 188, in main func(context) File "/usr/lib/python2.7/site-packages/gluster_health_report-0.1-py2.7.egg/glusterhealth/reports/errors_in_logs.py", line 22, in report_check_errors_in_glusterd_log process_log_file("/var/log/glusterfs/glusterd.log", callback_check_errors) File "/usr/lib/python2.7/site-packages/gluster_health_report-0.1-py2.7.egg/glusterhealth/reports/utils.py", line 109, in process_log_file callback(pline) File "/usr/lib/python2.7/site-packages/gluster_health_report-0.1-py2.7.egg/glusterhealth/reports/errors_in_logs.py", line 11, in callback_check_errors pl = datetime.datetime.strptime(pline.ts, "%Y-%m-%d %H:%M:%S.%f") TypeError: must be string, not None