PluginDaemonBadRequestError when downloading/uploading local plugins on Windows 11(Solved!) #57

Closed
opened 2026-02-16 00:19:27 -05:00 by yindo · 9 comments
Owner

Originally created by @mymian on GitHub (Mar 22, 2025).

Environment:
Operating System: Windows 11
Go Version: 1.24.1
dify-plugin-daemon: latest
dify1.1.1
Steps to Reproduce:
Create a .env file in the cmd/serve directory.
Run the command go run main.go in the terminal.
Successfully start the Dify project locally.
Attempt to download or upload a local plugin.

Image

Expected Result:
The plugin should be downloaded/uploaded successfully without any errors.
Actual Result:
The following error occurs:
PluginDaemonBadRequestError: file not found: icon.svg failed to remap tool icon failed to remap assets failed to save package

Image

Image

Image

Image

Additional Information:
The plugin being downloaded/uploaded does contain the icon.svg file, as verified multiple times.
I'm wondering if there is a way to resolve this issue by modifying the .env file.

Image

Image

Request:
Could you please provide guidance on how to fix this error? Is there a specific configuration in the .env file that might be causing this issue?

Originally created by @mymian on GitHub (Mar 22, 2025). Environment: Operating System: Windows 11 Go Version: 1.24.1 dify-plugin-daemon: latest dify1.1.1 Steps to Reproduce: Create a .env file in the cmd/serve directory. Run the command go run main.go in the terminal. Successfully start the Dify project locally. Attempt to download or upload a local plugin. ![Image](https://github.com/user-attachments/assets/d4cab432-238d-4259-b09d-1939c7b7f97a) Expected Result: The plugin should be downloaded/uploaded successfully without any errors. Actual Result: The following error occurs: PluginDaemonBadRequestError: file not found: icon.svg failed to remap tool icon failed to remap assets failed to save package ![Image](https://github.com/user-attachments/assets/141743ac-d57a-47e2-9cf2-dee2e0a32358) ![Image](https://github.com/user-attachments/assets/bcd8ef75-1f38-4eb0-8336-a8eb3a3086b2) ![Image](https://github.com/user-attachments/assets/826d41f2-7d4f-4ec3-b512-5d9bec3007c6) ![Image](https://github.com/user-attachments/assets/2f9929a4-0a7b-436d-ba4c-b5c0e300270b) Additional Information: The plugin being downloaded/uploaded does contain the icon.svg file, as verified multiple times. I'm wondering if there is a way to resolve this issue by modifying the .env file. ![Image](https://github.com/user-attachments/assets/18f54666-0ef0-45d0-bb80-a422278af0f7) ![Image](https://github.com/user-attachments/assets/d27f3352-7b85-4871-9935-63db07d26215) Request: Could you please provide guidance on how to fix this error? Is there a specific configuration in the .env file that might be causing this issue?
yindo added the Windows label 2026-02-16 00:19:27 -05:00
yindo closed this issue 2026-02-16 00:19:27 -05:00
Author
Owner

@mymian commented on GitHub (Mar 26, 2025):

直接就写中文了。
在win11本地启动运行这个组件的时候踩了不少坑,最主要的问题就是双斜杠\ 识别不了的bug,在代码中找到对应的路径将 \ 改成 / 即可。
比如zip.go 中解压:原代码为 filename = filepath.Join(workingPath, filename) ,报错copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error
更改为: filename = strings.Replace(filepath.Join(workingPath, filename), "\", "/", -1) ,解决问题。

下面我提供一下解决的bug顺序,可以参考一下:
运行步骤:
我是在cmd/server目录下运行 go run main.go,启动的程序,.env文件也在该目录下,修改插件存放位置主要还是为了容易排查和管理,关键配置如下:

Image

Image

遇到并解决问题如下,仅供参考:

  1. file not found:icon.svg
    解决方法:assets.go 文件,添加路径前缀

Image

  1. copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error
    解决方法:zip.go 文件,func (z *ZipPluginDecoder) ExtractTo(dst string) 方法,里面涉及到路径的 \ 都改成 / 解决。
  2. failed to find uv path: exit status 1, retry in 30s

Image
解决方法: 检查.env中PYTHON_INTERPRETER_PATH的配置是否正确,如果正确,则pip install uv 。

  1. failed to create virtual environment
    解决方法: environment_python.go 文件, uvPath := strings.Replace(strings.TrimSpace(string(output)), "\", "/", -1)

  2. failed to find python
    解决方法:environment_python.go 文件, pythonPath, err := filepath.Abs(path.Join(p.State.WorkingPath, ".venv/Scripts/python.exe"))

Image
注:在windows里面,venv命令生成的可执行文件在Scripts里面,而且.exe也需要添加进去

  1. failed to find requirements.txt
    解决方法:检查.env中HTTP_PROXY或HTTP_PROXYS配置(我是留空就正常运行了),保证网络正常访问。

以上就是在本地部署dify安装工具时遇到的bug,还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路,只不过显示是安装成功了。

@mymian commented on GitHub (Mar 26, 2025): 直接就写中文了。 在win11本地启动运行这个组件的时候踩了不少坑,最主要的问题就是双斜杠\\ 识别不了的bug,在代码中找到对应的路径将 \\ 改成 / 即可。 比如zip.go 中解压:原代码为 filename = filepath.Join(workingPath, filename) ,报错copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error 更改为: filename = strings.Replace(filepath.Join(workingPath, filename), "\\", "/", -1) ,解决问题。 下面我提供一下解决的bug顺序,可以参考一下: 运行步骤: 我是在cmd/server目录下运行 go run main.go,启动的程序,.env文件也在该目录下,修改插件存放位置主要还是为了容易排查和管理,关键配置如下: ![Image](https://github.com/user-attachments/assets/66ded868-defb-419b-bc1e-e7afb7a14973) ![Image](https://github.com/user-attachments/assets/a76814bc-5aa7-4981-a220-ef14218ccd84) 遇到并解决问题如下,仅供参考: 1. file not found:icon.svg 解决方法:assets.go 文件,添加路径前缀 ![Image](https://github.com/user-attachments/assets/aa51e660-81c7-437f-9d2c-e44afb8ed632) 2. copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error 解决方法:zip.go 文件,func (z *ZipPluginDecoder) ExtractTo(dst string) 方法,里面涉及到路径的 \\ 都改成 / 解决。 3. failed to find uv path: exit status 1, retry in 30s ![Image](https://github.com/user-attachments/assets/8cc59123-4aa2-43ea-b084-f6b1210283ef) 解决方法: 检查.env中PYTHON_INTERPRETER_PATH的配置是否正确,如果正确,则pip install uv 。 4. failed to create virtual environment 解决方法: environment_python.go 文件, uvPath := strings.Replace(strings.TrimSpace(string(output)), "\\", "/", -1) 5. failed to find python 解决方法:environment_python.go 文件, pythonPath, err := filepath.Abs(path.Join(p.State.WorkingPath, ".venv/Scripts/python.exe")) ![Image](https://github.com/user-attachments/assets/6f04f3e1-f6dd-4e53-85bb-77aa122b27d5) 注:在windows里面,venv命令生成的可执行文件在Scripts里面,而且.exe也需要添加进去 6. failed to find requirements.txt 解决方法:检查.env中HTTP_PROXY或HTTP_PROXYS配置(我是留空就正常运行了),保证网络正常访问。 以上就是在本地部署dify安装工具时遇到的bug,还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路,只不过显示是安装成功了。
Author
Owner

@MagicBYang commented on GitHub (Mar 26, 2025):

直接就写中文了。 在win11本地启动运行这个组件的时候踩了不少坑,最主要的问题就是双斜杠\ 识别不了的bug,在代码中找到对应的路径将 \ 改成 / 即可。 比如zip.go 中解压:原代码为 filename = filepath.Join(workingPath, filename) ,报错copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error 更改为: filename = strings.Replace(filepath.Join(workingPath, filename), "", "/", -1) ,解决问题。

下面我提供一下解决的bug顺序,可以参考一下: 运行步骤: 我是在cmd/server目录下运行 go run main.go,启动的程序,.env文件也在该目录下,修改插件存放位置主要还是为了容易排查和管理,关键配置如下:

Image

Image

遇到并解决问题如下,仅供参考:

  1. file not found:icon.svg
    解决方法:assets.go 文件,添加路径前缀

Image

  1. copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error
    解决方法:zip.go 文件,func (z *ZipPluginDecoder) ExtractTo(dst string) 方法,里面涉及到路径的 \ 都改成 / 解决。
  2. failed to find uv path: exit status 1, retry in 30s

Image 解决方法: 检查.env中PYTHON_INTERPRETER_PATH的配置是否正确,如果正确,则pip install uv 。

  1. failed to create virtual environment
    解决方法: environment_python.go 文件, uvPath := strings.Replace(strings.TrimSpace(string(output)), "", "/", -1)
  2. failed to find python
    解决方法:environment_python.go 文件, pythonPath, err := filepath.Abs(path.Join(p.State.WorkingPath, ".venv/Scripts/python.exe"))

Image 注:在windows里面,venv命令生成的可执行文件在Scripts里面,而且.exe也需要添加进去

  1. failed to find requirements.txt
    解决方法:检查.env中HTTP_PROXY或HTTP_PROXYS配置(我是留空就正常运行了),保证网络正常访问。

以上就是在本地部署dify安装工具时遇到的bug,还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路,只不过显示是安装成功了。

感谢,解决了部分问题。svg路径那修改加上了"_assets/",但随后又报错:copy plugin to working directory error: open _assets\icon_l_en.svg: file does not exist open _assets\icon_l_en.svg: file does not exist extract plugin to working directory error

不太理解,按理说第一个svg找到了怎么第二个找不到?

@MagicBYang commented on GitHub (Mar 26, 2025): > 直接就写中文了。 在win11本地启动运行这个组件的时候踩了不少坑,最主要的问题就是双斜杠\ 识别不了的bug,在代码中找到对应的路径将 \ 改成 / 即可。 比如zip.go 中解压:原代码为 filename = filepath.Join(workingPath, filename) ,报错copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error 更改为: filename = strings.Replace(filepath.Join(workingPath, filename), "\", "/", -1) ,解决问题。 > > 下面我提供一下解决的bug顺序,可以参考一下: 运行步骤: 我是在cmd/server目录下运行 go run main.go,启动的程序,.env文件也在该目录下,修改插件存放位置主要还是为了容易排查和管理,关键配置如下: > > ![Image](https://github.com/user-attachments/assets/66ded868-defb-419b-bc1e-e7afb7a14973) > > ![Image](https://github.com/user-attachments/assets/a76814bc-5aa7-4981-a220-ef14218ccd84) > > 遇到并解决问题如下,仅供参考: > > 1. file not found:icon.svg > 解决方法:assets.go 文件,添加路径前缀 > > ![Image](https://github.com/user-attachments/assets/aa51e660-81c7-437f-9d2c-e44afb8ed632) > > 2. copy plugin to working directory error: open .git\COMMIT_EDITMSG: file does not exist open .git\COMMIT_EDITMSG: file does not exist extract plugin to working directory error > 解决方法:zip.go 文件,func (z *ZipPluginDecoder) ExtractTo(dst string) 方法,里面涉及到路径的 \ 都改成 / 解决。 > 3. failed to find uv path: exit status 1, retry in 30s > > ![Image](https://github.com/user-attachments/assets/8cc59123-4aa2-43ea-b084-f6b1210283ef) 解决方法: 检查.env中PYTHON_INTERPRETER_PATH的配置是否正确,如果正确,则pip install uv 。 > > 4. failed to create virtual environment > 解决方法: environment_python.go 文件, uvPath := strings.Replace(strings.TrimSpace(string(output)), "\", "/", -1) > 5. failed to find python > 解决方法:environment_python.go 文件, pythonPath, err := filepath.Abs(path.Join(p.State.WorkingPath, ".venv/Scripts/python.exe")) > > ![Image](https://github.com/user-attachments/assets/6f04f3e1-f6dd-4e53-85bb-77aa122b27d5) 注:在windows里面,venv命令生成的可执行文件在Scripts里面,而且.exe也需要添加进去 > > 6. failed to find requirements.txt > 解决方法:检查.env中HTTP_PROXY或HTTP_PROXYS配置(我是留空就正常运行了),保证网络正常访问。 > > 以上就是在本地部署dify安装工具时遇到的bug,还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路,只不过显示是安装成功了。 感谢,解决了部分问题。svg路径那修改加上了"_assets/",但随后又报错:copy plugin to working directory error: open _assets\icon_l_en.svg: file does not exist open _assets\icon_l_en.svg: file does not exist extract plugin to working directory error 不太理解,按理说第一个svg找到了怎么第二个找不到?
Author
Owner

@mymian commented on GitHub (Mar 26, 2025):

将 \ 改成 / 试试? 斜杠好多地方识别有问题

@mymian commented on GitHub (Mar 26, 2025): 将 \ 改成 / 试试? 斜杠好多地方识别有问题
Author
Owner

@MagicBYang commented on GitHub (Mar 26, 2025):

将 \ 改成 / 试试? 斜杠好多地方识别有问题

改完就好了,完全follow你的可行

@MagicBYang commented on GitHub (Mar 26, 2025): > 将 \ 改成 / 试试? 斜杠好多地方识别有问题 改完就好了,完全follow你的可行
Author
Owner

@Kele2021 commented on GitHub (Mar 26, 2025):

还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路
这个也是windows下兼容行的问题,原因是windows不支持含有 : 的文件名,所有写文件不符合预期且为空文件,代码位置在这儿

Image

@Kele2021 commented on GitHub (Mar 26, 2025): 还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路 这个也是windows下兼容行的问题,原因是windows不支持含有 : 的文件名,所有写文件不符合预期且为空文件,代码位置在这儿 ![Image](https://github.com/user-attachments/assets/479c35aa-7239-4c10-85b8-6ce497c87443)
Author
Owner

@Yamcanda commented on GitHub (Apr 4, 2025):

还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路 这个也是windows下兼容行的问题,原因是windows不支持含有 : 的文件名,所有写文件不符合预期且为空文件,代码位置在这儿

Image

installed_bucket.go 文件调整:

Image
Delete、Exists、Save 一并判断 windows

install_to_local.go 文件调整:

Image

@Yamcanda commented on GitHub (Apr 4, 2025): > 还有[ERROR]list installed plugins failed: plugin_unique_identifier is not valid 还没解决思路 这个也是windows下兼容行的问题,原因是windows不支持含有 : 的文件名,所有写文件不符合预期且为空文件,代码位置在这儿 > > ![Image](https://github.com/user-attachments/assets/479c35aa-7239-4c10-85b8-6ce497c87443) installed_bucket.go 文件调整: ![Image](https://github.com/user-attachments/assets/4e53dcc6-5bd7-406b-91c4-439cf8a0088e) Delete、Exists、Save 一并判断 windows install_to_local.go 文件调整: ![Image](https://github.com/user-attachments/assets/2a6ce4cb-d269-4312-aaea-2cbd01000a8e)
Author
Owner

@listeng commented on GitHub (Apr 16, 2025):

大佬可否提交成pr,要不然每次都得改

@listeng commented on GitHub (Apr 16, 2025): 大佬可否提交成pr,要不然每次都得改
Author
Owner

@lcedaw commented on GitHub (Aug 19, 2025):

Image [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: 拒绝访问。 (os error 5) at path "C:\\WINDOWS\\.tmpKCtbcN" , retrying 问下大佬们,这个错误怎么解决
@lcedaw commented on GitHub (Aug 19, 2025): <img width="1485" height="437" alt="Image" src="https://github.com/user-attachments/assets/25ed6213-1b75-4589-b906-20eba3cd4c9b" /> [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: 拒绝访问。 (os error 5) at path "C:\\WINDOWS\\.tmpKCtbcN" , retrying 问下大佬们,这个错误怎么解决
Author
Owner

@imamiao commented on GitHub (Dec 22, 2025):

Image [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: 拒绝访问。 (os error 5) at path "C:\WINDOWS\.tmpKCtbcN" , retrying 问下大佬们,这个错误怎么解决

使用管理员身份开启CMD

@imamiao commented on GitHub (Dec 22, 2025): > <img alt="Image" width="1485" height="437" src="https://private-user-images.githubusercontent.com/48266410/479415411-25ed6213-1b75-4589-b906-20eba3cd4c9b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjYzOTMwNTcsIm5iZiI6MTc2NjM5Mjc1NywicGF0aCI6Ii80ODI2NjQxMC80Nzk0MTU0MTEtMjVlZDYyMTMtMWI3NS00NTg5LWI5MDYtMjBlYmEzY2Q0YzliLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEyMjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMjIyVDA4MzkxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNiOTk1ZjQwMDE0ZmQ4Yjc4ZWUyMDE0MDExN2Y1OGRhNGVhOTUzODcyMzUxNTgyNWZhNzNmOGZjMDM0YzM0ZjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-L7aZ_w2KfKxFiz2pBlwtnc-r12VLXpWMMUpSpIFiUQ"> [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: 拒绝访问。 (os error 5) at path "C:\\WINDOWS\\.tmpKCtbcN" , retrying 问下大佬们,这个错误怎么解决 使用管理员身份开启CMD
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#57