一、该问题的重现步骤是什么?
1. desk 服务接口报错后,控制台持续输出打印 [401 Unauthorized] during [POST] to [http://blade-log/log/saveErrorLog] 错误
2. log 服务也持续输出打印 签名认证失败,请求接口:/log/saveErrorLog,请求IP:192.168.0.106,请求参数:{}
3.
二、你期待的结果是什么?实际看到的又是什么?
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
spring cloud 4.0 win10
四、请提供详细的错误堆栈信息,这很重要。
2024-04-07 15:02:35.206 ERROR 9852 --- [sync-scheduler3] o.s.c.b.c.BladeExecutorConfiguration : Unexpected exception occurred invoking async method: public void org.springblade.core.log.event.ErrorLogListener.saveErrorLog(org.springblade.core.log.event.ErrorLogEvent)
feign.FeignException$Unauthorized: [401 Unauthorized] during [POST] to [http://blade-log/log/saveErrorLog] [ILogClient#saveErrorLog(LogError)]: []
at feign.FeignException.clientErrorStatus(FeignException.java:224)
at feign.FeignException.errorStatus(FeignException.java:203)
at feign.FeignException.errorStatus(FeignException.java:194)
at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:103)
at feign.InvocationContext.decodeError(InvocationContext.java:126)
at feign.InvocationContext.proceed(InvocationContext.java:72)
at feign.ResponseHandler.handleResponse(ResponseHandler.java:63)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:114)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:70)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:99)
at org.springframework.cloud.openfeign.FeignCachingInvocationHandlerFactory$1.proceed(FeignCachingInvocationHandlerFactory.java:66)
at org.springframework.cache.interceptor.CacheInterceptor.lambda$invoke$0(CacheInterceptor.java:64)
at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:416)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:401)
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:74)
at org.springframework.cloud.openfeign.FeignCachingInvocationHandlerFactory.lambda$create$1(FeignCachingInvocationHandlerFactory.java:53)
at jdk.proxy2/jdk.proxy2.$Proxy191.saveErrorLog(Unknown Source)
at org.springblade.core.log.event.ErrorLogListener.saveErrorLog(ErrorLogListener.java:63)
at jdk.internal.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:351)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at org.springblade.core.log.aspect.LogTraceAspect.around(LogTraceAspect.java:50)
at jdk.internal.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:173)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:113)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at org.springblade.core.context.BladeRunnableWrapper.run(BladeRunnableWrapper.java:63)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
五、若有更多详细信息,请在下面提供。
问题已修复:https://center.javablade.com/blade/BladeX-Tool/commit/c1e81753142304110b86813bd65da5e8c7ad2b5c
删除本地.m2仓库bladex的依赖重新下载,或者下载BladeX-Tool本地install构建依赖再试试
更新依赖后上述问题已经解决
但是接口报错后还是无法存储到log表,控制台输出
2024-04-08 09:40:21.153 ERROR 15972 --- [sync-scheduler2] o.s.core.log.event.ErrorLogListener : 保存错误日志时发生异常
feign.FeignException$NotFound: [404 Not Found] during [POST] to [http://blade-log/feign/client/log/saveErrorLog] [ILogClient#saveErrorLog(LogError)]: [{"code":404,"success":false,"data":{},"msg":"No endpoint POST /feign/client/log/saveErrorLog."}]
log 服务控制台打印:
2024-04-08 09:43:24.356 WARN 18372 --- [ XNIO-1 task-2] o.s.web.servlet.PageNotFound : No mapping for POST /feign/client/log/saveErrorLog
2024-04-08 09:43:24.356 ERROR 18372 --- [ XNIO-1 task-2] o.s.c.log.error.RestExceptionTranslator : 404没找到请求:No endpoint POST /feign/client/log/saveErrorLog.
如何在报错的情况下存储报错信息到log表,没有更新4.0代码前log表都有数据
你上一个帖子也有一个commit要看,是修改了错误日志 feign的路径,看你现在的报错是404,找不到错误日志新的路径,自然就没法调用方法入库了.
看下你的最新代码是否有这个,如果有的话再看下本地依赖有没有刷新对
扫一扫访问 Blade技术社区 移动端