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

Vault can't to register in consul cluster as a service #19818

Closed
melmus opened this issue Mar 29, 2023 · 5 comments
Closed

Vault can't to register in consul cluster as a service #19818

melmus opened this issue Mar 29, 2023 · 5 comments
Assignees
Labels

Comments

@melmus
Copy link
Contributor

melmus commented Mar 29, 2023

Describe the bug
Hi!
I sets vault HA cluster.
For storage i use consul cluster.
I have a problem: Vault can't to registry in consul cluster as a service

To Reproduce
Steps to reproduce the behavior:

  1. Run vault
  2. See error:
[ERROR] service_registration.consul: error running service registration: failed to find a host:port in redirect address "": missing port in address 

Environment:

  • Vault Server Version (retrieve with vault status): 1.12.4
  • Consul Server Version (retrieve with vault version): 1.14.2
  • Server Operating System/Architecture: Ubuntu 20, Vault and Consul use in Docker

Vault server configuration file(s):

ui = true
disable_mlock = true
api_addr = "localhost:8200"
cluster_name = "my_cluster"
log_level = "trace"
 
 
storage "consul" {
address = "localhost:8500"
path = "vault/"
token = "token_for_my_consul"
}
 
service_registration "consul" {
address = "localhost:8500"
service_address = "localhost:8200"
}
 
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "0.0.0.0:8201
tls_disable = "true"
}

Additional context

/ # vault status
Key             Value
---             -----
Seal Type       shamir
Initialized     true
Sealed          false
Total Shares    1
Threshold       1
Version         1.12.4
Build Date      2023-02-28T21:39:06Z
Storage Type    consul
Cluster Name    my_cluster
Cluster ID      1c4fh19va2-0d82-8yeb-1bf3-y5wep5630p19
HA Enabled      true
HA Cluster      https:8200
HA Mode         active
Active Since    2023-03-29T09:56:28.390154105Z
@linuxoid69
Copy link

I have this problem too

@melmus melmus changed the title Vault can't to registry in consul cluster as a service Vault can't to register in consul cluster as a service Mar 30, 2023
@maxb
Copy link
Contributor

maxb commented Mar 30, 2023

api_addr = "localhost:8200"

This value is expected to be an URL. You are missing the leading http:// so it is being parsed incorrectly.

@melmus
Copy link
Contributor Author

melmus commented Mar 31, 2023

@maxb Tnx, i agree with you, all work. But if i install standalone vault, i don't write scheme (http) in api_addr,

api_addr="localhost:8200"

If I install HA, i write

api_addr="http://localhost:8200"

But this case didn't describe in documentation.

@heatherezell
Copy link
Contributor

@yhyakuna Can we get this addressed in the documentation for clarity? Thanks!

@yhyakuna
Copy link
Contributor

The doc has been updated with a better example. I hope this helps.

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

No branches or pull requests

5 participants