Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diamond fails to run at boot with "Name or service not known" #751

Open
paulraines68 opened this issue Oct 23, 2020 · 2 comments
Open

diamond fails to run at boot with "Name or service not known" #751

paulraines68 opened this issue Oct 23, 2020 · 2 comments

Comments

@paulraines68
Copy link

On CentOS7 using diamond-4.0.515 with the included systemd service file, diamond always fails to run at boot but starts fine by a hand later.

The error in the log is:


[2020-10-23 16:07:50,198] [MainThread] Unhandled exception: [Errno -2] Name or service not known
[2020-10-23 16:07:50,199] [MainThread] traceback: Traceback (most recent call last):
  File "/usr/local/diamond/bin/diamond", line 298, in main
    server.run()
  File "/usr/local/diamond/lib/python2.7/site-packages/diamond/server.py", line 108, in run
    self.handlers = load_handlers(self.config, handlers)
  File "/usr/local/diamond/lib/python2.7/site-packages/diamond/utils/classes.py", line 89, in load_handlers
    h = cls(handler_config)
  File "/usr/local/diamond/lib/python2.7/site-packages/diamond/handler/stats_d.py", line 66, in __init__
    self._connect()
  File "/usr/local/diamond/lib/python2.7/site-packages/diamond/handler/stats_d.py", line 161, in _connect
    port=self.port
  File "/usr/lib/python2.7/site-packages/statsd/client.py", line 139, in __init__
    host, port, fam, socket.SOCK_DGRAM)[0]
gaierror: [Errno -2] Name or service not known

I tried adding the following to [Unit] in /etc/systemd/system/diamond.service but it made no difference

After=network.target

I then changed that to the following and it did work:

After=network.target remote-fs.target nss-lookup.target

@shortdudey123
Copy link
Member

Interesting ... Can you submit a PR?

@paulraines68
Copy link
Author

Sorry, I don't know how to do a pull request

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

No branches or pull requests

2 participants