/index/build 报错 UnicodeDecodeError
项目初始化正常,连接 deepseek 模型,执行命令 /index/build 的时候,报错:
UnicodeDecodeError - 'utf-8' codec can't decode byte 0xff in position 4696: invalid start byte
补充一点输出信息:
2024-09-12 17:36:16.565 | INFO | autocoder.auto_coder:load_include_files:69 - Loading include file: /project/actions/base/base.yml
2024-09-12 17:36:16.569 | WARNING | autocoder.auto_coder:main:261 - Detecting error when connecting to ray cluster: 'Namespace' object has no attribute 'doc_command', try to connect to ray cluster without storage support.
2024-09-12 17:36:16,614 INFO worker.py:1598 -- Connecting to existing Ray cluster at address: 127.0.0.1:6379...
2024-09-12 17:36:16,614 INFO worker.py:1616 -- Calling ray.init() again after it has already been called.
2024-09-12 17:36:16.624 | INFO | autocoder.index.for_command:index_command:37 - Beging to index source code in /project
An error occurred: UnicodeDecodeError - 'utf-8' codec can't decode byte 0xff in position 4696: invalid start byte
似乎是读取自己生成的 yml 配置文件时出错了。
操作系统:MAC 14.3.1
尝试了 auto-coder.chat --debug 启动,只是多了异常时调用栈,并没有更多的信息,主要是没有输出哪个文件有异常。
改了一点源码,可以输出有问题的文件了,但居然是 venv 下面的 site-packages 里的文件:
autocoder.pyproject:read_file_content:189 - UnicodeDecodeError on reading file <project>/venv/lib/python3.11/site-packages/joblib/test/test_func_inspect_special_encoding.py
追加一个案例: 环境:WSL2/Win11 报错信息: 2024-09-23 19:46:00.610 | INFO | autocoder.auto_coder:load_include_files:69 - Loading include file: /home/page/GitPlayground/AimRT/actions/base/base.yml 2024-09-23 19:46:00.612 | WARNING | autocoder.auto_coder:main:261 - Detecting error when connecting to ray cluster: 'Namespace' object has no attribute 'doc_command', try to connect to ray cluster without storage support. 2024-09-23 19:46:00,621 INFO worker.py:1598 -- Connecting to existing Ray cluster at address: 172.22.73.122:6379... 2024-09-23 19:46:00,621 INFO worker.py:1616 -- Calling ray.init() again after it has already been called. An error occurred: UnicodeDecodeError - 'utf-8' codec can't decode byte 0x80 in position 6: invalid start byte
追加一个案例: 环境:WSL2/Win11 报错信息: 2024-09-23 19:46:00.610 | INFO | autocoder.auto_coder:load_include_files:69 - Loading include file: /home/page/GitPlayground/AimRT/actions/base/base.yml 2024-09-23 19:46:00.612 | WARNING | autocoder.auto_coder:main:261 - Detecting error when connecting to ray cluster: 'Namespace' object has no attribute 'doc_command', try to connect to ray cluster without storage support. 2024-09-23 19:46:00,621 INFO worker.py:1598 -- Connecting to existing Ray cluster at address: 172.22.73.122:6379... 2024-09-23 19:46:00,621 INFO worker.py:1616 -- Calling ray.init() again after it has already been called. An error occurred: UnicodeDecodeError - 'utf-8' codec can't decode byte 0x80 in position 6: invalid start byte
遇到和你相同的问题,个人Mac电脑上可以用,公司的windows用不了
怎么解决的?
没解决。。后来去用 Cline 了。不过后来想,也许把虚拟环境(venv)从项目目录移出去能解决吧(因为报错的文件,是在 venv 里面)
怎么解决的?