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

fix: backend service stop running #1745

Open
cwmine opened this issue May 16, 2024 · 1 comment
Open

fix: backend service stop running #1745

cwmine opened this issue May 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@cwmine
Copy link

cwmine commented May 16, 2024

Describe the bug
docker deploy
After running normally for several weeks, suddenly the backend-service stopped running, after running docker-compose up again, the backend container reported the following error:

To Reproduce
doceker compose docker-compose up -d

2024-05-16 17:45:10.831  INFO [service-api,,] 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@7c551ad4, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@7d5508e0, org.springframework.security.web.context.SecurityContextPersistenceFilter@4a23350, org.springframework.security.web.header.HeaderWriterFilter@112d1c8e, org.springframework.web.filter.CorsFilter@3829ac1, com.apitable.shared.config.security.CsrfBeforeFilter@554cd74a, org.springframework.security.web.csrf.CsrfFilter@2416498e, org.springframework.security.web.session.ConcurrentSessionFilter@4da9f723, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@3e84111a, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6fa69af7, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@37ed010a, org.springframework.security.web.session.SessionManagementFilter@4016ccc1, org.springframework.security.web.access.ExceptionTranslationFilter@6e1b9411, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@5a8cbffe]
2024-05-16 17:45:13.542  INFO [service-api,,] 1 --- [           main] g.s.a.GrpcServerFactoryAutoConfiguration : Detected grpc-netty-shaded: Creating ShadedNettyGrpcServerFactory
2024-05-16 17:45:14.425  INFO [service-api,,] 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2024-05-16 17:45:14.769  INFO [service-api,,] 1 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2024-05-16 17:45:14.770  INFO [service-api,,] 1 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'service-api.errorChannel' has 1 subscriber(s).
2024-05-16 17:45:14.770  INFO [service-api,,] 1 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started bean '_org.springframework.integration.errorLogger'
2024-05-16 17:45:14.798  INFO [service-api,,] 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8081 (http) with context path '/api/v1'
2024-05-16 17:45:15.026  WARN [service-api,,] 1 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'springSessionRedisMessageListenerContainer'; nested exception is org.springframework.data.redis.listener.adapter.RedisListenerExecutionFailedException: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
2024-05-16 17:45:15.027  INFO [service-api,,] 1 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Removing {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2024-05-16 17:45:15.028  INFO [service-api,,] 1 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'service-api.errorChannel' has 0 subscriber(s).
2024-05-16 17:45:15.028  INFO [service-api,,] 1 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : stopped bean '_org.springframework.integration.errorLogger'
2024-05-16 17:45:15.108  INFO [service-api,,] 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2024-05-16 17:45:15.141  INFO [service-api,,] 1 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2024-05-16 17:45:15.173 ERROR [service-api,,] 1 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Failed to start bean 'springSessionRedisMessageListenerContainer'; nested exception is org.springframework.data.redis.listener.adapter.RedisListenerExecutionFailedException: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
        at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
        at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:357)
        at java.lang.Iterable.forEach(Iterable.java:75)
        at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:156)
        at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:124)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at com.apitable.Application.main(Application.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: org.springframework.data.redis.listener.adapter.RedisListenerExecutionFailedException: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
        at org.springframework.data.redis.listener.RedisMessageListenerContainer.lazyListen(RedisMessageListenerContainer.java:275)
        at org.springframework.data.redis.listener.RedisMessageListenerContainer.start(RedisMessageListenerContainer.java:249)
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:179)
        ... 20 common frames omitted
Caused by: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
        at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:292)
        at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:515)
        at org.springframework.data.redis.listener.RedisMessageListenerContainer$Subscriber.initialize(RedisMessageListenerContainer.java:1186)
        at org.springframework.data.redis.listener.RedisMessageListenerContainer.doSubscribe(RedisMessageListenerContainer.java:318)
        at org.springframework.data.redis.listener.RedisMessageListenerContainer.lazyListen(RedisMessageListenerContainer.java:295)
        at org.springframework.data.redis.listener.RedisMessageListenerContainer.lazyListen(RedisMessageListenerContainer.java:265)
        ... 22 common frames omitted
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
        at redis.clients.jedis.util.Pool.getResource(Pool.java:84)
        at redis.clients.jedis.JedisPool.getResource(JedisPool.java:377)
        at redis.clients.jedis.JedisPool.getResource(JedisPool.java:15)
        at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:283)
        ... 27 common frames omitted
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Failed to create socket.
        at redis.clients.jedis.DefaultJedisSocketFactory.createSocket(DefaultJedisSocketFactory.java:110)
        at redis.clients.jedis.Connection.connect(Connection.java:226)
        at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:144)
        at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:314)
        at redis.clients.jedis.BinaryJedis.initializeFromClientConfig(BinaryJedis.java:92)
        at redis.clients.jedis.BinaryJedis.<init>(BinaryJedis.java:297)
        at redis.clients.jedis.Jedis.<init>(Jedis.java:169)
        at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:177)
        at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:571)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:298)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:223)
        at redis.clients.jedis.util.Pool.getResource(Pool.java:75)
        ... 30 common frames omitted
Caused by: java.net.UnknownHostException: redis
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:607)
        at redis.clients.jedis.DefaultJedisSocketFactory.createSocket(DefaultJedisSocketFactory.java:80)
        ... 41 common frames omitted

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Version 1.4.0
  • OS: ubuntu 2204
  • Browser edge

Smartphone (please complete the following information):

  • Version [e.g. v0.20]
  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]

Additional context
Add any other context about the problem here.

@cwmine cwmine added the bug Something isn't working label May 16, 2024
@cwmine cwmine changed the title fix: A brief description of the BUG fix: backend service stop running May 16, 2024
@ChambersChan
Copy link
Collaborator

According to the error message, it is impossible to connect to redis. You can check the status of the redis service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants