You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I'm having problems with my spring boot application using gcp secret manager. Found this comment on a closed issue #1628 where the author was asked to create a new issue on it, but I didn't find any issues created. I'm having the same issues as the original poster with spring boot 3.1.0 and secret manager 4.3.1.
From the above 1. and 2. are returning '//test_secret' and not the value of the secret.
3. Is returning properly the value of the secret.
Based on this thread I tried putting 'spring.config.import=sm://' in my application.properties file, but this is breaking my application:
00:22:41.905 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.RuntimeException: Failed to create the Secret Manager Client for ConfigData loading.
at com.google.cloud.spring.autoconfigure.secretmanager.SecretManagerConfigDataLocationResolver.createSecretManagerClient(SecretManagerConfigDataLocationResolver.java:124)
at com.google.cloud.spring.autoconfigure.secretmanager.SecretManagerConfigDataLocationResolver.lambda$registerSecretManagerBeans$0(SecretManagerConfigDataLocationResolver.java:75)
at org.springframework.boot.BootstrapRegistry$InstanceSupplier.lambda$from$1(BootstrapRegistry.java:160)
at org.springframework.boot.DefaultBootstrapContext.getInstance(DefaultBootstrapContext.java:119)
at org.springframework.boot.DefaultBootstrapContext.getOrElseThrow(DefaultBootstrapContext.java:111)
at org.springframework.boot.DefaultBootstrapContext.get(DefaultBootstrapContext.java:88)
at com.google.cloud.spring.autoconfigure.secretmanager.SecretManagerConfigDataLocationResolver.createSecretManagerTemplate(SecretManagerConfigDataLocationResolver.java:132)
at com.google.cloud.spring.autoconfigure.secretmanager.SecretManagerConfigDataLocationResolver.registerSecretManagerBeans(SecretManagerConfigDataLocationResolver.java:85)
at com.google.cloud.spring.autoconfigure.secretmanager.SecretManagerConfigDataLocationResolver.resolve(SecretManagerConfigDataLocationResolver.java:60)
at org.springframework.boot.context.config.ConfigDataLocationResolvers.lambda$resolve$1(ConfigDataLocationResolvers.java:102)
at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:113)
at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:102)
at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:94)
at org.springframework.boot.context.config.ConfigDataImporter.resolve(ConfigDataImporter.java:105)
at org.springframework.boot.context.config.ConfigDataImporter.resolve(ConfigDataImporter.java:97)
at org.springframework.boot.context.config.ConfigDataImporter.resolveAndLoad(ConfigDataImporter.java:85)
at org.springframework.boot.context.config.ConfigDataEnvironmentContributors.withProcessedImports(ConfigDataEnvironmentContributors.java:115)
at org.springframework.boot.context.config.ConfigDataEnvironment.processInitial(ConfigDataEnvironment.java:242)
at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:229)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:352)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291)
at
Hi there, I'm having problems with my spring boot application using gcp secret manager. Found this comment on a closed issue #1628 where the author was asked to create a new issue on it, but I didn't find any issues created. I'm having the same issues as the original poster with spring boot 3.1.0 and secret manager 4.3.1.
Here is the original comment:
Originally posted by @Topchiisky in #1628 (comment)
Hi there, i have similar problem and i am curious what i am doing wrong.
Here is my setup...
In the pom.xml i have the following
In the application.properties I have added a property like so: my.app.secret=${sm://test_secret}.
Now in the code i tried a couple of things:
@value("${sm://test_secret}")
private String secret;
System.out.println(env.getProperty("my.app.secret"));
@Autowired
private SecretManagerTemplate secretManagerTemplate;
secretManagerTemplate.getSecretString("test_secret");
From the above 1. and 2. are returning '//test_secret' and not the value of the secret.
3. Is returning properly the value of the secret.
Based on this thread I tried putting 'spring.config.import=sm://' in my application.properties file, but this is breaking my application:
Originally posted by @Topchiisky in #1628 (comment)
The text was updated successfully, but these errors were encountered: