'Unable to connect to Vault Error unsealing: Put "https://127.0.0.1:8200/v1/sys/unseal": dial tcp 127.0.0.1:8200: connect: connection refused

I am unable to connect to value. This is the error log:

default: 
 
 Error! Failed writing data: Put
"http://127.0.0.1:8500/v1/kv/cobalt/cluster/status": dial tcp
 127.0.0.1:8500: connect: connection refused
    default: Checking and intializing vault if needed
    default: Error initializing: Put "https://127.0.0.1:8200/v1/sys/init": dial tcp 127.0.0.1:8200:
 connect: connection refused
   default: Unseal Key (will be hidden):
     default: An error occurred attempting to ask for an unseal key. The raw error message
    default: is shown below, but usually this is because you attempted to pipe a value
   default: into the unseal command or you are executing outside of a terminal (tty). You
   default: should run the unseal command from a terminal for maximum security. If this
    default: is not an option, the unseal key can be provided as the first argument to the
    default: unseal command. The raw error was:  file descriptor 0 is not a terminal

When I tried running echo VAULT_ADDR I am getting this: https://127.0.0.1:8200

Anyone having any clue on why I am not able to connect to vault?



Solution 1:[1]

If you are using any CNI. Check for global network policy.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Amaresh Pattanayak