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

service_registration.consul: error running service registration: redirect address must not be empty #8634

Closed
gites opened this issue Mar 30, 2020 · 2 comments · Fixed by #8976

Comments

@gites
Copy link
Contributor

gites commented Mar 30, 2020

Describe the bug

Service Registration feature is failing with a message: [ERROR] service_registration.consul: error running service registration: redirect address must not be empty.
I tried to add redirect_addr = "https://10.48.0.51:8200" and/or service_address = "https://10.48.0.51:8200" to the service_registration section, but that didn't help.

Vault startup log below:

Mar 30 12:58:48 vault-2 vault[30905]: ==> Vault server configuration:
Mar 30 12:58:48 vault-2 vault[30905]:              Api Address: https://10.48.0.51:8200
Mar 30 12:58:48 vault-2 vault[30905]:                      Cgo: disabled
Mar 30 12:58:48 vault-2 vault[30905]:          Cluster Address: https://10.48.0.51:8201
Mar 30 12:58:48 vault-2 vault[30905]:               Listener: tcp (addr: "0.0.0.0:8200", cluster address: "0.0.0.0:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls: "enabled")
Mar 30 12:58:48 vault-2 vault[30905]:                Log Level: info
Mar 30 12:58:48 vault-2 vault[30905]:                    Mlock: supported: true, enabled: false
Mar 30 12:58:48 vault-2 vault[30905]:            Recovery Mode: false
Mar 30 12:58:48 vault-2 vault[30905]:                  Storage: gcs (HA available)
Mar 30 12:58:48 vault-2 vault[30905]:                  Version: Vault v1.4.0-rc1
Mar 30 12:58:48 vault-2 vault[30905]: ==> Vault server started! Log data will stream in below:
Mar 30 12:58:48 vault-2 vault[30905]: 2020-03-30T12:58:48.423Z [INFO]  proxy environment: http_proxy= https_proxy= no_proxy=
Mar 30 12:58:48 vault-2 vault[30905]: 2020-03-30T12:58:48.612Z [ERROR] service_registration.consul: error running service registration: redirect address must not be empty

To Reproduce
Steps to reproduce the behavior:

  1. Use not consul based storage (GCS in my case)
  2. Add service_registration stanza
  3. Vault can't register itself to Consul cluster.

Expected behavior

  1. Vault can register itself to the Consul cluster.

Environment:

  • Vault Server Version (retrieve with vault status): 1.4.0-rc1
  • Vault CLI Version (retrieve with vault version): 1.4.0-rc1
  • Server Operating System/Architecture:
    Linux vault-2 4.15.0-1055-gcp #59-Ubuntu SMP Tue Feb 11 21:10:17 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    Vault server configuration file(s):
ui = true
disable_mlock = true
disable_cache = false
plugin_directory = "/usr/local/bin"
storage "gcs" {
  bucket       = "vault-bucket"
  max_parallel = "4096"
  ha_enabled   = "true"
}
service_registration "consul" {
  address = "127.0.0.1:8500"
  scheme = "http"
}
telemetry {
  prometheus_retention_time = "5m"
  disable_hostname = true
}
listener "tcp" {
  address = "0.0.0.0:8200"
  tls_cert_file = "/tls/vault.pem"
  tls_key_file = "/tls/vault.key"
  tls_client_ca_file = "/tls/ca-pem"
  telemetry {
    unauthenticated_metrics_access = true
  }
}
@tyrannosaurus-becks
Copy link
Contributor

Hi! Thanks for opening this issue and for providing such clear steps to reproduce it.

I was able to reproduce it locally. I found that I can resolve it by adding a line like the following to my config:

api_addr = "http://127.0.0.1:8200"

That's this parameter located here.

Does that resolve the issue for you?

@gites
Copy link
Contributor Author

gites commented Mar 31, 2020

@tyrannosaurus-becks Setting the api_addr solved my issue. Thanks!

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

Successfully merging a pull request may close this issue.

3 participants