Project

General

Profile

Bug #369

statistics -> sources : 'NoneType' object has no attribute 'replace'

Added by Pierre Chifflier about 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Start date:
02/05/2010
Due date:
% Done:

0%

Resolution:

Description

In Prewikka version 1.0.0rc1, on the page Statistics -> Sources I get the following error:

'NoneType' object has no attribute 'replace'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/prewikka/Core.py", line 335, in process
    getattr(view_object, view["handler"])()
  File "/usr/lib/python2.5/site-packages/prewikka/views/stats.py", line 568, in render
    self._renderSourcesTrend(criteria)
  File "/usr/lib/python2.5/site-packages/prewikka/views/stats.py", line 556, in _renderSourcesTrend
    "alert.source.node.address.address", criteria, 10, zoom_type="sources_trend")
  File "/usr/lib/python2.5/site-packages/prewikka/views/stats.py", line 405, in _addTimelineChart
    c += "%s = '%s'" % (self._path, utils.escape_criteria(name))
  File "/usr/lib/python2.5/site-packages/prewikka/utils.py", line 72, in escape_criteria
    return criteria.replace("\\", "\\\\").replace("'", "\\'")
AttributeError: 'NoneType' object has no attribute 'replace'

History

#1 Updated by Pierre Chifflier about 11 years ago

Additional note:
I have the same error on Statistics -> Analyzers:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/prewikka/Core.py", line 335, in process
    getattr(view_object, view["handler"])()
  File "/usr/lib/python2.5/site-packages/prewikka/views/stats.py", line 751, in render
    self._renderClassesTrend(criteria)
  File "/usr/lib/python2.5/site-packages/prewikka/views/stats.py", line 740, in _renderClassesTrend
    "alert.analyzer(-1).class", criteria, limit = 10, zoom_type="analyzer_classes_trend")
  File "/usr/lib/python2.5/site-packages/prewikka/views/stats.py", line 405, in _addTimelineChart
    c += "%s = '%s'" % (self._path, utils.escape_criteria(name))
  File "/usr/lib/python2.5/site-packages/prewikka/utils.py", line 72, in escape_criteria
    return criteria.replace("\\", "\\\\").replace("'", "\\'")
AttributeError: 'NoneType' object has no attribute 'replace'

It seems to happen when there are alerts with empty sources (marked as n/a in prewikka).

#2 Updated by Yoann VANDOORSELAERE about 11 years ago

  • Status changed from New to Resolved
  • Assignee set to Yoann VANDOORSELAERE

Thanks for reporting the problem, this should be fixed as of 17d01296

#3 Updated by Yoann VANDOORSELAERE about 11 years ago

  • Target version set to 109

#4 Updated by Thomas ANDREJAK over 5 years ago

  • Status changed from Resolved to Closed
  • Target version changed from 109 to Prelude OSS 1.0.0

Also available in: Atom PDF