synthesize
synthesize copied to clipboard
Statsite not writing to Graphite v4.0.0 xrange and StandardError not defined
Did a fresh install of the v4.0.0 tagged and master branch.
Statsite was not flushing to Graphite. I found this error in the syslog.
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: Traceback (most recent call last):
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: File "/usr/local/sbin/statsite-sink-graphite.py", line 102, in flush_lines
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: self._write_metric(data)
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: File "/usr/local/sbin/statsite-sink-graphite.py", line 156, in _write_metric
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: for _ in xrange(self.attempts):
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: NameError: name 'xrange' is not defined
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: During handling of the above exception, another exception occurred:
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: Traceback (most recent call last):
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: File "/usr/local/sbin/statsite-sink-graphite.py", line 186, in
It looks like you're using a Python2 script with Python3, so it's failing.
Looking at the way you do the install, you're pulling the script from the statsite repo, so maybe I should submit a patch there to fix the sink to be Python3 compatible. Or you can keep your own python3 compatible version.
I sent a pull request that will fix this.