halo-dev / halo

强大易用的开源建站工具。
https://www.halo.run
GNU General Public License v3.0
33.28k stars 9.6k forks source link

访问博客页面正常。登陆后台页面,反复提示【当前登录状态已失效,请重新登录】 #2437

Closed tanbenw closed 1 year ago

tanbenw commented 1 year ago

检查清单

是什么版本出现了此问题?

1.5.2

使用的什么数据库?

MySQL 5.7

使用的哪种方式部署?

Docker

在线站点地址

https://ai-tech.inshopline.com/

发生了什么?

博客正常访问 后台登陆后一直提示【当前登录状态已失效,请重新登录】

相关日志输出

2022-09-20 17:40:30.731  INFO 420 --- [main] run.halo.app.Application                 : Starting Application v1.6.0 using Java 17.0.1 on ai-cms-prod-sz-296mz with PID 420 (/data/webapps/ai-cms/ROOT/BOOT-INF/classes started by root in /data/webapps/ai-cms)
2022-09-20 17:40:30.735  INFO 420 --- [main] run.halo.app.Application                 : No active profile set, falling back to 1 default profile: "default"
2022-09-20 17:40:33.346  INFO 420 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2022-09-20 17:40:33.347  INFO 420 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-09-20 17:40:33.928  INFO 420 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 569 ms. Found 24 JPA repository interfaces.
2022-09-20 17:40:36.341  INFO 420 --- [main] org.eclipse.jetty.util.log               : Logging initialized @7618ms to org.eclipse.jetty.util.log.Slf4jLog
2022-09-20 17:40:36.826  INFO 420 --- [main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8090
2022-09-20 17:40:36.833  INFO 420 --- [main] org.eclipse.jetty.server.Server          : jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 17.0.1+12-LTS-39
2022-09-20 17:40:36.864  INFO 420 --- [main] o.e.j.s.h.ContextHandler.application     : Initializing Spring embedded WebApplicationContext
2022-09-20 17:40:36.864  INFO 420 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6022 ms
2022-09-20 17:40:38.151  INFO 420 --- [main] run.halo.app.config.HaloConfiguration    : Halo cache store load impl : [class run.halo.app.cache.InMemoryCacheStore]
2022-09-20 17:40:39.832  INFO 420 --- [main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-09-20 17:40:39.929  INFO 420 --- [main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.33
2022-09-20 17:40:40.028  INFO 420 --- [main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-09-20 17:40:40.230  INFO 420 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2022-09-20 17:40:41.069  INFO 420 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2022-09-20 17:40:41.098  INFO 420 --- [main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect
2022-09-20 17:40:45.520  INFO 420 --- [main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-09-20 17:40:45.528  INFO 420 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-09-20 17:40:47.247  INFO 420 --- [main] org.eclipse.jetty.server.session         : DefaultSessionIdManager workerName=node0
2022-09-20 17:40:47.247  INFO 420 --- [main] org.eclipse.jetty.server.session         : No SessionScavenger set, using defaults
2022-09-20 17:40:47.248  INFO 420 --- [main] org.eclipse.jetty.server.session         : node0 Scavenging every 660000ms
2022-09-20 17:40:47.257  INFO 420 --- [main] o.e.jetty.server.handler.ContextHandler  : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@15045e40{application,/,[file:///tmp/jetty-docbase.8090.7944541219208992517/, jar:file:/data/webapps/ai-cms/ROOT/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE}
2022-09-20 17:40:47.257  INFO 420 --- [main] org.eclipse.jetty.server.Server          : Started @18535ms
2022-09-20 17:40:48.475  INFO 420 --- [main] run.halo.app.handler.file.FileHandlers   : Registered 9 file handler(s)
2022-09-20 17:40:55.245  INFO 420 --- [main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 4 endpoint(s) beneath base path '/api/admin/actuator'
2022-09-20 17:40:55.354  INFO 420 --- [main] o.e.j.s.h.ContextHandler.application     : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-09-20 17:40:55.354  INFO 420 --- [main] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-09-20 17:40:55.356  INFO 420 --- [main] o.s.web.servlet.DispatcherServlet        : Completed initialization in 2 ms
2022-09-20 17:40:55.366  INFO 420 --- [main] o.e.jetty.server.AbstractConnector       : Started ServerConnector@7364f68{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
2022-09-20 17:40:55.367  INFO 420 --- [main] o.s.b.web.embedded.jetty.JettyWebServer  : Jetty started on port(s) 8090 (http/1.1) with context path '/'
2022-09-20 17:40:55.523  INFO 420 --- [main] run.halo.app.Application                 : Started Application in 25.972 seconds (JVM running for 26.801)
2022-09-20 17:40:55.524  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Starting migrate database...
2022-09-20 17:40:56.131  INFO 420 --- [main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 7.15.0 by Redgate
2022-09-20 17:40:56.132  INFO 420 --- [main] o.f.c.i.database.base.BaseDatabaseType   : Database: jdbc:mysql://10.86.39.164:6308/ai_platform (MySQL 5.7)
2022-09-20 17:40:56.985  INFO 420 --- [main] o.f.c.i.s.JdbcTableSchemaHistory         : Repair of failed migration in Schema History table `ai_platform`.`flyway_schema_history` not necessary. No failed migration detected.
2022-09-20 17:40:57.268  INFO 420 --- [main] o.f.core.internal.command.DbRepair       : Successfully repaired schema history table `ai_platform`.`flyway_schema_history` (execution time 00:00.679s).
2022-09-20 17:40:58.055  INFO 420 --- [main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 7.15.0 by Redgate
2022-09-20 17:40:58.847  INFO 420 --- [main] o.f.core.internal.command.DbValidate     : Successfully validated 6 migrations (execution time 00:00.316s)
2022-09-20 17:40:59.362  INFO 420 --- [main] o.f.core.internal.command.DbMigrate      : Current version of schema `ai_platform`: 6
2022-09-20 17:40:59.402  INFO 420 --- [main] o.f.core.internal.command.DbMigrate      : Schema `ai_platform` is up to date. No migration necessary.
2022-09-20 17:41:00.146  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Migrate database succeed.
2022-09-20 17:41:00.147  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Created backup directory: [/tmp/halo-backup]
2022-09-20 17:41:00.147  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Created data export directory: [/tmp/halo-data-export]
2022-09-20 17:41:00.585  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Copied theme folder from [/data/webapps/ai-cms/ROOT/BOOT-INF/classes/templates/themes] to [/root/.halo/templates/themes/caicai_anatole]
2022-09-20 17:41:00.639  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Halo started at         https://ai-tech.inshopline.com
2022-09-20 17:41:00.640  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Halo admin started at   https://ai-tech.inshopline.com/admin
2022-09-20 17:41:00.640  INFO 420 --- [main] run.halo.app.listener.StartedListener    : Halo has started successfully!
2022-09-20 17:44:53.005  WARN 420 --- [qtp715213542-20] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:44:53.005 ERROR 420 --- [qtp715213542-20] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [a2a0719121f7426abb9a362cbb9fd97f]
2022-09-20 17:44:53.006  WARN 420 --- [qtp715213542-15] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:44:53.006 ERROR 420 --- [qtp715213542-15] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [a2a0719121f7426abb9a362cbb9fd97f]
2022-09-20 17:44:53.006  WARN 420 --- [qtp715213542-19] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:44:53.006 ERROR 420 --- [qtp715213542-19] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [a2a0719121f7426abb9a362cbb9fd97f]
2022-09-20 17:44:57.974  WARN 420 --- [qtp715213542-18] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:44:57.974 ERROR 420 --- [qtp715213542-18] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [未登录,请登录后访问], status: [401 UNAUTHORIZED], data: [null]
2022-09-20 17:45:01.168  WARN 420 --- [qtp715213542-21] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:45:01.169 ERROR 420 --- [qtp715213542-21] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [351111c17caf47da95abab5148c6f07a]
2022-09-20 17:45:01.198 ERROR 420 --- [qtp715213542-16] r.h.app.core.ControllerExceptionHandler  : Captured an exception:

run.halo.app.exception.BadRequestException: 登录状态已失效,请重新登录
    at run.halo.app.service.impl.AdminServiceImpl.lambda$refreshToken$5(AdminServiceImpl.java:276) ~[classes/:1.6.0]
    at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[na:na]
    at run.halo.app.service.impl.AdminServiceImpl.refreshToken(AdminServiceImpl.java:275) ~[classes/:1.6.0]
    at run.halo.app.controller.admin.api.AdminController.refresh(AdminController.java:101) ~[classes/:1.6.0]
    at run.halo.app.controller.admin.api.AdminController$$FastClassBySpringCGLIB$$4785b262.invoke(<generated>) ~[classes/:1.6.0]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.18.jar:5.3.18]
    at run.halo.app.core.ControllerLogAop.controller(ControllerLogAop.java:48) ~[classes/:1.6.0]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.18.jar:5.3.18]
    at run.halo.app.cache.lock.CacheLockInterceptor.interceptCacheLock(CacheLockInterceptor.java:71) ~[classes/:1.6.0]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.18.jar:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.18.jar:5.3.18]
    at run.halo.app.controller.admin.api.AdminController$$EnhancerBySpringCGLIB$$1caea008.refresh(<generated>) ~[classes/:1.6.0]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.18.jar:5.3.18]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) ~[jakarta.servlet-api-4.0.4.jar:4.0.4]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.18.jar:5.3.18]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:584) ~[jakarta.servlet-api-4.0.4.jar:4.0.4]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:230) ~[websocket-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:102) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:102) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:102) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.18.jar:5.3.18]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.18.jar:5.3.18]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at run.halo.app.filter.CorsFilter.doFilter(CorsFilter.java:53) ~[classes/:1.6.0]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) ~[spring-boot-actuator-2.5.12.jar:2.5.12]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.18.jar:5.3.18]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at run.halo.app.filter.LogFilter.doFilterInternal(LogFilter.java:40) ~[classes/:1.6.0]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[jetty-security-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[jetty-servlet-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[jetty-io-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[jetty-io-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[jetty-io-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
    at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

2022-09-20 17:45:38.151  WARN 420 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_public run.halo.app.security.token.AuthToken run.halo.app.controller.admin.api.AdminController.refresh(java.lang.String)] has been expired
2022-09-20 17:45:38.151  WARN 420 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_login_precheck] has been expired
2022-09-20 17:45:49.742  WARN 420 --- [qtp715213542-21] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:45:49.742 ERROR 420 --- [qtp715213542-21] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [未登录,请登录后访问], status: [401 UNAUTHORIZED], data: [null]
2022-09-20 17:45:49.743  WARN 420 --- [qtp715213542-19] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:45:49.743 ERROR 420 --- [qtp715213542-19] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [未登录,请登录后访问], status: [401 UNAUTHORIZED], data: [null]
2022-09-20 17:45:49.746  WARN 420 --- [qtp715213542-16] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [58.248.229.144]
2022-09-20 17:45:49.746 ERROR 420 --- [qtp715213542-16] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [未登录,请登录后访问], status: [401 UNAUTHORIZED], data: [null]
2022-09-20 17:46:38.152  WARN 420 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_public run.halo.app.security.token.AuthToken run.halo.app.controller.admin.api.AdminController.refresh(java.lang.String)] has been expired
2022-09-20 17:46:38.152  WARN 420 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_login_auth] has been expired

附加信息

No response

ruibaby commented 1 year ago

建议检查登录之后是否更新了 token(登录接口返回的内容)。个人判断是因为加了某种缓存,登录接口被缓存了。

ruibaby commented 1 year ago

/kind support

tanbenw commented 1 year ago

这种情况要怎么处理呢

ruibaby commented 1 year ago

这种情况要怎么处理呢

与 Halo 无关,你可以尝试仅用 IP 访问检查是否有问题。这种情况如上所说,建议检查你的前置代理(Nginx)或者是否配置了全站 CDN,而且将后台所请求的接口进行了缓存。

tanbenw commented 1 year ago

用了官网的ng配置还是不行。。登进去后台就是状态失效,我看linux环境下,前端请求接口之前,每次都会调refresh/{token}接口?本地环境就不会,是不是因为这个原因导致每次token 都失效了

ruibaby commented 1 year ago

@13160671810 我还是建议你先使用 IP 先测试一下,先排除是 Halo 本身的问题,目前我们没有成功复现这个问题。

tanbenw commented 1 year ago

@13160671810 我还是建议你先使用 IP 先测试一下,先排除是 Halo 本身的问题,目前我们没有成功复现这个问题。

崩溃了 搞了十几个小时。。。我先用release1.5的代码全量覆盖了我线上的代码,只改了application.yml里面的mysql地址,本地idea运行一切正常,部署到linux,访问admin页面出现如下问题,访问博客页面一切正常 image

JohnNiang commented 1 year ago

基本确认和 Halo 本身无关。

  1. 你在本地运行一切正常
  2. 前台页面正常访问

你可以尝试对比一下服务器上 /admin/index.html 和本地运行后 /admin/index.html 输出是否一致。

如果不一致,那就是上游的缓存问题了,这个需要你自己去排查一下。

tanbenw commented 1 year ago

基本确认和 Halo 本身无关。

  1. 你在本地运行一切正常
  2. 前台页面正常访问

你可以尝试对比一下服务器上 /admin/index.html 和本地运行后 /admin/index.html 输出是否一致。

如果不一致,那就是上游的缓存问题了,这个需要你自己去排查一下。

又回到原来的问题。。。,每次访问后台接口都会报 token已过期,想问下要怎么排查token是否存进去inMermory了?是有什么约束吗? image

JohnNiang commented 1 year ago
  1. 建议开启 debug 模式,并提供详细的日志
  2. 建议提供详细复现的步骤,至少能让大家能够在本地复现以上错误。
tanbenw commented 1 year ago

已解决,我部署了多实例。。。项目默认把token放到map里。。。悲剧了 2天血泪教训。。。by the way 有页面可以直接切到redis存储吗

ruibaby commented 1 year ago

已解决,我部署了多实例。。。项目默认把token放到map里。。。悲剧了 2天血泪教训。。。by the way 有页面可以直接切到redis存储吗

https://docs.halo.run/getting-started/config#%E7%BC%93%E5%AD%98

可能可以解决你的问题,但目前我们没有针对多集群进行测试。