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: exeucte_job_plan API,全局变量-主机传入空的主机列表,报系统内部错误 #2123

Closed
wangyu096 opened this issue Jun 12, 2023 · 1 comment
Assignees
Labels
done 已上线到正式环境并验收通过 for test 可以在测试环境进行验收 kind/bug 程序故障Bug,漏洞

Comments

@wangyu096
Copy link
Collaborator

Version / Branch / tag

3.7.x

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

exeucte_job_plan API,全局变量-主机传入空的主机列表,报系统内部错误

[2023-06-12 15:54:28.303] ERROR [job-execute,6e0865f60abf5735e7c43c019f3e4094,d799f78d616dc9b9] 26969 --- [http-nio-10502-exec-112] b.j.c.w.e.h.EsbExceptionControllerAdvice : Handle exception

java.lang.NullPointerException: null
	at com.tencent.bk.job.execute.service.impl.TaskExecuteServiceImpl.lambda$extractHosts$26(TaskExecuteServiceImpl.java:1102)
	at java.util.HashMap$Values.forEach(HashMap.java:981)
	at com.tencent.bk.job.execute.service.impl.TaskExecuteServiceImpl.extractHosts(TaskExecuteServiceImpl.java:1100)
	at com.tencent.bk.job.execute.service.impl.TaskExecuteServiceImpl.acquireAndSetHosts(TaskExecuteServiceImpl.java:683)
	at com.tencent.bk.job.execute.service.impl.TaskExecuteServiceImpl.executeJobPlan(TaskExecuteServiceImpl.java:1223)
	at com.tencent.bk.job.execute.api.esb.v3.EsbExecuteJobPlanV3ResourceImpl.executeJobPlan(EsbExecuteJobPlanV3ResourceImpl.java:105)
	at com.tencent.bk.job.execute.api.esb.v3.EsbExecuteJobPlanV3ResourceImpl$$FastClassBySpringCGLIB$$4834dbc6.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.esb.metrics.EsbApiTimedAspect.processWithTimer(EsbApiTimedAspect.java:92)
	at com.tencent.bk.job.common.esb.metrics.EsbApiTimedAspect.timedMethod(EsbApiTimedAspect.java:83)
	at sun.reflect.GeneratedMethodAccessor338.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

如何复现?(How to reproduce?)

见问题描述

预期结果(What you expect?)
传入空的主机列表,如果这个全局变量本身没有被执行方案引用,那么不需要报错

@wangyu096 wangyu096 added kind/bug 程序故障Bug,漏洞 backlog 需求初始状态,等待产品进行评估 labels Jun 12, 2023
@wangyu096 wangyu096 self-assigned this Jun 12, 2023
@wangyu096
Copy link
Collaborator Author

问题分析:处理没有主机列表的全局变量-主机类型空指针报错,需要添加前置验证

wangyu096 added a commit that referenced this issue Jun 12, 2023
fix: exeucte_job_plan API,全局变量-主机传入空的主机列表,报系统内部错误 #2123
@wangyu096 wangyu096 added the todo 进入开发排期的状态,纳入了最近的迭代 label Jun 13, 2023
@bkjob-bot bkjob-bot added for test 可以在测试环境进行验收 for gray 可以在灰度环境/预发布环境验收 done 已上线到正式环境并验收通过 and removed backlog 需求初始状态,等待产品进行评估 todo 进入开发排期的状态,纳入了最近的迭代 for test 可以在测试环境进行验收 for gray 可以在灰度环境/预发布环境验收 labels Jun 15, 2023
@bkjob-bot bkjob-bot added the for test 可以在测试环境进行验收 label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done 已上线到正式环境并验收通过 for test 可以在测试环境进行验收 kind/bug 程序故障Bug,漏洞
Projects
None yet
Development

No branches or pull requests

2 participants