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: 粘贴从其他业务复制的标签,导致公共脚本列表页面报错 #2183

Closed
wangyu096 opened this issue Jul 4, 2023 · 3 comments
Assignees
Labels
done 已上线到正式环境并验收通过 for test 可以在测试环境进行验收 kind/bug 程序故障Bug,漏洞 tested 已经在测试环境测试通过 testing 正在测试验收中

Comments

@wangyu096
Copy link
Collaborator

wangyu096 commented Jul 4, 2023

Version / Branch / tag
3.4.x-3.7.x

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

  • 问题描述
    A 业务复制标签,粘贴到 B 业务公共脚本,导致B 业务加载公共脚本列表页面报错
image
  • 异常信息
2023-07-04 10:09:55.953 ERROR [,c29fe0bbd10c5c85,c58c35c933ac6df8] 14 --- [io-19803-exec-7] b.j.c.w.e.h.WebExceptionControllerAdvice : Handle InternalException, uri: /web/public_script/script/list

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:232)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl.checkTags(TagServiceImpl.java:230)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl.setTags(TagServiceImpl.java:264)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl.listResourceTagsByResourceTypeAndResourceIds(TagServiceImpl.java:252)
	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$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
	at com.tencent.bk.job.manage.service.impl.TagServiceImpl$$EnhancerBySpringCGLIB$$5f5a5119.listResourceTagsByResourceTypeAndResourceIds(<generated>)
	at com.tencent.bk.job.manage.service.impl.ScriptServiceImpl.setTags(ScriptServiceImpl.java:215)
	at com.tencent.bk.job.manage.service.impl.ScriptServiceImpl.listPageScript(ScriptServiceImpl.java:254)
	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$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
	at com.tencent.bk.job.manage.service.impl.ScriptServiceImpl$$EnhancerBySpringCGLIB$$726fc4fe.listPageScript(<generated>)
	at com.tencent.bk.job.manage.api.web.impl.WebScriptResourceImpl.listPageScript(WebScriptResourceImpl.java:331)
	at com.tencent.bk.job.manage.api.web.impl.WebPublicScriptResourceImpl.listPageScript(WebPublicScriptResourceImpl.java:98)

异常对应的代码:
image

如何复现?(How to reproduce?)
见问题描述
预期结果(What you expect?)

  1. 使用从其他业务复制的标签,后台保存检测的时候应该报错拦截,避免脏数据存入 db
  2. 优化对标签的容错处理
@wangyu096 wangyu096 added kind/bug 程序故障Bug,漏洞 backlog 需求初始状态,等待产品进行评估 labels Jul 4, 2023
@wangyu096 wangyu096 self-assigned this Jul 4, 2023
@liuliaozhong
Copy link
Collaborator

Hi,关于第2点预期结果,有疑问,优化后,遇到类似脏数据,页面不报错吗

@wangyu096
Copy link
Collaborator Author

Hi,关于第2点预期结果,有疑问,优化后,遇到类似脏数据,页面不报错吗

是的。不要因为一些脏数据导致资源列表没法加载出来

wangyu096 added a commit that referenced this issue Feb 20, 2024
fix: 粘贴从其他业务复制的标签,导致公共脚本列表页面报错 #2183
wangyu096 added a commit that referenced this issue Feb 20, 2024
fix: 粘贴从其他业务复制的标签,导致公共脚本列表页面报错 #2183
@bkjob-bot bkjob-bot added done 已上线到正式环境并验收通过 and removed backlog 需求初始状态,等待产品进行评估 labels Feb 27, 2024
@bkjob-bot bkjob-bot added the for test 可以在测试环境进行验收 label Apr 10, 2024
@fabio-he
Copy link
Collaborator

image

@fabio-he fabio-he added testing 正在测试验收中 tested 已经在测试环境测试通过 labels Apr 15, 2024
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,漏洞 tested 已经在测试环境测试通过 testing 正在测试验收中
Projects
None yet
Development

No branches or pull requests

4 participants