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

safe cannot read numbers from the vault on 0.9.9 #178

Closed
scottillogical opened this issue Nov 27, 2018 · 8 comments
Closed

safe cannot read numbers from the vault on 0.9.9 #178

scottillogical opened this issue Nov 27, 2018 · 8 comments
Assignees

Comments

@scottillogical
Copy link
Contributor

scottillogical commented Nov 27, 2018

safe get secret/path/default
!! json: cannot unmarshal number into Go struct field vaultResponse.data of type string

We're using a dynamodb backed Vault v0.9.6

Reverting to safe 0.9.6 resolves the issue

Is this because we need to upgrade or vault or something or just a bug? I haven't tried with newer vault versions, yet

@thomasmitchell
Copy link
Contributor

Probably a bug. Safe has never really... dealt with non-strings (you can't write one with safe). We were probably converting ints to strings internally when reading them previously, though. And then I probably rolled right over that by accident when I put in vaultkv as the backing library. I'll fix it.

@scottillogical
Copy link
Contributor Author

Yeah the values were not added via safe

@jhunt
Copy link
Contributor

jhunt commented Dec 3, 2018

Can this be closed?

@thomasmitchell
Copy link
Contributor

Nope.

@thomasmitchell thomasmitchell changed the title safe get breaking on 0.9.9 safe cannot read numbers from the vault on 0.9.9 Dec 4, 2018
@Proplex
Copy link

Proplex commented Dec 18, 2018

We just came across this issue with this command:

safe set auth/approle/role/genesis-pipelines secret_id_ttl=90m token_num_uses=0 token_ttl=90m token_max_ttl=90m secret_id_num_uses=0

Executing it results in !! json: cannot unmarshal number into Go value of type string

Rolling back to v0.9.6 returns the intended result (being able to run this command an arbitrary amount of times and have it successfully generate a new approle token)

Tried with both Vault 0.11.5 and Vault 0.9.3, macOS 10.13.6 and Ubuntu Trusty 14.04.5

@thomasmitchell
Copy link
Contributor

Thanks for the extra example. I very much hope to have this fixed for the next release.

@thomasmitchell
Copy link
Contributor

thomasmitchell commented Dec 18, 2018

should be able to read numbers (and booleans and hashes and lists) into strings as of b3bd92f

@scottillogical
Copy link
Contributor Author

I haven't had a chance to test this and haven't had the issue been reported since so I assume this is good to close thank you Thomas

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

No branches or pull requests

4 participants