CodeAnalysis
CodeAnalysis copied to clipboard
在线分析老是编译工具时报错,且很慢,采用客户端分析则无问题
- 麻烦附上报错的执行日志
- 可以对比在线分析和客户端分析的执行日志,对比下二者的耗时点
- 可以通过增加在线节点数量来提升并行能力,避免在线节点任务排队
2023-07-25 11:49:38,391-INFO: start to run task: TCA-Armory-J1, execute_processes: ['compile', 'analyze', 'datahandle'] 2023-07-25 11:49:38,688-INFO: License is valid. 2023-07-25 11:49:38,896-INFO: Load tool config: https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git 2023-07-25 11:49:40,298-INFO: Initing common tools ... 2023-07-25 11:49:40,299-INFO: Initing 3 tools, please wait a minute ...
[Tools init]: 0%| | 0/3 [00:00<?, ?it/s] [Tools init]: 33%|█████████████████ | 1/3 [00:01<00:02, 1.41s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 3/3 [00:01<00:00, 2.03it/s] 2023-07-25 11:49:41,781-INFO: Initialize tools done.(use time: 1.48s) 2023-07-25 11:49:41,782-INFO: run cmd: git lfs install 2023-07-25 11:49:41,822-INFO: Git LFS initialized. 2023-07-25 11:49:41,969-INFO: Initing other tools ... 2023-07-25 11:49:41,980-INFO: Initing 1 tools, please wait a minute ...
[Tools init]: 0%| | 0/1 [00:00<?, ?it/s] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.62s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.62s/it] 2023-07-25 11:49:43,602-INFO: Initialize tools done.(use time: 1.62s) 2023-07-25 11:49:43,613-INFO: task start : <class 'task.model.compile.CompileTask'> 2023-07-25 11:49:43,614-INFO: pre_compile start. 2023-07-25 11:49:43,614-INFO: start __checkout_source_dir. 2023-07-25 11:49:43,614-INFO: 常规项目,直接拉取或复用本地缓存资源. 2023-07-25 11:49:44,673-INFO: load_source_dir done. source_dir insert env. sourcedir: /root/CodeAnalysis-main/client/data/sourcedirs/git_mc2kudk5 2023-07-25 11:49:44,676-INFO: pre_compile done. 2023-07-25 11:49:44,677-INFO: PATH =
/root/CodeAnalysis-main/tools/linux-git-lfs-v3.1.2 /root/CodeAnalysis-main/tools/linux-git-lfs-v3.1.2 /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /usr/java/jdk1.8.0_152/bin /root/bin
2023-07-25 11:49:44,680-INFO: Codemetric only scans main code (exclude test_source, auto_generate_source, third_party_source). 2023-07-25 11:49:44,680-INFO: Codelint only scans main code. 2023-07-25 11:49:44,707-INFO: Tool compile start. 2023-07-25 11:49:44,708-INFO: Cmd: mvn package -DskipTests 2023-07-25 11:49:44,708-INFO: Generated shell file: /root/CodeAnalysis-main/client/data/taskdirs/task_4416/workdir/tca_build.sh 2023-07-25 11:49:44,708-INFO: basic compile start. 2023-07-25 11:49:44,708-INFO: subprocc normal mode: ['bash', '/root/CodeAnalysis-main/client/data/taskdirs/task_4416/workdir/tca_build.sh'] 2023-07-25 11:49:44,708-INFO: run build cmd: bash /root/CodeAnalysis-main/client/data/taskdirs/task_4416/workdir/tca_build.sh 2023-07-25 11:49:44,717-INFO: 已经上报过代码行数,本次分析无需上报. 2023-07-25 11:49:44,731-INFO: /root/CodeAnalysis-main/client/data/taskdirs/task_4416/workdir/tca_build.sh:行1: mvn: 未找到命令 2023-07-25 11:49:44,811-INFO: exist_error_flag : True 2023-07-25 11:49:44,812-INFO: exist_success_flag : False 2023-07-25 11:49:44,812-INFO: exist_100_flag : False 2023-07-25 11:49:44,812-INFO: cov_no_file_emitted : False 2023-07-25 11:49:44,812-INFO: 编译结束,rc为:127 2023-07-25 11:49:50,194-WARNING: task status code is 210 2023-07-25 11:49:50,194-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译! 2023-07-25 11:49:50,194-WARNING: task result: Traceback (most recent call last): File "task/puppytask.py", line 63, in run response = TaskRunner(self._request_file, self._response_file).run_task() File "task/runtask.py", line 129, in task.runtask.tskr.tskr.run_task File "/root/CodeAnalysis-main/client/task/taskmgr.py", line 73, in taskrunner result = task.runner(params) File "/root/CodeAnalysis-main/client/task/model/compile.py", line 49, in runner return self.tool.compile(params) File "/root/CodeAnalysis-main/client/tool/jaaf.py", line 33, in compile build_cmd=BasicCompile.generate_shell_file(build_cmd), File "/root/CodeAnalysis-main/client/tool/util/compile.py", line 163, in compile self.handle_log(spc.returncode) File "/root/CodeAnalysis-main/client/tool/util/compile.py", line 203, in handle_log raise CompileTaskError(msg="项目编译失败,请确认当前版本是否能在本地进行编译!") util.exceptions.CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
2023-07-25 11:49:50,195-INFO: task result: /root/CodeAnalysis-main/client/data/taskdirs/task_4416/task_response.json
2023-07-25 13:50:41,358-INFO: start to run task: TCA-Armory-J1, execute_processes: ['compile', 'analyze', 'datahandle'] 2023-07-25 13:50:41,576-INFO: License is valid. 2023-07-25 13:50:41,781-INFO: Load tool config: https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git 2023-07-25 13:50:43,134-INFO: Initing common tools ... 2023-07-25 13:50:43,134-INFO: Initing 3 tools, please wait a minute ...
[Tools init]: 0%| | 0/3 [00:00<?, ?it/s] [Tools init]: 33%|█████████████████ | 1/3 [00:01<00:02, 1.33s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 3/3 [00:01<00:00, 2.20it/s] 2023-07-25 13:50:44,498-INFO: Initialize tools done.(use time: 1.36s) 2023-07-25 13:50:44,499-INFO: run cmd: git lfs install 2023-07-25 13:50:44,531-INFO: Git LFS initialized. 2023-07-25 13:50:44,640-INFO: Initing other tools ... 2023-07-25 13:50:44,647-INFO: Initing 1 tools, please wait a minute ...
[Tools init]: 0%| | 0/1 [00:00<?, ?it/s] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.35s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.35s/it] 2023-07-25 13:50:46,000-INFO: Initialize tools done.(use time: 1.35s) 2023-07-25 13:50:46,009-INFO: task start : <class 'task.model.compile.CompileTask'> 2023-07-25 13:50:46,009-INFO: pre_compile start. 2023-07-25 13:50:46,009-INFO: start __checkout_source_dir. 2023-07-25 13:50:46,009-INFO: 常规项目,直接拉取或复用本地缓存资源. 2023-07-25 13:50:47,009-INFO: load_source_dir done. source_dir insert env. sourcedir: /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI 2023-07-25 13:50:47,013-INFO: pre_compile done. 2023-07-25 13:50:47,013-INFO: PATH =
/opt/jenkins/scan-tools/tools/linux-git-lfs-v3.1.2 /opt/jenkins/scan-tools/tools/linux-git-lfs-v3.1.2 /opt/jenkins/scan-tools/sonar-scanner/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /usr/local/nodejs/bin/ /usr/local/bin/maven3.6/bin /usr/java/jdk1.8.0_152/bin /data/liquibase /root/bin
2023-07-25 13:50:47,014-INFO: Codemetric only scans main code (exclude test_source, auto_generate_source, third_party_source). 2023-07-25 13:50:47,014-INFO: Codelint only scans main code. 2023-07-25 13:50:47,048-INFO: Tool compile start. 2023-07-25 13:50:47,049-INFO: Cmd: mvn package -DskipTests 2023-07-25 13:50:47,049-INFO: Generated shell file: /opt/jenkins/scan-tools/tca-client/data/taskdirs/task_4458/workdir/tca_build.sh 2023-07-25 13:50:47,050-INFO: basic compile start. 2023-07-25 13:50:47,050-INFO: subprocc normal mode: ['bash', '/opt/jenkins/scan-tools/tca-client/data/taskdirs/task_4458/workdir/tca_build.sh'] 2023-07-25 13:50:47,050-INFO: run build cmd: bash /opt/jenkins/scan-tools/tca-client/data/taskdirs/task_4458/workdir/tca_build.sh 2023-07-25 13:50:47,055-INFO: 已经上报过代码行数,本次分析无需上报. 2023-07-25 13:50:48,182-INFO: [INFO] Scanning for projects... 2023-07-25 13:50:48,374-INFO: [WARNING] 2023-07-25 13:50:48,383-INFO: [WARNING] Some problems were encountered while building the effective model for com.olym:platform_log:war:1.0.0-SNAPSHOT 2023-07-25 13:50:48,383-INFO: [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-data-redis:jar -> duplicate declaration of version (?) @ line 108, column 21 2023-07-25 13:50:48,383-INFO: [WARNING] 2023-07-25 13:50:48,383-INFO: [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. 2023-07-25 13:50:48,383-INFO: [WARNING] 2023-07-25 13:50:48,383-INFO: [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. 2023-07-25 13:50:48,383-INFO: [WARNING] 2023-07-25 13:50:48,390-INFO: [INFO] 2023-07-25 13:50:48,390-INFO: [INFO] -----------------------< com.olym:platform_log >------------------------ 2023-07-25 13:50:48,390-INFO: [INFO] Building platform_log 1.0.0-SNAPSHOT 2023-07-25 13:50:48,390-INFO: [INFO] --------------------------------[ war ]--------------------------------- 2023-07-25 13:50:49,089-INFO: Downloading from olym: http://192.168.138.170:8081/repository/maven-public/com/platform/service/platform_common/0.0.3-SNAPSHOT/maven-metadata.xml 2023-07-25 13:50:49,158-INFO: Progress (1): 1.0 kB
Downloaded from olym: http://192.168.138.170:8081/repository/maven-public/com/platform/service/platform_common/0.0.3-SNAPSHOT/maven-metadata.xml (1.0 kB at 13 kB/s) 2023-07-25 13:50:49,315-INFO: [INFO] 2023-07-25 13:50:49,315-INFO: [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ platform_log --- 2023-07-25 13:50:49,457-INFO: [INFO] Using 'UTF-8' encoding to copy filtered resources. 2023-07-25 13:50:49,457-INFO: [INFO] Using 'UTF-8' encoding to copy filtered properties files. 2023-07-25 13:50:49,460-INFO: [INFO] Copying 1 resource 2023-07-25 13:50:49,475-INFO: [INFO] Copying 3 resources 2023-07-25 13:50:49,479-INFO: [INFO] 2023-07-25 13:50:49,479-INFO: [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ platform_log --- 2023-07-25 13:50:49,638-INFO: [INFO] Changes detected - recompiling the module! 2023-07-25 13:50:49,641-INFO: [INFO] Compiling 54 source files to /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/target/classes 2023-07-25 13:50:52,997-INFO: [WARNING] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/IotLogController.java:[27,23] sun.rmi.runtime.Log是内部专用 API, 可能会在未来发行版中删除 2023-07-25 13:50:52,997-INFO: [WARNING] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/IotLogController.java:[27,23] sun.rmi.runtime.Log是内部专用 API, 可能会在未来发行版中删除 2023-07-25 13:50:52,997-INFO: [WARNING] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/IotLogController.java:[27,23] sun.rmi.runtime.Log是内部专用 API, 可能会在未来发行版中删除 2023-07-25 13:50:52,997-INFO: [INFO] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/UniServiceLogController.java: 某些输入文件使用或覆盖了已过时的 API。 2023-07-25 13:50:52,997-INFO: [INFO] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/UniServiceLogController.java: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 2023-07-25 13:50:52,998-INFO: [INFO] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/IotLogController.java: /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/IotLogController.java使用了未经检查或不安全的操作。 2023-07-25 13:50:52,998-INFO: [INFO] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/main/java/com/olym/controller/IotLogController.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。 2023-07-25 13:50:52,998-INFO: [INFO] 2023-07-25 13:50:52,999-INFO: [INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ platform_log --- 2023-07-25 13:50:53,003-INFO: [INFO] Using 'UTF-8' encoding to copy filtered resources. 2023-07-25 13:50:53,003-INFO: [INFO] Using 'UTF-8' encoding to copy filtered properties files. 2023-07-25 13:50:53,003-INFO: [INFO] skip non existing resourceDirectory /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/resources 2023-07-25 13:50:53,003-INFO: [INFO] 2023-07-25 13:50:53,003-INFO: [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ platform_log --- 2023-07-25 13:50:53,008-INFO: [INFO] Changes detected - recompiling the module! 2023-07-25 13:50:53,008-INFO: [INFO] Compiling 1 source file to /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/target/test-classes 2023-07-25 13:50:53,683-INFO: [INFO] ------------------------------------------------------------- 2023-07-25 13:50:53,684-INFO: [ERROR] COMPILATION ERROR : 2023-07-25 13:50:53,684-INFO: [INFO] ------------------------------------------------------------- 2023-07-25 13:50:53,684-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[3,17] 程序包org.junit不存在 2023-07-25 13:50:53,684-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[4,24] 程序包org.junit.runner不存在 2023-07-25 13:50:53,684-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[8,2] 找不到符号 2023-07-25 13:50:53,684-INFO: 符号: 类 RunWith 2023-07-25 13:50:53,685-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[12,10] 找不到符号 2023-07-25 13:50:53,685-INFO: 符号: 类 Test 2023-07-25 13:50:53,685-INFO: 位置: 类 com.olym.UniServicePlatFormLogApplicationTests 2023-07-25 13:50:53,685-INFO: [INFO] 4 errors 2023-07-25 13:50:53,685-INFO: [INFO] ------------------------------------------------------------- 2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,686-INFO: [INFO] BUILD FAILURE 2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,687-INFO: [INFO] Total time: 5.531 s 2023-07-25 13:50:53,687-INFO: [INFO] Finished at: 2023-07-25T13:50:53+08:00 2023-07-25 13:50:53,687-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,688-INFO: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project platform_log: Compilation failure: Compilation failure: 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[3,17] 程序包org.junit不存在 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[4,24] 程序包org.junit.runner不存在 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[8,2] 找不到符号 2023-07-25 13:50:53,689-INFO: [ERROR] 符号: 类 RunWith 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[12,10] 找不到符号 2023-07-25 13:50:53,690-INFO: [ERROR] 符号: 类 Test 2023-07-25 13:50:53,690-INFO: [ERROR] 位置: 类 com.olym.UniServicePlatFormLogApplicationTests 2023-07-25 13:50:53,690-INFO: [ERROR] -> [Help 1] 2023-07-25 13:50:53,690-INFO: [ERROR] 2023-07-25 13:50:53,690-INFO: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 2023-07-25 13:50:53,690-INFO: [ERROR] Re-run Maven using the -X switch to enable full debug logging. 2023-07-25 13:50:53,690-INFO: [ERROR] 2023-07-25 13:50:53,690-INFO: [ERROR] For more information about the errors and possible solutions, please read the following articles: 2023-07-25 13:50:53,691-INFO: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 2023-07-25 13:50:53,746-INFO: exist_error_flag : True 2023-07-25 13:50:53,747-INFO: exist_success_flag : False 2023-07-25 13:50:53,747-INFO: exist_100_flag : False 2023-07-25 13:50:53,747-INFO: cov_no_file_emitted : False 2023-07-25 13:50:53,747-INFO: 编译结束,rc为:1 2023-07-25 13:50:58,926-WARNING: task status code is 210 2023-07-25 13:50:58,927-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译! 2023-07-25 13:50:58,928-WARNING: task result: Traceback (most recent call last): File "task/puppytask.py", line 63, in run File "task/runtask.py", line 129, in task.runtask.tskr.tskr.run_task File "task/taskmgr.py", line 73, in taskrunner File "task/model/compile.py", line 49, in runner File "tool/jaaf.py", line 33, in compile File "tool/util/compile.py", line 163, in compile File "tool/util/compile.py", line 203, in handle_log util.exceptions.CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
2023-07-25 13:50:58,928-INFO: task result: /opt/jenkins/scan-tools/tca-client/data/taskdirs/task_4458/task_response.json
这两个日志都是项目编译问题,不是工具或者平台执行问题,需要执行节点上有对应待测项目的编译环境。
- 如果需要使用编译性工具规则,建议使用客户端分析方式,复用编译机器的编译环境。
- 对于在线分析,使用的是在线节点,需要接入有对应项目编译环境的机器作为常驻节点。并设置机器标签和分析方案的执行环境一致,这样任务就会分发到该标签下的机器上执行。
- 以上两种方式都需要开发团队自己维护好编译环境。
日志1的报错位置:
2023-07-25 11:49:44,731-INFO: /root/CodeAnalysis-main/client/data/taskdirs/task_4416/workdir/tca_build.sh:行1: mvn: 未找到命令
2023-07-25 11:49:44,811-INFO: exist_error_flag : True
2023-07-25 11:49:44,812-INFO: exist_success_flag : False
2023-07-25 11:49:44,812-INFO: exist_100_flag : False
2023-07-25 11:49:44,812-INFO: cov_no_file_emitted : False
2023-07-25 11:49:44,812-INFO: 编译结束,rc为:127
2023-07-25 11:49:50,194-WARNING: task status code is 210
2023-07-25 11:49:50,194-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
日志2的报错位置:
2023-07-25 13:50:53,685-INFO: 位置: 类 com.olym.UniServicePlatFormLogApplicationTests
2023-07-25 13:50:53,685-INFO: [INFO] 4 errors
2023-07-25 13:50:53,685-INFO: [INFO] -------------------------------------------------------------
2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------
2023-07-25 13:50:53,686-INFO: [INFO] BUILD FAILURE
2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------
2023-07-25 13:50:53,687-INFO: [INFO] Total time: 5.531 s
2023-07-25 13:50:53,687-INFO: [INFO] Finished at: 2023-07-25T13:50:53+08:00
2023-07-25 13:50:53,687-INFO: [INFO] ------------------------------------------------------------------------
2023-07-25 13:50:53,688-INFO: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project platform_log: Compilation failure: Compilation failure:
2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[3,17] 程序包org.junit不存在
2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[4,24] 程序包org.junit.runner不存在
2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[8,2] 找不到符号
2023-07-25 13:50:53,689-INFO: [ERROR] 符号: 类 RunWith
2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[12,10] 找不到符号
2023-07-25 13:50:53,690-INFO: [ERROR] 符号: 类 Test
2023-07-25 13:50:53,690-INFO: [ERROR] 位置: 类 com.olym.UniServicePlatFormLogApplicationTests
2023-07-25 13:50:53,690-INFO: [ERROR] -> [Help 1]
2023-07-25 13:50:53,690-INFO: [ERROR]
2023-07-25 13:50:53,690-INFO: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
2023-07-25 13:50:53,690-INFO: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
2023-07-25 13:50:53,690-INFO: [ERROR]
2023-07-25 13:50:53,690-INFO: [ERROR] For more information about the errors and possible solutions, please read the following articles:
2023-07-25 13:50:53,691-INFO: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
2023-07-25 13:50:53,746-INFO: exist_error_flag : True
2023-07-25 13:50:53,747-INFO: exist_success_flag : False
2023-07-25 13:50:53,747-INFO: exist_100_flag : False
2023-07-25 13:50:53,747-INFO: cov_no_file_emitted : False
2023-07-25 13:50:53,747-INFO: 编译结束,rc为:1
2023-07-25 13:50:58,926-WARNING: task status code is 210
2023-07-25 13:50:58,927-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
你好,设置了对应的常驻节点进行的在线扫描,常驻节点都有编译环境,都可以编译,已测试,但是执行在线分析时就是报错,直接采用客户端在节点服务器执行时则没有问题
vgdfb @.***
------------------ 原始邮件 ------------------ 发件人: "Tencent/CodeAnalysis" @.>; 发送时间: 2023年7月25日(星期二) 下午3:02 @.>; @.@.>; 主题: Re: [Tencent/CodeAnalysis] 在线分析老是编译工具时报错,且很慢,采用客户端分析则无问题 (Issue #872)
这两个日志都是项目编译问题,不是工具或者平台执行问题,需要执行节点上有对应待测项目的编译环境。
如果需要使用编译性工具规则,建议使用客户端分析方式,复用编译机器的编译环境。
对于在线分析,使用的是在线节点,需要接入有对应项目编译环境的机器作为常驻节点。并设置机器标签和分析方案的执行环境一致,这样任务就会分发到该标签下的机器上执行。
以上两种方式都需要开发团队自己维护好编译环境。
日志1的报错位置:
2023-07-25 11:49:44,731-INFO: /root/CodeAnalysis-main/client/data/taskdirs/task_4416/workdir/tca_build.sh:行1: mvn: 未找到命令 2023-07-25 11:49:44,811-INFO: exist_error_flag : True 2023-07-25 11:49:44,812-INFO: exist_success_flag : False 2023-07-25 11:49:44,812-INFO: exist_100_flag : False 2023-07-25 11:49:44,812-INFO: cov_no_file_emitted : False 2023-07-25 11:49:44,812-INFO: 编译结束,rc为:127 2023-07-25 11:49:50,194-WARNING: task status code is 210 2023-07-25 11:49:50,194-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
日志2的报错位置:
2023-07-25 13:50:53,685-INFO: 位置: 类 com.olym.UniServicePlatFormLogApplicationTests 2023-07-25 13:50:53,685-INFO: [INFO] 4 errors 2023-07-25 13:50:53,685-INFO: [INFO] ------------------------------------------------------------- 2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,686-INFO: [INFO] BUILD FAILURE 2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,687-INFO: [INFO] Total time: 5.531 s 2023-07-25 13:50:53,687-INFO: [INFO] Finished at: 2023-07-25T13:50:53+08:00 2023-07-25 13:50:53,687-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,688-INFO: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project platform_log: Compilation failure: Compilation failure: 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[3,17] 程序包org.junit不存在 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[4,24] 程序包org.junit.runner不存在 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[8,2] 找不到符号 2023-07-25 13:50:53,689-INFO: [ERROR] 符号: 类 RunWith 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[12,10] 找不到符号 2023-07-25 13:50:53,690-INFO: [ERROR] 符号: 类 Test 2023-07-25 13:50:53,690-INFO: [ERROR] 位置: 类 com.olym.UniServicePlatFormLogApplicationTests 2023-07-25 13:50:53,690-INFO: [ERROR] -> [Help 1] 2023-07-25 13:50:53,690-INFO: [ERROR] 2023-07-25 13:50:53,690-INFO: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 2023-07-25 13:50:53,690-INFO: [ERROR] Re-run Maven using the -X switch to enable full debug logging. 2023-07-25 13:50:53,690-INFO: [ERROR] 2023-07-25 13:50:53,690-INFO: [ERROR] For more information about the errors and possible solutions, please read the following articles: 2023-07-25 13:50:53,691-INFO: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 2023-07-25 13:50:53,746-INFO: exist_error_flag : True 2023-07-25 13:50:53,747-INFO: exist_success_flag : False 2023-07-25 13:50:53,747-INFO: exist_100_flag : False 2023-07-25 13:50:53,747-INFO: cov_no_file_emitted : False 2023-07-25 13:50:53,747-INFO: 编译结束,rc为:1 2023-07-25 13:50:58,926-WARNING: task status code is 210 2023-07-25 13:50:58,927-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>
vgdfb @.***
------------------ 原始邮件 ------------------ 发件人: "Tencent/CodeAnalysis" @.>; 发送时间: 2023年7月25日(星期二) 下午3:02 @.>; @.@.>; 主题: Re: [Tencent/CodeAnalysis] 在线分析老是编译工具时报错,且很慢,采用客户端分析则无问题 (Issue #872)
这两个日志都是项目编译问题,不是工具或者平台执行问题,需要执行节点上有对应待测项目的编译环境。
如果需要使用编译性工具规则,建议使用客户端分析方式,复用编译机器的编译环境。
对于在线分析,使用的是在线节点,需要接入有对应项目编译环境的机器作为常驻节点。并设置机器标签和分析方案的执行环境一致,这样任务就会分发到该标签下的机器上执行。
以上两种方式都需要开发团队自己维护好编译环境。
日志1的报错位置:
2023-07-25 11:49:44,731-INFO: /root/CodeAnalysis-main/client/data/taskdirs/task_4416/workdir/tca_build.sh:行1: mvn: 未找到命令 2023-07-25 11:49:44,811-INFO: exist_error_flag : True 2023-07-25 11:49:44,812-INFO: exist_success_flag : False 2023-07-25 11:49:44,812-INFO: exist_100_flag : False 2023-07-25 11:49:44,812-INFO: cov_no_file_emitted : False 2023-07-25 11:49:44,812-INFO: 编译结束,rc为:127 2023-07-25 11:49:50,194-WARNING: task status code is 210 2023-07-25 11:49:50,194-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
日志2的报错位置:
2023-07-25 13:50:53,685-INFO: 位置: 类 com.olym.UniServicePlatFormLogApplicationTests 2023-07-25 13:50:53,685-INFO: [INFO] 4 errors 2023-07-25 13:50:53,685-INFO: [INFO] ------------------------------------------------------------- 2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,686-INFO: [INFO] BUILD FAILURE 2023-07-25 13:50:53,686-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,687-INFO: [INFO] Total time: 5.531 s 2023-07-25 13:50:53,687-INFO: [INFO] Finished at: 2023-07-25T13:50:53+08:00 2023-07-25 13:50:53,687-INFO: [INFO] ------------------------------------------------------------------------ 2023-07-25 13:50:53,688-INFO: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project platform_log: Compilation failure: Compilation failure: 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[3,17] 程序包org.junit不存在 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[4,24] 程序包org.junit.runner不存在 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[8,2] 找不到符号 2023-07-25 13:50:53,689-INFO: [ERROR] 符号: 类 RunWith 2023-07-25 13:50:53,689-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[12,10] 找不到符号 2023-07-25 13:50:53,690-INFO: [ERROR] 符号: 类 Test 2023-07-25 13:50:53,690-INFO: [ERROR] 位置: 类 com.olym.UniServicePlatFormLogApplicationTests 2023-07-25 13:50:53,690-INFO: [ERROR] -> [Help 1] 2023-07-25 13:50:53,690-INFO: [ERROR] 2023-07-25 13:50:53,690-INFO: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 2023-07-25 13:50:53,690-INFO: [ERROR] Re-run Maven using the -X switch to enable full debug logging. 2023-07-25 13:50:53,690-INFO: [ERROR] 2023-07-25 13:50:53,690-INFO: [ERROR] For more information about the errors and possible solutions, please read the following articles: 2023-07-25 13:50:53,691-INFO: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 2023-07-25 13:50:53,746-INFO: exist_error_flag : True 2023-07-25 13:50:53,747-INFO: exist_success_flag : False 2023-07-25 13:50:53,747-INFO: exist_100_flag : False 2023-07-25 13:50:53,747-INFO: cov_no_file_emitted : False 2023-07-25 13:50:53,747-INFO: 编译结束,rc为:1 2023-07-25 13:50:58,926-WARNING: task status code is 210 2023-07-25 13:50:58,927-WARNING: task messsage: CompileTaskError: Error[210]: 项目编译失败,请确认当前版本是否能在本地进行编译!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>
不同项目编译环境各种各样,TCA Client编译阶段不会对编译环境做任何改变。这部分代码流程也是开源的,可以多调试看看。 单纯从日志来看,编译时候缺少依赖,导致编译失败。建议开发登陆机器进行调试,包括看环境变量、网络环境、代码仓库编译时候是否完整等是否一致。也可以对比下 执行成功的客户端分析任务的执行日志,看看差异点在哪。
以下是执行时候输出的PATH环境变量:
PATH =
/opt/jenkins/scan-tools/tools/linux-git-lfs-v3.1.2
/opt/jenkins/scan-tools/tools/linux-git-lfs-v3.1.2
/opt/jenkins/scan-tools/sonar-scanner/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/usr/local/nodejs/bin/
/usr/local/bin/maven3.6/bin
/usr/java/jdk1.8.0_152/bin
/data/liquibase
/root/bin
编译报错位置:
2023-07-25 13:50:53,008-INFO: [INFO] Compiling 1 source file to /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/target/test-classes
2023-07-25 13:50:53,683-INFO: [INFO] -------------------------------------------------------------
2023-07-25 13:50:53,684-INFO: [ERROR] COMPILATION ERROR :
2023-07-25 13:50:53,684-INFO: [INFO] -------------------------------------------------------------
2023-07-25 13:50:53,684-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[3,17] 程序包org.junit不存在
2023-07-25 13:50:53,684-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[4,24] 程序包org.junit.runner不存在
2023-07-25 13:50:53,684-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[8,2] 找不到符号
2023-07-25 13:50:53,684-INFO: 符号: 类 RunWith
2023-07-25 13:50:53,685-INFO: [ERROR] /opt/jenkins/workspace/ibc_cipher_platform-fankyu/platform_log-CI/src/test/java/com/olym/UniServicePlatFormLogApplicationTests.java:[12,10] 找不到符号
2023-07-25 13:50:53,685-INFO: 符号: 类 Test
2023-07-25 13:50:53,685-INFO: 位置: 类 com.olym.UniServicePlatFormLogApplicationTests
2023-07-25 13:50:53,685-INFO: [INFO] 4 errors