hashicorp/nomad · error

Failed to parse Consul Auth config

Error message

Failed to parse Consul Auth config

What it means

In newRunnerConfig, when the client's Consul config has Auth set, it is split on ':' and turned into consul-template SSL/auth config; this error fires when that auth string cannot be converted into the consul-template auth configuration, blocking template rendering that depends on Consul.

Source

Thrown at client/allocrunner/taskrunner/template/template.go:935

		if config.ConsulConfig.Namespace != "" {
			conf.Consul.Namespace = &config.ConsulConfig.Namespace
		}

		if config.ConsulConfig.EnableSSL != nil && *config.ConsulConfig.EnableSSL {
			verify := config.ConsulConfig.VerifySSL != nil && *config.ConsulConfig.VerifySSL
			conf.Consul.SSL = &ctconf.SSLConfig{
				Enabled: new(true),
				Verify:  &verify,
				Cert:    &config.ConsulConfig.CertFile,
				Key:     &config.ConsulConfig.KeyFile,
				CaCert:  &config.ConsulConfig.CAFile,
			}
		}

		if config.ConsulConfig.Auth != "" {
			parts := strings.SplitN(config.ConsulConfig.Auth, ":", 2)
			if len(parts) != 2 {
				return nil, fmt.Errorf("Failed to parse Consul Auth config")
			}

			conf.Consul.Auth = &ctconf.AuthConfig{
				Enabled:  new(true),
				Username: &parts[0],
				Password: &parts[1],
			}
		}

		// Set the user-specified Consul RetryConfig
		if cc.TemplateConfig.ConsulRetry != nil {
			var err error
			err = cc.TemplateConfig.ConsulRetry.Validate()
			if err != nil {
				return nil, err
			}
			conf.Consul.Retry, err = cc.TemplateConfig.ConsulRetry.ToConsulTemplate()
			if err != nil {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Correct the consul Auth setting in the Nomad agent client config (expected "user:pass" form)
  2. Check that CertFile/KeyFile/CAFile referenced by the SSL config exist and are readable
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at client/allocrunner/taskrunner/template/template.go:935 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/3106d992239920cc. Report an issue: GitHub.