Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
Description of the Issue (and unexpected/desired result)
From time to time consul fails to start with:
2017-09-21_17:56:34.26259 ==> Starting Consul agent...
2017-09-21_17:56:34.26373 ==> Error starting agent: Failed to setup node ID: uuid string is wrong length
Looking at the node-id file it is zero bytes. When we remove the node-id file and consul starts correctly.
Expected behavior: when consul starts the check to create the node-id file could be such that if the file doesn't exist or is empty, then create it.
Reproduction steps
It appears this occurs when consul is in the process of starting and is force restarted mid-startup. This is a fairly rare failure likely due to how we deploy consul (generate the config files from templates and force-restart consul).
Log Fragments
We run consul under runit so a majority of this output is from the run script. Looking at some other deploy logs I see runit force-restarting consul after which time consul fails to start.
Seems like we need to swap that file after it has been written, similar to what we do with other files generated by Consul (seems like it's worth a helper lib).
consul version
for both Client and ServerClient:
0.7.5
Server:0.7.5
consul info
for both Client and ServerClient:
Server:
Operating system and Environment details
Server: Centos 7.2 Clients: Centos 7.2, Centos6.5, Ubuntu 14
Description of the Issue (and unexpected/desired result)
From time to time consul fails to start with:
Looking at the node-id file it is zero bytes. When we remove the node-id file and consul starts correctly.
Expected behavior: when consul starts the check to create the node-id file could be such that if the file doesn't exist or is empty, then create it.
Reproduction steps
It appears this occurs when consul is in the process of starting and is force restarted mid-startup. This is a fairly rare failure likely due to how we deploy consul (generate the config files from templates and force-restart consul).
Log Fragments
We run consul under runit so a majority of this output is from the run script. Looking at some other deploy logs I see runit force-restarting consul after which time consul fails to start.