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

Error when creating new secret #13

Open
kemeris2000 opened this issue Feb 21, 2022 · 5 comments
Open

Error when creating new secret #13

kemeris2000 opened this issue Feb 21, 2022 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kemeris2000
Copy link

When creating new secret, I get error "(intermediate value).custom_metadata is undefined". Secret actually has been created, just need to manually refresh netbox page.

image

@mraerino
Copy link
Member

i have a feeling this might be related to the vault API not returning the custom metadata after saving.
what version of vault are you running?

if this still happens would you be able to show the output of the API call that is made on the click on "Save"? you should be able to get it from your browser's devtools.

@mraerino mraerino added bug Something isn't working help wanted Extra attention is needed labels Apr 18, 2022
@zs-gabor
Copy link

I have a similar problem, but the error message is different.
I'm getting this error message

Vault_plugin
:
Vault v1.10.2 (94325865b12662cb72efa3003d6aaa4f5ae57f3a)
Netbox (v3.2.1)

API call for "Save"
Vault_plugin_Save.zip

@corsmith
Copy link

The vault server needs to be at least 1.9 to support custom_metadata. The custom_metadata fields are silently ignored before that. With v1.8.7 on the server, I experienced the exact same error message. When I upgraded to 1.10.4 the error went away.

You can test this from the command line using:

vault kv metadata delete secret/test-secret
vault kv metadata put -custom-metadata=foo=abc -custom-metadata=bar=123 secret/test-secret
vault kv metadata get secret/test-secret

The output should have:
custom_metadata map[bar:123 foo:abc]

If not then the vault server needs to be upgraded.

@zs-gabor
Copy link

I solved the problem what I indicated.

In my case, the error was that the vault used KV secrets engine with version 1.
After I converted KV secrets engine version 1 to version 2, the plugin will work without error.

Check KV secrets version:
vault secrets list -detailed

The working result:
secret / kv kv_670cf333 system system false replicated false false map [version: 2] n / a

Upgrading from version 1 to version 2:
https://www.vaultproject.io/docs/secrets/kv/kv-v2#upgrading-from-version-1

@mraerino
Copy link
Member

thanks for digging into it! i might add a note to the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants