Skip to content

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

Description

@paulraines68

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions