redisson / redisson

Redisson - Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava/Reactive API. Over 50 Redis based Java objects and services: Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Spring Cache, Tomcat, Scheduler, JCache API, Hibernate, RPC, local cache ...
https://redisson.pro
Apache License 2.0
23k stars 5.3k forks source link

Failed to start bean 'springSessionRedisMessageListenerContainer'; nested exception is java.lang.IllegalStateException: Subscription registration timeout exceeded. #4320

Closed leshalv closed 7 months ago

leshalv commented 2 years ago

https://github.com/spring-projects/spring-data-redis/issues/2329

leshalv commented 2 years ago

https://github.com/spring-projects/spring-session/issues/2098

leshalv commented 2 years ago

spring boot 2.7 spring data redis 2.7.0

Integrate redisson and start, this error will occur

mrniko commented 2 years ago

It's a Redisson's issue. Please close issues in other projects.

mrniko commented 2 years ago

Fixed. Thanks for report

leshalv commented 2 years ago

When will a version be released?

mrniko commented 2 years ago

It's already has been released.

martin-rohla commented 1 year ago

Hi @mrniko, has this issue been fixed in version 3.17.3? I just added Spring session integration into my project and hit the same exception with Redisson 3.20.0

mrniko commented 1 year ago

@martin-rohla

has this issue been fixed in version 3.17.3?

Yes.

I just added Spring session integration into my project and hit the same exception with Redisson 3.20.0

Did you update spring-data-redis module version to 3.20.0 as well?

martin-rohla commented 1 year ago

@mrniko

Did you update spring-data-redis module version to 3.20.0 as well?

I did, these are the dependencies I am using:

org.redisson:redisson-spring-data-27:3.20.0
org.redisson:redisson:3.20.0
org.springframework.session:spring-session-core:2.7.0
org.springframework.session:spring-session-data-redis:2.7.0
org.springframework.data:spring-data-redis:2.7.7
org.springframework.data:spring-data-commons:2.7.7
org.springframework.data:spring-data-keyvalue:2.7.7

And this is the exception I'm getting when my app is getting started by the container:

2023-03-07 16:45:23,453 ERROR (ServerService Thread Pool -- 84) [org.springframework.web.servlet.DispatcherServlet] [containerId=] Context initialization failed: org.springframework.context.ApplicationContextException: Failed to start bean 'springSessionRedisMessageListenerContainer'; nested exception is java.lang.IllegalStateException: Subscription registration timeout exceeded.
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) [spring-context-5.3.25.jar:5.3.25]
    at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) [spring-context-5.3.25.jar:5.3.25]
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) [spring-context-5.3.25.jar:5.3.25]
    at java.lang.Iterable.forEach(Iterable.java:75) [rt.jar:1.8.0_342]
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) [spring-context-5.3.25.jar:5.3.25]
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) [spring-context-5.3.25.jar:5.3.25]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) [spring-context-5.3.25.jar:5.3.25]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) [spring-context-5.3.25.jar:5.3.25]
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:702) [spring-webmvc-5.3.25.jar:5.3.25]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:668) [spring-webmvc-5.3.25.jar:5.3.25]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:716) [spring-webmvc-5.3.25.jar:5.3.25]
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:591) [spring-webmvc-5.3.25.jar:5.3.25]
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:530) [spring-webmvc-5.3.25.jar:5.3.25]
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:170) [spring-webmvc-5.3.25.jar:5.3.25]
    at javax.servlet.GenericServlet.init(GenericServlet.java:180) [jboss-servlet-api_4.0_spec-2.0.0.Final-redhat-00001.jar:2.0.0.Final-redhat-00001]
    at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
    at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:305) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:585) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:556) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:598) [undertow-servlet-2.0.35.SP1-redhat-00001.jar:2.0.35.SP1-redhat-00001]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:97)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_342]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_342]
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.lang.Thread.run(Thread.java:750) [rt.jar:1.8.0_342]
    at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.IllegalStateException: Subscription registration timeout exceeded.
    at org.springframework.data.redis.listener.RedisMessageListenerContainer.lazyListen(RedisMessageListenerContainer.java:280) [spring-data-redis-2.7.7.jar:2.7.7]
    at org.springframework.data.redis.listener.RedisMessageListenerContainer.start(RedisMessageListenerContainer.java:249) [spring-data-redis-2.7.7.jar:2.7.7]
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) [spring-context-5.3.25.jar:5.3.25]
    ... 39 more
Caused by: java.util.concurrent.TimeoutException
    at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1784) [rt.jar:1.8.0_342]
    at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1928) [rt.jar:1.8.0_342]
    at org.springframework.data.redis.listener.RedisMessageListenerContainer.lazyListen(RedisMessageListenerContainer.java:269) [spring-data-redis-2.7.7.jar:2.7.7]
    ... 41 more
martin-rohla commented 1 year ago

Hi @mrniko , any chance you managed to look into this?

mrniko commented 1 year ago

Hi @martin-rohla. Unable to reproduce. Below is the log output.

2023.04.12 13:47:39.175 INFO  AbstractContextLoader : Could not detect default resource locations for test class [org.redisson.spring.starter.RedissonAutoConfigurationTest]: no resource found for suffixes {-context.xml, Context.groovy}.
2023.04.12 13:47:39.320 INFO  SpringBootTestContextBootstrapper : Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
2023.04.12 13:47:39.331 INFO  SpringBootTestContextBootstrapper : Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@648c94da, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@2a62b5bc, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@53de625d, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@535779e4, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@53fd0d10, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6c0d9d86, org.springframework.test.context.transaction.TransactionalTestExecutionListener@4ce1d6d0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@24111ef1, org.springframework.test.context.event.EventPublishingTestExecutionListener@1f3f02ee, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@1fde5d22, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@5dcb4f5f, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@71812481, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@16ce702d, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@7b94089b, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@7ca20101]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.7.6)

2023.04.12 13:47:39.572 INFO  RedissonAutoConfigurationTest : Starting RedissonAutoConfigurationTest using Java 17.0.3.1 on Computer with PID 3068 (started by root in C:\Devel\projects\redisson\redisson-spring-boot-starter)
2023.04.12 13:47:39.573 INFO  RedissonAutoConfigurationTest : No active profile set, falling back to 1 default profile: "default"
2023.04.12 13:47:40.160 INFO  RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2023.04.12 13:47:40.162 INFO  RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023.04.12 13:47:40.175 INFO  RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 4 ms. Found 0 Redis repository interfaces.
2023.04.12 13:47:41.590 INFO  Version : Redisson 3.20.2.SNAPSHOT
2023.04.12 13:47:41.816 INFO  MasterPubSubConnectionPool : 1 connections initialized for 127.0.0.1/127.0.0.1:6379
2023.04.12 13:47:41.864 INFO  MasterConnectionPool : 24 connections initialized for 127.0.0.1/127.0.0.1:6379
2023.04.12 13:47:42.480 INFO  EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator'
2023.04.12 13:47:42.560 INFO  ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
2023.04.12 13:47:42.577 INFO  RedissonAutoConfigurationTest : Started RedissonAutoConfigurationTest in 3.215 seconds (JVM running for 3.878)

Can you share a sample app to reproduce it?

mrniko commented 7 months ago

Fixed in https://github.com/redisson/redisson/issues/5482