Giter Site home page Giter Site logo

运行报错 about codeanalysis HOT 14 CLOSED

tencent avatar tencent commented on May 2, 2024
运行报错

from codeanalysis.

Comments (14)

jklZy1 avatar jklZy1 commented on May 2, 2024

报错内容:2022-01-07 11:54:28,645-ERROR-util.api.httpclient: error code: 400, reason: Bad Request, headers: Server: nginx/1.13.7
Date: Fri, 07 Jan 2022 03:54:28 GMT
Content-Type: application/json
Content-Length: 17
Connection: close
Vary: Accept, Origin
Allow: POST, OPTIONS
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin

from codeanalysis.

jklZy1 avatar jklZy1 commented on May 2, 2024

{
"status": "error",
"error_code": 400,
"url": "http://172.17.18.113/t/Bti26HqmHem/p/test/code-analysis/repos/3/projects/3/scan-history",
"text": "扫描异常",
"description": "HTTPError: HTTP Error 400: Bad Request",
"scan_report": {}
}

from codeanalysis.

Lingghh avatar Lingghh commented on May 2, 2024

这里是连接server报错了,可以看一下 main服务的日志:log/codedog.log

from codeanalysis.

jklZy1 avatar jklZy1 commented on May 2, 2024

这里是连接server报错了,可以看一下 main服务的日志:log/codedog.log
日志显示这个,令牌无效;请问是不是需要把client/config.ini里面的文件服务器的Token信息需要替换一下,这个值从哪去取;
-2022-01-07 12:27:29,456-DEBUG-urllib3.connectionpool: http://nginx:8000 "PUT /files/public_server_temp/jobdata/projects/3/job40/1e25266c6f7211ecbfa10242ac140009/job_context.json HTTP/1.1" 401 195
-2022-01-07 12:27:29,457-WARNING-util.retrylib: method <put_file> exception: 'HTTPResponse' object has no attribute 'text'
-2022-01-07 12:27:29,457-INFO-util.retrylib: retrying method <put_file> on 2 time
-2022-01-07 12:27:32,470-WARNING-util.handlers: exception response: {'detail': ErrorDetail(string='认证令牌无效。', code='authentication_failed')}
-2022-01-07 12:27:32,470-INFO-util.handlers: custom error response data: {'status_code': 401, 'code': 1000, 'msg': ErrorDetail(string='认证令牌无效。', code='authentication_failed')}
-2022-01-07 12:27:32,470-WARNING-django.request: Unauthorized: /api/authen/urlauth/

from codeanalysis.

Lingghh avatar Lingghh commented on May 2, 2024

这里的问题不是客户端config配置错误

目前使用CodeDog的Token还是使用了新用户的Token呢?或者有更新过默认的Token么?

from codeanalysis.

jklZy1 avatar jklZy1 commented on May 2, 2024

CodeDog默认的Token 和 新用户的Token都尝试过,都报'认证令牌无效'的错

from codeanalysis.

Lingghh avatar Lingghh commented on May 2, 2024

这里有更新过CodeDog默认的Token么?

如果默认的Token有更新,需要在server/scripts/config.shFILE_SERVER_TOKEN也做一下调整,然后重启一下server

from codeanalysis.

jklZy1 avatar jklZy1 commented on May 2, 2024

重新部署server,使用默认的Token;修改config.ini;
image
再次在客户端执行扫描,报以下错误:-2022-01-07 15:29:36,215-INFO-apps.authen.apis.v1: proxy server authentication user[CodeDog], original uri[/files/public_server_temp/jobdata/projects/1/job6/6eae15586f8b11ec82970242ac140007/job_context.json]
-2022-01-07 15:29:36,217-DEBUG-urllib3.connectionpool: http://nginx:8000 "PUT /files/public_server_temp/jobdata/projects/1/job6/6eae15586f8b11ec82970242ac140007/job_context.json HTTP/1.1" 502 173
-2022-01-07 15:29:36,217-WARNING-util.retrylib: method <put_file> exception: HTTPConnectionPool(host='nginx', port=8000): Max retries exceeded with url: /files/public_server_temp/jobdata/projects/1/job6/6eae15586f8b11ec82970242ac140007/job_context.json (Caused by ResponseError('too many 502 error responses'))

from codeanalysis.

Lingghh avatar Lingghh commented on May 2, 2024

这里麻烦更新一下代码

from codeanalysis.

jklZy1 avatar jklZy1 commented on May 2, 2024

代码更新后,依然扫描报错:-2022-01-07 16:56:41,752-DEBUG-urllib3.connectionpool: http://nginx:8000 "PUT /files/public_server_temp/jobdata/projects/1/job3/a2210d266f9711ecb6e00242ac150006/job_context.json HTTP/1.1" 500 145
-2022-01-07 16:56:41,752-WARNING-util.retrylib: method <put_file> exception: HTTPConnectionPool(host='nginx', port=8000): Max retries exceeded with url: /files/public_server_temp/jobdata/projects/1/job3/a2210d266f9711ecb6e00242ac150006/job_context.json (Caused by ResponseError('too many 500 error responses'))
-2022-01-07 16:56:41,753-INFO-util.retrylib: retrying method <put_file> on 3 time

from codeanalysis.

Lingghh avatar Lingghh commented on May 2, 2024

可以看一下file-server容器内的日志: cat log/codedog_file.log 存在什么报错

from codeanalysis.

jklZy1 avatar jklZy1 commented on May 2, 2024

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 505, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 465, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 493, in dispatch
self.initial(request, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 410, in initial
self.perform_authentication(request)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 324, in perform_authentication
request.user
File "/usr/local/lib/python3.7/site-packages/rest_framework/request.py", line 220, in user
self._authenticate()
File "/usr/local/lib/python3.7/site-packages/rest_framework/request.py", line 373, in _authenticate
user_auth_tuple = authenticator.authenticate(self)
File "/var/www/django/codedog/codedog_file_server/authentication.py", line 89, in authenticate
user = User.objects.get_or_create(nickname=username)[0]
File "/usr/local/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 573, in get_or_create
return self.get(**kwargs), False
File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 425, in get
num = len(clone)
File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 269, in len
self._fetch_all()
File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 1308, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 53, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1156, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.7/site-packages/django/db/utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 73, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.7/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/usr/local/lib/python3.7/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.7/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.7/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
django.db.utils.ProgrammingError: (1146, "Table 'codedog_file.authenmgr_userprofile' doesn't exist")

提示没这个表

from codeanalysis.

Lingghh avatar Lingghh commented on May 2, 2024

这里可以先执行一下 ./compose_init.sh 脚本

from codeanalysis.

jklZy1 avatar jklZy1 commented on May 2, 2024

重新执行./compose_init.sh 脚本 ,运行成功,感谢大佬~

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.