自定义工具无法下载平台上传的文件

我在 python自定义工具中尝试用 requests.get() 下载在对话框中上传的文件url(如 http://localhost:8080/admin/oss/file/xxx ),但报错:
HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /admin/oss/file/019d1823-e718-71b0-9da9-2184b0b0bfb3 (Caused by NewConnectionError(\"HTTPConnection(host='localhost', port=8080): Failed to establish a new connection: [Errno 13] Permission denied\

我的是docker部署的,版本是v2.6.1

权限问题不是,这个问问AI就解决了

我也遇到了这个问题,楼主解决了吗?

可以将代码中的localhost改成具体的IP,或者在/opt/maxkb/conf/maxkb.env文件中添加参数 MAXKB_SANDBOX_PYTHON_BANNED_HOSTS=redis,然后执行mkctl reload重启