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

[Bug]: 新建项目提示参数错误,无法保存;查看污点详情提示接口错误 #325

Open
3 tasks done
zha0cai opened this issue Mar 24, 2023 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@zha0cai
Copy link

zha0cai commented Mar 24, 2023

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the available support channels without success.

Version

1.9.3

Installation Type

Official Docker Compose

Service Name

DongTai-Web, DongTai-WebAPI, DongTai-OpenAPI

Describe the details of the bug and the steps to reproduce it

问题:

  1. 新建项目提示参数错误,无法保存
  2. 直接插装后也无法修改项目信息,查看报文信息提示接口错误

额外需求:策略模板管理能否添加多选删除操作。

谢谢~

Additional Information

No response

Logs

[pid: 69|app: 0|req: 1948/2671] ipaddr () {38 vars in 574 bytes} [Thu Mar 23 17:53:54 2023] POST /api/v1/report/upload => generated 60 bytes in 32 msecs (HTTP/1.0 200) 10 headers in 380 bytes (1 switches on core 5)
ERROR 2023-03-23 17:54:02,627 [project_add.post:185] The database backend does not accept 0 as a value for AutoField.
Traceback (most recent call last):
  File "/opt/dongtai/./dongtai_web/views/project_add.py", line 178, in post
    project.save(update_fields=[
  File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 739, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 776, in save_base
    updated = self._save_table(
  File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 858, in _save_table
    updated = self._do_update(base_qs, using, pk_val, values, update_fields,
  File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 912, in _do_update
    return filtered._update(values) > 0
  File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 802, in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1559, in execute_sql
    cursor = super().execute_sql(result_type)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1162, in execute_sql
    sql, params = self.as_sql()
  File "/usr/local/lib/python3.10/site-packages/django/db/backends/mysql/compiler.py", line 44, in as_sql
    update_query, update_params = super().as_sql()
  File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1525, in as_sql
    val = field.get_db_prep_save(val, connection=self.connection)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/related.py", line 971, in get_db_prep_save
    return self.target_field.get_db_prep_save(value, connection=connection)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/__init__.py", line 842, in get_db_prep_save
    return self.get_db_prep_value(value, connection=connection, prepared=False)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/__init__.py", line 2487, in get_db_prep_value
    value = connection.ops.validate_autopk_value(value)
  File "/usr/local/lib/python3.10/site-packages/django/db/backends/mysql/operations.py", line 236, in validate_autopk_value
    raise ValueError('The database backend does not accept 0 as a '
ValueError: The database backend does not accept 0 as a value for AutoField.


ERROR 2023-03-24 10:56:51,714 [method_graph.get:67] invalid literal for int() with base 10: 'undefined'
Traceback (most recent call last):
  File "/opt/dongtai/./dongtai_web/views/method_graph.py", line 24, in get
    method_pool_id = int(request.query_params.get('method_pool_id'))
ValueError: invalid literal for int() with base 10: 'undefined'
ERROR 2023-03-24 10:56:51,714 [__init__.dispatch:111] url: /api/v1/engine/method_pool/sca,exc:Field 'id' expected a number but got 'undefined'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/__init__.py", line 1823, in get_prep_value
    return int(value)
ValueError: invalid literal for int() with base 10: 'undefined'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/dongtai/./dongtai_common/endpoint/__init__.py", line 109, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/dongtai/./dongtai_web/views/engine_method_pool_sca.py", line 36, in get
    method_pool = MethodPool.objects.filter(
  File "/usr/local/lib/python3.10/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.10/site-packages/django/db/models/query.py", line 941, in filter
    return self._filter_or_exclude(False, args, kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 961, in _filter_or_exclude
    clone._filter_or_exclude_inplace(negate, args, kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 968, in _filter_or_exclude_inplace
    self._query.add_q(Q(*args, **kwargs))
  File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1416, in add_q
    clause, _ = self._add_q(q_object, self.used_aliases)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1435, in _add_q
    child_clause, needed_inner = self.build_filter(
  File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1370, in build_filter
    condition = self.build_lookup(lookups, col, value)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1216, in build_lookup
    lookup = lookup_class(lhs, rhs)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/lookups.py", line 25, in __init__
    self.rhs = self.get_prep_lookup()
  File "/usr/local/lib/python3.10/site-packages/django/db/models/lookups.py", line 77, in get_prep_lookup
    return self.lhs.output_field.get_prep_value(self.rhs)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/__init__.py", line 1825, in get_prep_value
    raise e.__class__(
ValueError: Field 'id' expected a number but got 'undefined'.
@zha0cai zha0cai added the bug Something isn't working label Mar 24, 2023
@zha0cai zha0cai changed the title [Bug]: [Bug]: 新建项目提示参数错误,无法保存 Mar 24, 2023
@zha0cai zha0cai changed the title [Bug]: 新建项目提示参数错误,无法保存 [Bug]: 新建项目提示参数错误,无法保存;查看污点详情提示接口错误 Mar 24, 2023
@Bidaya0 Bidaya0 transferred this issue from HXSecurity/DongTai Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant