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

慢日志统计页面无法展现SQL历史趋势图 #2

Closed
Grain-Yu opened this issue Oct 13, 2023 · 2 comments
Closed

慢日志统计页面无法展现SQL历史趋势图 #2

Grain-Yu opened this issue Oct 13, 2023 · 2 comments

Comments

@Grain-Yu
Copy link
Owner

Grain-Yu commented Oct 13, 2023

重现步骤

SQL优化->慢查日志->慢日志统计页面,单条语句的详情展开页面,无法展现SQL历史趋势图

预期外的结果

页面提示“Server internal error”

日志文本

archery的日志:
[2023-10-13 09:20:53,089][MainThread:140312554125120][task_id:django.request][log.py:224][ERROR]- Internal Server Error: /slowquery/report/
Traceback (most recent call last):
  File "/opt/venv4archery/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/opt/venv4archery/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/venv4archery/lib/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/opt/archery/sql/slowlog.py", line 209, in report
    checksum = MySQLdb.escape_string(checksum).decode("utf-8")
AttributeError: module 'MySQLdb' has no attribute 'escape_string'

版本

1.10.1

部署方式

Docker

是否还有其他可以辅助定位问题的信息?比如数据库版本等

No response

@Grain-Yu
Copy link
Owner Author

Grain-Yu commented Oct 13, 2023

mysqlclient的版本问题,2.1.0以后移除了这个方法:
Remove escape() and escape_string() from MySQLdb package. (#511)
https://github.com/PyMySQL/mysqlclient/blob/91c04282eac46ce2e5380be58e262d817faab566/HISTORY.rst#whats-new-in-210

@Grain-Yu Grain-Yu changed the title 慢日志统计页面无法展现折线统计图 慢日志统计页面无法展现SQL历史趋势图 Oct 13, 2023
@Grain-Yu Grain-Yu reopened this Oct 13, 2023
@Grain-Yu
Copy link
Owner Author

hhyo/Archery#2330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant