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

Startup without authentication fails with SessionManager has not been registered #705

Closed
M-Whitaker opened this issue Oct 21, 2023 · 1 comment

Comments

@M-Whitaker
Copy link

Describe the bug
When using spring cloud 2023.0.0-M2 and using vault agents I get this stack trace:

config file:

spring.cloud:
    vault:
      scheme: http
      host: localhost
      authentication: none
ava.lang.IllegalStateException: org.springframework.vault.authentication.SessionManager has not been registered
	at org.springframework.boot.DefaultBootstrapContext.lambda$get$1(DefaultBootstrapContext.java:88)
	at org.springframework.boot.DefaultBootstrapContext.getOrElseThrow(DefaultBootstrapContext.java:109)
	at org.springframework.boot.DefaultBootstrapContext.get(DefaultBootstrapContext.java:88)
	at org.springframework.cloud.vault.config.VaultConfigDataLoader.lambda$registerSecretLeaseContainer$10(VaultConfigDataLoader.java:255)
	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 org.springframework.cloud.vault.config.VaultConfigDataLoader.lambda$loadConfigData$1(VaultConfigDataLoader.java:162)
	at org.springframework.cloud.vault.config.VaultConfigDataLoader.createConfigData(VaultConfigDataLoader.java:231)
	at org.springframework.cloud.vault.config.VaultConfigDataLoader.loadConfigData(VaultConfigDataLoader.java:162)
	at org.springframework.cloud.vault.config.VaultConfigDataLoader.load(VaultConfigDataLoader.java:139)
	at org.springframework.cloud.vault.config.VaultConfigDataLoader.load(VaultConfigDataLoader.java:92)
	at org.springframework.boot.context.config.ConfigDataLoaders.load(ConfigDataLoaders.java:96)
	at org.springframework.boot.context.config.ConfigDataImporter.load(ConfigDataImporter.java:132)
	at org.springframework.boot.context.config.ConfigDataImporter.resolveAndLoad(ConfigDataImporter.java:87)
	at org.springframework.boot.context.config.ConfigDataEnvironmentContributors.withProcessedImports(ConfigDataEnvironmentContributors.java:115)
	at org.springframework.boot.context.config.ConfigDataEnvironment.processWithProfiles(ConfigDataEnvironment.java:313)
	at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:234)
	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:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:149)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:137)
	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:365)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:317)

This isn't happening in spring cloud 2022 & from my understand the org.springframework.vault.authentication.SessionManager is not required when no auth needed

@mp911de
Copy link
Member

mp911de commented Oct 23, 2023

Thanks a lot for bringing this to our attention. We added a dependency to SecretLeaseContainer to listen for authentication events. We need to fix this.

@mp911de mp911de changed the title SessionManager has not been registered vault v4.1.0-M2 Startup without authentication fails with SessionManager has not been registered Oct 23, 2023
@mp911de mp911de added this to the 4.1.0-RC1 milestone Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants