Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Statsite not writing to Graphite v4.0.0 xrange and StandardError not defined #81

Open
hkp opened this issue Jul 11, 2020 · 2 comments
Open

Comments

@hkp
Copy link

hkp commented Jul 11, 2020

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
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: main()
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: File "/usr/local/sbin/statsite-sink-graphite.py", line 182, in main
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: graphite.send_metrics()
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: File "/usr/local/sbin/statsite-sink-graphite.py", line 87, in send_metrics
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: self.flush()
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: File "/usr/local/sbin/statsite-sink-graphite.py", line 103, in flush_lines
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: except StandardError:
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: NameError: name 'StandardError' is not defined
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: statsite[28695]: Streaming command exited with status 1
Jul 11 21:34:07 ubuntu-bionic statsite[28695]: Streaming command exited with status 1

It looks like you're using a Python2 script with Python3, so it's failing.

@hkp
Copy link
Author

hkp commented Jul 11, 2020

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.

@hkp
Copy link
Author

hkp commented Jul 13, 2020

I sent a pull request that will fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant