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]: #323

Open
3 tasks done
zha0cai opened this issue Mar 23, 2023 · 0 comments
Open
3 tasks done

[Bug]: #323

zha0cai opened this issue Mar 23, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@zha0cai
Copy link

zha0cai commented Mar 23, 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

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

  1. 从 1.9.2 升级到 1.9.3 之后新建项目无法保存项目信息,提示参数错误
  2. 查看 dongtai-server-1 日志,查找资料 stackoverflow.com,请问是环境问题还是数据问题
  3. 题外话,策略模板管理能不能提供全选删除按钮

Additional Information

No response

Logs

# dongtai-server-1 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.
[pid: 69|app: 0|req: 1949/2672] ipaddr () {42 vars in 909 bytes} [Thu Mar 23 17:54:02 2023] POST /api/v1/project/add => generated 50 bytes in 231 msecs (HTTP/1.0 200) 11 headers in 428 bytes (1 switches on core 7)
@zha0cai zha0cai added the bug Something isn't working label Mar 23, 2023
@Bidaya0 Bidaya0 transferred this issue from HXSecurity/DongTai Mar 23, 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