vault already initialized in dev

4,302 views
Skip to first unread message

John Stafford

unread,
Nov 7, 2016, 7:50:09 PM11/7/16
to Vault
Hi,

I am receiving the error message *vault already initialized

I am new to hashicorp vault and would like to run another init . How do I proceed in dev? I have no real backend.

Armon Dadgar

unread,
Nov 7, 2016, 7:52:19 PM11/7/16
to John Stafford, vault...@googlegroups.com
John,

Vault can only be initialized a single time. Once initialized, it is no longer required,
the proper keys and backend setup have been completed. To redo initialization, you
need to wipe out the data in the physical backend and then initialize from a fresh start.
Vault will not initialize on top of existing data to protect against loss.

Best Regards,
Armon Dadgar
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/4c333b12-baea-45b1-84ff-9c30b1edbde5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Stafford

unread,
Nov 7, 2016, 8:01:51 PM11/7/16
to Vault, john.howar...@gmail.com
Thank you for the quick response Armon. I am struggling using the CLI for vault in windows. How do I wipe out the data in the physical backend for dev? John

Armon Dadgar

unread,
Nov 7, 2016, 8:04:15 PM11/7/16
to John Stafford, vault...@googlegroups.com
Hey John,

Are you using dev mode (meaning “vault server -dev”)? In that case, Vault is initialized on start
automatically, since it only stores data in memory for development, there is no persistent storage.
You can simply exit Vault and start it again, and it will be re-initialized on start.

Only in development mode will Vault initialize itself, in any other mode it requires an explicit
initialization since usually you are not usually a purely ephemeral in-memory backend :)

Hope that helps!

Best Regards,
Armon Dadgar

John Stafford

unread,
Nov 7, 2016, 8:12:50 PM11/7/16
to Vault, john.howar...@gmail.com
Okay Armon. That makes sense. Is there a link you can share for setting up vault with windows cmd with a mysql backend?
Message has been deleted

Armon Dadgar

unread,
Nov 7, 2016, 9:42:18 PM11/7/16
to John Stafford, vault...@googlegroups.com
Hey John,

The error you are getting “The system cannot find the file specified” seems like
the file you are pointing to is not there. Did you write “vault.conf” to the current
working directory?

Best Regards,
Armon Dadgar

On November 7, 2016 at 5:18:11 PM, John Stafford (john.howar...@gmail.com) wrote:

I have been using this https://spring.io/blog/2016/06/24/managing-secrets-with-vault , but with great difficulty.

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

>vault server
At least one config path must be specified with -config
Usage: vault server [options]

  Start a Vault server.

  This command starts a Vault server that responds to API requests.
  Vault will start in a "sealed" state. The Vault must be unsealed
  with "vault unseal" or the API before this server can respond to requests.
  This must be done for every server.

  If the server is being started against a storage backend that has
  brand new (no existing Vault data in it), it must be initialized with
  "vault init" or the API first.


General Options:

  -config=<path>          Path to the configuration file or directory. This can
                          be specified multiple times. If it is a directory,
                          all files with a ".hcl" or ".json" suffix will be
                          loaded.

  -dev                    Enables Dev mode. In this mode, Vault is completely
                          in-memory and unsealed. Do not run the Dev server in
                          production!

  -dev-root-token-id=""   If set, the root token returned in Dev mode will have
                          the given ID. This *only* has an effect when running
                          in Dev mode. Can also be specified with the
                          VAULT_DEV_ROOT_TOKEN_ID environment variable.

  -dev-listen-address=""  If set, this overrides the normal Dev mode listen
                          address of "127.0.0.1:8200". Can also be specified
                          with the VAULT_DEV_LISTEN_ADDRESS environment
                          variable.

  -log-level=info         Log verbosity. Defaults to "info", will be output to
                          stderr. Supported values: "trace", "debug", "info",
                          "warn", "err"

>vault server -config vault.conf
Error loading configuration from vault.conf: GetFileAttributesEx vault.conf: The system cannot find the file specified.

I noticed that some of the commands are linux/unix type, eg. export instead of set. Does the config for vault have a different extension?


Reply all
Reply to author
Forward
0 new messages