Failure to load spring.cloud.vault.token when running with spring boot 2.3+
See original GitHub issueDescribe the bug
When starting up, spring throws an exception java.lang.IllegalArgumentException: Token (spring.cloud.vault.token) must not be empty
. This is with a hard-coded token. I also tried setting it with a system property directly.
Debugging shows that the appropriate setter for the token field in org.springframework.cloud.vault.config.VaultProperties
is never called.
The issue is present in spring boot 2.3 and 2.4. It works with spring boot 2.2.
Sample Create a simple spring boot app with spring initializr or similar with 2.3+. The exception will be thrown.
Here is my bootstrap.yaml (redacted, of course):
spring:
application:
name: myApp
cloud:
vault:
uri: https://vault.sample.url
authentication: token
token: 'abcd.1234'
kv:
enabled: true
application-name: myApp
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:8 (4 by maintainers)
Top Results From Across the Web
java.lang.IllegalArgumentException: Token (spring.cloud.vault ...
Caused by: java.lang.IllegalArgumentException: Token (spring.cloud.vault.token) must not be empty - Hashicorp Vault ... I'm following Vault ...
Read more >Spring Cloud Vault
If you want to run Spring Cloud Vault using this quickstart guide you need to configure ... Store the Vault token in the...
Read more >Secure Secrets using Spring Cloud Config + Vault Example
Hashicorp Vault is a platform to secure, store, and tightly control access to tokens, passwords, certificates, encryption keys for protecting sensitive data and ......
Read more >spring-cloud/spring-cloud - Gitter
... 30332 --- [ main] o.s.boot.SpringApplication : Application run failed java.lang. ... Any gotcha's to get spring boot to load config from k8s...
Read more >Read a secret from Azure Key Vault in a Spring Boot application
In this tutorial, you create a Spring Boot app that reads a value ... and run a Spring Boot web application with key...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With Spring Cloud Vault 3.0, we’ve moved away from the bootstrap context. The bootstrap context is deprecated and requires opt-in. Please define your properties in the
application.(properties|yaml)
file instead.Closing due to lack of activity. If you would like us to look at this issue, please provide additional information and we will re-open the issue.