Skip to content
This repository was 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

@absta

Description

@absta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions