Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

HELP!! "Error parsing listener configuration" and "Error initializing listener of type tcp: listen tcp4 0.0.0.0:3201: bind: address already in use" #332

Open
absta opened this issue Apr 15, 2023 · 0 comments

Comments

@absta
Copy link

absta commented Apr 15, 2023

Hi, I've been tearing my hair out trying to figure why I keep getting these errors.

The odd this is, if I use the same configuration and pass it in via the command line using VAULT_LOCAL_CONFIG then everything works!

NOTE: This is without having a config.hcl file in /vault/config

This is an example of me passing in the config
docker run --cap-add=IPC_LOCK -e 'VAULT_LOCAL_CONFIG={"storage":{"postgresql":{"connection_url":"postgres://vault:[email protected]:5432/hc-vault?sslmode=disable"}}, "listener": [{"tcp": { "address": "0.0.0.0:8200", "tls_cert_file": "/vault/config/certs/vault.crt", "tls_key_file": "/vault/config/certs/vault.key"}}], "default_lease_ttl": "168h", "max_lease_ttl": "720h", "ui": true}' --network acuk-net --name vault-server -v ~/vault/config:/vault/config -p 8200:8200 hashicorp/vault server

This gives the following output
image

However, if I try to spin up the container using the following config file

storage "postgresql" {
  connection_url = "postgres://vault:[email protected]:5432/hc-vault?sslmode=disable"
}

listener "tcp" {
  address = "0.0.0.0:8200"
  tls_disable = 0
  tls_cert_file = "/vault/config/certs/vault.crt"
  tls_key_file  = "/vault/config/certs/vault.key"
}
api_addr = "https://vault.sbx.local:3200"
ui = true

using the following docker run command
`docker run --cap-add=IPC_LOCK -p 8200:8200 -v ~/vault/config:/vault/config --network acuk-net --name vault-server hashicorp/vault server -config=/vault/config/config.hcl

I get this????
image

Can't figure out what I'm doing wrong!!

It's defo not a port issue, because the first method of spinning up the container works just fine...

The super weird thing is, if I use the config file (above) this way, it works!!
docker run --cap-add=IPC_LOCK -e 'VAULT_LOCAL_CONFIG={"default_lease_ttl": "168h", "max_lease_ttl": "720h", "ui": true}' --network acuk-net --name vault-server -v ~/vault/config:/vault/config -p 8200:8200 hashicorp/vault server

image

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

No branches or pull requests

1 participant