Consul running as windows service gets terminated unexpectedly on the first start

We are trying to run consul (1.10.3) as a windows native service. The service fails on the first start with error - The consul service terminated unexpectedly, we see it in the running state when it tries to start again after this first failure. This is a consistent behavior whenever the service is restarted.

In consul logs we only see following logs:

2021-11-01T07:17:05.534-0700 [WARN]  agent: skipping file C:\ProgramData\consul\config\dhcp_dns_settings.txt, extension must be .hcl or .json, or config format must be set
2021-11-01T07:17:05.535-0700 [WARN]  agent: skipping file C:\ProgramData\consul\config\node_name, extension must be .hcl or .json, or config format must be set

Following are windows event logs:

    1505 Nov 01 06:58  Information Service Control        1073748860 The consul service entered the running state.
                                   Manager
    1503 Nov 01 06:56  Error       Service Control        3221232503 The consul service terminated unexpectedly.  It has done
                                   Manager                           this 2 time(s).  The following corrective action will be
                                                                     taken in 120000 milliseconds: Restart the service.
    1502 Nov 01 06:56  Information Service Control        1073748860 The consul service entered the running state.
                                   Manager
    1501 Nov 01 06:56  Information Service Control        1073748860 The consul service entered the stopped state.
                                   Manager
    1498 Nov 01 06:55  Information Service Control        1073748860 The consul service entered the running state.

What could be the cause of this?

Hey @gulavanir

Could you set your consul log_level to trace and then replicate the behavior that causes the error? Hopefully that’ll give us more information in the consul logs on what’s going on

Additionally, if you’re interested in removing those ‘WARN’ messages, moving those two files dhcp_dns_settings.txt and node_name out of the config directory would do that