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

1.11.3版本按照教程部署后提交sql分析后报:TypeError: expected str, bytes or os.PathLike object, not NoneType #2840

Open
mofan0920 opened this issue Oct 15, 2024 · 1 comment

Comments

@mofan0920
Copy link

重现步骤

  1. SQL审核->SQL分析 2. 上传SQL文件 3.选择实例和数据库(数据库连接测试是成功的)4.点击“开始分析”,弹窗提示:未知错误,请联系管理员处理! 5.日志显示:TypeError: expected str, bytes or os.PathLike object, not NoneType

预期外的结果

弹窗提示:未知错误,请联系管理员处理! 日志显示:TypeError: expected str, bytes or os.PathLike object, not NoneType

日志文本

[root@10 docker-compose]# docker logs archery -f --tail=50
  File "<frozen posixpath>", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/venv4archery/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv4archery/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/archery/sql/sql_analyze.py", line 93, in analyze
    stdout, stderr = soar.execute_cmd(cmd_args).communicate()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/archery/sql/plugins/plugin.py", line 87, in execute_cmd
    raise RuntimeError("命令执行失败,失败原因:%s" % str(e))
RuntimeError: 命令执行失败,失败原因:expected str, bytes or os.PathLike object, not NoneType
2024-10-15 10:22:27,582 - django.request - ERROR - Internal Server Error: /sql_analyze/analyze/
Traceback (most recent call last):
  File "/opt/archery/sql/plugins/plugin.py", line 77, in execute_cmd
    p = subprocess.Popen(
        ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.11/subprocess.py", line 1824, in _execute_child
    and os.path.dirname(executable)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/venv4archery/lib/python3.11/site-packages/django/core/handlers/exception.py", line 56, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv4archery/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv4archery/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/archery/sql/sql_analyze.py", line 93, in analyze

版本

1.11.3

部署方式

Docker

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

No response

@mofan0920
Copy link
Author

补充一点,数据库是MySQL,版本5.7

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