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]: dongtai-server启动报错 #1940

Open
3 tasks done
zhansc opened this issue Aug 6, 2024 · 1 comment
Open
3 tasks done

[Bug]: dongtai-server启动报错 #1940

zhansc opened this issue Aug 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@zhansc
Copy link

zhansc commented Aug 6, 2024

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.15.0

Installation Type

Official Docker Compose

Service Name

DongTai-Core

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

设备:MacBookPro

问题背景:
目前dockerhub国内不能使用,只能通过【./dtctl install -v 1.15.0 -r dockerhub -s mysql】方式部署,其他方式或版本都无法获取到镜像。

问题描述:
load_hook_strategy.py脚本中遍历漏洞策略

如果已经存在用户自定义规则,设置为系统规则,跳过创建

                        hook_strategy_obj = HookStrategy.objects.filter(
                            value=hook_strategy["value"], type=hook_strategy["type"], language_id=v, system_type=0
                        ).get()

这句代码提示有多条满足条件的数据,不知道是什么原因。

Additional Information

No response

Logs

报错日志:
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,885 [report_handler_factory.wrapper:80] Registration report type 130 handler FilePathHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,889 [report_handler_factory.wrapper:80] Registration report type 129 handler ThirdPartyServiceHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,890 [report_handler_factory.wrapper:80] Registration report type 97 handler ApiRouteHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,892 [report_handler_factory.wrapper:80] Registration report type 81 handler ErrorLogHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,892 [report_handler_factory.wrapper:80] Registration report type 37 handler HardEncodeVulHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,892 [report_handler_factory.wrapper:80] Registration report type 1 handler HeartBeatHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,892 [report_handler_factory.wrapper:80] Registration report type 33 handler NormalVulnHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,896 [report_handler_factory.wrapper:80] Registration report type 36 handler SaasMethodPoolHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,910 [report_handler_factory.wrapper:80] Registration report type 17 handler ScaHandler
2024-08-06 19:47:34 INFO 2024-08-06 19:47:34,910 [report_handler_factory.wrapper:80] Registration report type 18 handler ScaBulkHandler
2024-08-06 19:47:35 INFO 2024-08-06 19:47:35,029 [__init__.monkey_patch:68] app: dongtai_common module: dongtai_engine.plugins.method_pool class:  func : method_pool_after_scan is patched by PlugMethodPoolAfterScan
2024-08-06 19:47:46 use local file
2024-08-06 19:47:46 is in gevent patched : False
2024-08-06 19:47:46 preheat settings now : True
2024-08-06 19:47:46 ERROR: Lost connection to MySQL server !!!
2024-08-06 19:47:46 启动uwsgi服务
2024-08-06 19:47:47 use local file
2024-08-06 19:47:47 is in gevent patched : False
2024-08-06 19:47:47 preheat settings now : True
2024-08-06 19:47:47 File “/opt/dongtai/static/i18n/en/LC_MESSAGES/django.po” is already compiled and up to date.
2024-08-06 19:47:47 File “/opt/dongtai/static/i18n/zh/LC_MESSAGES/django.po” is already compiled and up to date.
2024-08-06 19:47:49 
2024-08-06 19:47:49 Get the latest vulnerability rules.
2024-08-06 19:47:59 use local file
2024-08-06 19:47:59 is in gevent patched : False
2024-08-06 19:47:59 preheat settings now : True
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,022 [report_handler_factory.wrapper:80] Registration report type 130 handler FilePathHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,024 [report_handler_factory.wrapper:80] Registration report type 129 handler ThirdPartyServiceHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,025 [report_handler_factory.wrapper:80] Registration report type 97 handler ApiRouteHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,025 [report_handler_factory.wrapper:80] Registration report type 81 handler ErrorLogHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,026 [report_handler_factory.wrapper:80] Registration report type 37 handler HardEncodeVulHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,026 [report_handler_factory.wrapper:80] Registration report type 1 handler HeartBeatHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,027 [report_handler_factory.wrapper:80] Registration report type 33 handler NormalVulnHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,030 [report_handler_factory.wrapper:80] Registration report type 36 handler SaasMethodPoolHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,048 [report_handler_factory.wrapper:80] Registration report type 17 handler ScaHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,048 [report_handler_factory.wrapper:80] Registration report type 18 handler ScaBulkHandler
2024-08-06 19:47:38 INFO 2024-08-06 19:47:38,157 [__init__.monkey_patch:68] app: dongtai_common module: dongtai_engine.plugins.method_pool class:  func : method_pool_after_scan is patched by PlugMethodPoolAfterScan
2024-08-06 19:47:46 Traceback (most recent call last):
2024-08-06 19:47:46   File "/opt/dongtai/manage.py", line 21, in <module>
2024-08-06 19:47:46     main()
2024-08-06 19:47:46   File "/opt/dongtai/manage.py", line 17, in main
2024-08-06 19:47:46     execute_from_command_line(sys.argv)
2024-08-06 19:47:46   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
2024-08-06 19:47:46     utility.execute()
2024-08-06 19:47:46   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
2024-08-06 19:47:46     self.fetch_command(subcommand).run_from_argv(self.argv)
2024-08-06 19:47:46   File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
2024-08-06 19:47:46     self.execute(*args, **cmd_options)
2024-08-06 19:47:46   File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
2024-08-06 19:47:46     output = self.handle(*args, **options)
2024-08-06 19:47:46   File "/opt/dongtai/deploy/commands/management/commands/load_hook_strategy.py", line 157, in handle
2024-08-06 19:47:46     ).get()
2024-08-06 19:47:46   File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 439, in get
2024-08-06 19:47:46     raise self.model.MultipleObjectsReturned(
2024-08-06 19:47:46 dongtai_common.models.hook_strategy.HookStrategy.MultipleObjectsReturned: get() returned more than one HookStrategy -- it returned 2!
@zhansc zhansc added the bug Something isn't working label Aug 6, 2024
@Code-Agitator
Copy link
Contributor

我也遇到了,我的做法是把旧的mysql-vol清理干净 docker volume prune

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

2 participants