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: 权限中心回调作业平台API 请求脚本列表报错 #2540

Closed
wangyu096 opened this issue Oct 23, 2023 · 1 comment
Closed

fix: 权限中心回调作业平台API 请求脚本列表报错 #2540

wangyu096 opened this issue Oct 23, 2023 · 1 comment
Assignees
Labels
done 已上线到正式环境并验收通过 kind/bug 程序故障Bug,漏洞

Comments

@wangyu096
Copy link
Collaborator

wangyu096 commented Oct 23, 2023

Version / Branch / tag

3.8.3

出了什么问题?(What Happened?)

权限中心回调作业平台API 请求脚本列表报错。错误日志:

[2023-10-23 19:42:43.457] ERROR [job-manage,34ab480b5d50b0571900805004d328ba,e666b069d4a3419a] 31528 --- [http-nio-10505-exec-43] e.h.IamCallbackExceptionControllerAdvice : Handle Throwable

java.lang.reflect.UndeclaredThrowableException: null
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:780)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
	at com.tencent.bk.job.manage.api.iam.impl.IamScriptCallbackResourceImpl$$EnhancerBySpringCGLIB$$6bfe4e89.callback(<generated>)
	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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.cloud.sleuth.instrument.web.servlet.TracingFilter.doFilter(TracingFilter.java:68)
	at org.springframework.cloud.sleuth.autoconfig.instrument.web.TraceWebServletConfiguration$LazyTracingFilter.doFilter(TraceWebServletConfiguration.java:131)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.springframework.cloud.sleuth.instrument.web.tomcat.TraceValve.invoke(TraceValve.java:103)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Fail to execute logBeforeProcessCallbackRequest
	at com.tencent.bk.job.common.iam.aspect.IamCallbackAspect.logBeforeProcessCallbackRequest(IamCallbackAspect.java:48)
	at sun.reflect.GeneratedMethodAccessor1524.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
	... 70 common frames omitted
Caused by: com.tencent.bk.job.common.exception.InternalException: Tag is not exist
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl.lambda$checkTags$3(TagServiceImpl.java:297)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl.checkTags(TagServiceImpl.java:295)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl.setTags(TagServiceImpl.java:329)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl.listResourceTagsByResourceTypeAndResourceIds(TagServiceImpl.java:317)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl$$FastClassBySpringCGLIB$$50918ce7.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl$$EnhancerBySpringCGLIB$$cd5f3ff5.listResourceTagsByResourceTypeAndResourceIds(<generated>)
	at com.tencent.bk.job.manage.service.impl.ScriptManagerImpl.setTags(ScriptManagerImpl.java:216)
	at com.tencent.bk.job.manage.service.impl.ScriptManagerImpl.listPageScript(ScriptManagerImpl.java:255)
	at com.tencent.bk.job.manage.service.impl.ScriptManagerImpl$$FastClassBySpringCGLIB$$4ab94bb6.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386)
	at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:704)
	at com.tencent.bk.job.manage.service.impl.ScriptManagerImpl$$EnhancerBySpringCGLIB$$2de6e7fa.listPageScript(<generated>)
	at com.tencent.bk.job.manage.service.impl.ScriptServiceImpl.listPageScript(ScriptServiceImpl.java:74)
	at com.tencent.bk.job.manage.service.impl.ScriptServiceImpl$$FastClassBySpringCGLIB$$d5713ebe.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
	at com.tencent.bk.job.manage.service.impl.ScriptServiceImpl$$EnhancerBySpringCGLIB$$e72e4cd2.listPageScript(<generated>)
	at com.tencent.bk.job.manage.api.iam.impl.ScriptCallbackHelper.listInstanceResp(ScriptCallbackHelper.java:39)
	at com.tencent.bk.job.common.iam.service.BaseIamCallbackService.baseCallback(BaseIamCallbackService.java:116)
	at com.tencent.bk.job.manage.api.iam.impl.ScriptCallbackHelper.doCallback(ScriptCallbackHelper.java:69)
	at com.tencent.bk.job.manage.api.iam.impl.IamScriptCallbackResourceImpl.callback(IamScriptCallbackResourceImpl.java:46)
	at com.tencent.bk.job.manage.api.iam.impl.IamScriptCallbackResourceImpl$$FastClassBySpringCGLIB$$11d9ce9b.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
	at com.tencent.bk.job.common.iam.aspect.IamCallbackAspect.logBeforeProcessCallbackRequest(IamCallbackAspect.java:46)
	... 78 common frames omitted

@wangyu096 wangyu096 added kind/bug 程序故障Bug,漏洞 backlog 需求初始状态,等待产品进行评估 todo 进入开发排期的状态,纳入了最近的迭代 labels Oct 23, 2023
@wangyu096 wangyu096 self-assigned this Oct 23, 2023
@wangyu096
Copy link
Collaborator Author

wangyu096 commented Oct 23, 2023

bug 分析:

  1. 请求脚本列表传入条件错误,没有包含业务 ID
  2. 错误的查询条件,检索到了错误的脚本列表,导致在检查脚本标签的时候报错 “Caused by: com.tencent.bk.job.common.exception.InternalException: Tag is not exist”

jsonwan added a commit that referenced this issue Oct 24, 2023
fix: 权限中心回调作业平台API 请求脚本列表报错 #2540
@bkjob-bot bkjob-bot added for test 可以在测试环境进行验收 and removed backlog 需求初始状态,等待产品进行评估 todo 进入开发排期的状态,纳入了最近的迭代 labels Oct 24, 2023
@bkjob-bot bkjob-bot added for gray 可以在灰度环境/预发布环境验收 done 已上线到正式环境并验收通过 and removed for test 可以在测试环境进行验收 for gray 可以在灰度环境/预发布环境验收 labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done 已上线到正式环境并验收通过 kind/bug 程序故障Bug,漏洞
Projects
None yet
Development

No branches or pull requests

2 participants