Giter Club home page Giter Club logo

Comments (17)

Lingghh avatar Lingghh commented on May 3, 2024

麻烦发一下客户端输出的完整日志,我们分析一下哈

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

麻烦发一下客户端输出的完整日志,我们分析一下哈

在哪里呀

from codeanalysis.

Lingghh avatar Lingghh commented on May 3, 2024

可以把最后一行正常日志以及完整的异常堆栈都截一下图

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

把最后一行正常日志

2022-01-10 09:53:36,493-INFO-util.logutil: Tencent Cloud Code Analysis (OpenSource Beta)
2022-01-10 09:53:36,505-INFO-util.logutil: ------------------------------
2022-01-10 09:53:36,505-INFO-util.logutil: ####### #### #
2022-01-10 09:53:36,506-INFO-util.logutil: # # # #
2022-01-10 09:53:36,506-INFO-util.logutil: # # ###
2022-01-10 09:53:36,506-INFO-util.logutil: # # # #
2022-01-10 09:53:36,506-INFO-util.logutil: # # #####
2022-01-10 09:53:36,506-INFO-util.logutil: # # # # #
2022-01-10 09:53:36,506-INFO-util.logutil: # #### ## ##
2022-01-10 09:53:36,507-INFO-util.logutil: ------------------------------
2022-01-10 09:53:36,829-INFO-util.logutil: using config file: /home/test/CodeAnalysis/client/codedog.ini
2022-01-10 09:53:36,833-INFO-util.logutil: connect to server: http://192.168.7.244:88/
2022-01-10 09:53:37,738-INFO-util.logutil: scan plan(默认) already exists: http://192.168.7.244:88/t/UGCRO9Lf4U/p/test/code-analysis/repos/1/schemes/1/basic
2022-01-10 09:53:37,835-INFO-util.logutil: Use the already existed project(id: 1).
2022-01-10 09:53:38,367-INFO-util.logutil: Project url: http://192.168.7.244:88/t/UGCRO9Lf4U/p/test/code-analysis/repos/1/projects/1/overview
2022-01-10 09:53:39,008-INFO-util.logutil: Job starts ...
2022-01-10 09:53:39,044-INFO-util.logutil: Initing 10 tools, please wait a minute ...
[Tools init]: 100%|██████████████████████████████████████████████| 10/10 [00:00<00:00, 52167.96it/s]
2022-01-10 09:53:39,052-INFO-util.logutil: Initialize tools done.(use time: 0.01s)
2022-01-10 09:53:39,277-INFO-util.logutil: run cmd: ['python3', '-m', 'flake8', '--version']
2022-01-10 09:53:39,353-INFO-util.logutil: /usr/local/bin/python3: No module named flake8
2022-01-10 09:53:39,378-INFO-util.logutil: 建议客户本地安装flake8工具,安装命令:pip install flake8 && pip install flake8-json
2022-01-10 09:53:39,379-INFO-util.logutil: 正在启用CodeDog内置的Python环境
2022-01-10 09:53:39,481-INFO-util.logutil: run cmd: ['python3', '-m', 'flake8', '--version']
2022-01-10 09:53:39,854-INFO-util.logutil: 3.7.9 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.7.2 on Linux
2022-01-10 09:53:40,096-INFO-util.logutil: run cmd: ['python3', '-m', 'pylint', '--version']
2022-01-10 09:53:41,124-INFO-util.logutil: pylint 2.6.0
2022-01-10 09:53:41,125-INFO-util.logutil: astroid 2.5
2022-01-10 09:53:41,125-INFO-util.logutil: Python 3.7.0 (default, Jan 6 2022, 15:33:43)
2022-01-10 09:53:41,125-INFO-util.logutil: [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
2022-01-10 09:53:41,510-INFO-util.logutil: Start to count code lines...
2022-01-10 09:53:41,512-INFO-util.logutil: Codemetric only scans main code (exclude test_source, auto_generate_source, third_party_source).
2022-01-10 09:53:41,513-INFO-util.logutil: Codelint only cans main code.
2022-01-10 09:53:41,576-INFO-util.logutil: [文件数]过滤前:181,过滤后:133
2022-01-10 09:53:41,577-INFO-util.logutil: ['/home/test/CodeAnalysis/client/data/tools/linux-scc/scc', '--by-file', '-c', '--no-cocomo', '-f', 'json', '-o', '/home/test/CodeAnalysis/client/data/taskdirs/task_95/scc_result_22f0de5071b811eca860002277c9372e.json', '/tmp/mini-shop-server']
2022-01-10 09:53:41,649-INFO-util.logutil: results written to /home/test/CodeAnalysis/client/data/taskdirs/task_95/scc_result_22f0de5071b811eca860002277c9372e.json
2022-01-10 09:53:41,658-INFO-util.logutil: Task_95 (Flake8) starts ...
2022-01-10 09:53:51,770-INFO-util.logutil: Task_95 is done.
2022-01-10 09:53:51,817-ERROR-util.wrapper: method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)
2022-01-10 09:53:51,817-INFO-util.wrapper: retrying method(upload_file) after 5 seconds
2022-01-10 09:53:56,826-ERROR-util.wrapper: method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)
2022-01-10 09:53:56,826-INFO-util.wrapper: retrying method(upload_file) after 5 seconds
2022-01-10 09:54:01,835-ERROR-util.wrapper: method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)
2022-01-10 09:54:01,835-WARNING-util.wrapper: method(upload_file) call still fails after 2 retries
2022-01-10 09:54:01,836-INFO-util.logutil:


代码分析结果:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)


2022-01-10 09:54:01,836-INFO-util.logutil: json report: /home/test/CodeAnalysis/client/scan_status.json
2022-01-10 09:54:01,836-ERROR-util.logutil: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/home/test/CodeAnalysis/client/node/localrunner.py", line 386, in run
run_task_mgr.scan_project(cur_execute_request_list, proj_conf)
File "/home/test/CodeAnalysis/client/node/localtask/runlocaltask.py", line 90, in scan_project
self._proj_id).run()
File "/home/test/CodeAnalysis/client/node/localtask/runtask.py", line 164, in run
ResultCheck.upload_task_result(task, self._proj_id)
File "/home/test/CodeAnalysis/client/node/localtask/runtask.py", line 91, in upload_task_result
data_url, log_url = TaskRunner.upload_result_detail(proj_id, task.task_id, task_dir, data, task.task_log)
File "node/taskrunner.py", line 59, in node.taskrunner.TaskRunner.upload_result_detail
File "util/wrapper.py", line 51, in util.wrapper._RetryMethod.call
File "util/wrapper.py", line 107, in util.wrapper.Retry.__retry_call
File "util/wrapper.py", line 92, in util.wrapper.Retry.__retry_call
File "/home/test/CodeAnalysis/client/util/api/fileserver.py", line 97, in upload_file
return self.__upload_data(fp, rel_url, headers)
File "/home/test/CodeAnalysis/client/util/api/fileserver.py", line 81, in __upload_data
HttpClient(self._server_url, rel_url, headers=headers, data=data, proxies=self._proxies).put()
File "/home/test/CodeAnalysis/client/util/api/httpclient.py", line 76, in put
result = HttpRequest.request(url=self.url, headers=self.headers, body=self.data, method="PUT")
File "/home/test/CodeAnalysis/client/util/api/httpclient.py", line 39, in request
dict_result = json.loads(str_result)
File "/usr/local/python3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/python3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/python3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

from codeanalysis.

Lingghh avatar Lingghh commented on May 3, 2024

config.ini文件中配置的文件服务器url与server url的域名是否一致呢?

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

config.ini文件中配置的文件服务器url与server url的域名是否一致呢?

是一样的URL=http://192.168.7.244:88/server/files/

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

这次好像成功了,但是卡在这了
image

from codeanalysis.

Lingghh avatar Lingghh commented on May 3, 2024

目前能正常运行了么?
如果报错了,可以看一下analysis-worker是否正常运行

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

目前能正常运行了么? 如果报错了,可以看一下analysis-worker是否正常运行

最后会报错第三方依赖文件服务器异常,入库失败。请问我这个config.ini中的地址是否填写正确:
[SERVER_URL]
; [必填]请将<Server IP地址>替换为实际的tca server地址
URL=http://192.168.7.244:88/server/main/

[FILE_SERVER]
; [必填]文件服务器地址,请将<Server IP地址>替换为实际的tca server地址
URL=http://192.168.7.244:8888/server/files/

web平台访问的地址是http://192.168.7.244:88/

from codeanalysis.

Lingghh avatar Lingghh commented on May 3, 2024

文件服务器FILE_SERVER的链接可以调整为 URL=http://192.168.7.244:88/server/files/

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

文件服务器FILE_SERVER的链接可以调整为 URL=http://192.168.7.244:88/server/files/

这两个端口是需要对外开放吗?还是一直卡在query result from server不动

from codeanalysis.

jirufeng avatar jirufeng commented on May 3, 2024

同样卡在这里

from codeanalysis.

Lingghh avatar Lingghh commented on May 3, 2024

不需要对外,这里可以检查一下analysis-worker的日志,看看是什么问题

docker-compose exec analysis-worker /bin/bash
tail -F -n 1000 log/codedog.log

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

-2022-01-12 10:19:18,813-INFO-util.fileserver: Downloading file from http://192.168.7.244:88/server/files/taskdata/projects/1/task_180/ee26bccc734b11ecb0a5002277c9372e/tmp_dir.zip to /var/www/django/codedog/tempdata/a523b62ae4126341c7d8946d7301636cb74f21c6/tmp_dir.zip
-2022-01-12 10:19:19,818-WARNING-urllib3.connectionpool: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffb32d48810>: Failed to establish a new connection: [Errno 113] No route to host')': /server/files/taskdata/projects/1/task_180/ee26bccc734b11ecb0a5002277c9372e/tmp_dir.zip

是不是因为是内网的docker部署的,没有ip地址所以报错?docker访问内网192.168.7.244是不通的

from codeanalysis.

color-way avatar color-way commented on May 3, 2024

@Lingghh 有空帮忙确认一下呀

from codeanalysis.

Lingghh avatar Lingghh commented on May 3, 2024

-2022-01-12 10:19:18,813-INFO-util.fileserver: Downloading file from http://192.168.7.244:88/server/files/taskdata/projects/1/task_180/ee26bccc734b11ecb0a5002277c9372e/tmp_dir.zip to /var/www/django/codedog/tempdata/a523b62ae4126341c7d8946d7301636cb74f21c6/tmp_dir.zip -2022-01-12 10:19:19,818-WARNING-urllib3.connectionpool: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffb32d48810>: Failed to establish a new connection: [Errno 113] No route to host')': /server/files/taskdata/projects/1/task_180/ee26bccc734b11ecb0a5002277c9372e/tmp_dir.zip

是不是因为是内网的docker部署的,没有ip地址所以报错?docker访问内网192.168.7.244是不通的

是这个原因导致的,目前这里是有什么限制么?为什么docker访问内网192.168.7.244是不通的呢?

from codeanalysis.

Lingghh avatar Lingghh commented on May 3, 2024

这里可以关闭宿主机的防火墙试试

from codeanalysis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.