invalid memory address or nil pointer dereference #340

Closed
opened 2026-02-16 10:19:03 -05:00 by yindo · 21 comments
Owner

Originally created by @qq1002517 on GitHub (Jun 5, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I used Docker to deploy DIY (which can be connected to the internet) on my Mac system, and everything runs normally. I have another Linux server on the intranet, and when I want to use dify, I do it this way.

  1. Install the necessary tools and plugins for dify on my Mac system, and arrange the chatflow.
  2. Use the Docker save command to export Docker images.
  3. Compress the entire Docker directory under the source code directory into a zip file. I modified the nginx port in the. env file and also changed the plugin port 5003 to 15003
  4. Upload the files from steps 3 and 4 to my Linux server and start it up. Everything looks normal, but there is no model configured by me in the “OpenAI-API compatible” model list.

✔️ Expected Behavior

I have configured many models in the "OpenAI-API compatible" section of the Mac system. I believe that by copying the dify-1.4.1/dock directory to the Linux machine, the new machine should display the corresponding models. I confirm that my Linux can access these model services. I think these contents should be stored in the PG database. And the dify-1.4.1/docker/volumes/db directory should contain all data information

Actual Behavior

there is no model configured by me in the “OpenAI-API compatible” model list.
The log is as follows

plugin_daemon-1  | 2025/05/13 12:55:52 [Recovery] 2025/05/13 - 12:55:52 panic recovered:
plugin_daemon-1  | runtime error: invalid memory address or nil pointer dereference
plugin_daemon-1  | /usr/local/go/src/runtime/panic.go:262 (0x476858)
plugin_daemon-1  | /usr/local/go/src/runtime/signal_unix.go:917 (0x476828)
plugin_daemon-1  | /app/internal/core/plugin_manager/local_runtime/stdio.go:63 (0xd842f2)
plugin_daemon-1  | /app/internal/core/plugin_manager/local_runtime/io.go:16 (0xd81cda)
plugin_daemon-1  | /app/internal/core/plugin_daemon/generic.go:28 (0xf78556)
plugin_daemon-1  | /app/internal/core/plugin_daemon/model_service.go:159 (0xfa0bac)
plugin_daemon-1  | /app/internal/service/invoke_model.go:323 (0xfa0b92)
plugin_daemon-1  | /app/internal/service/base_sse.go:41 (0xfaec1e)
plugin_daemon-1  | /app/internal/service/invoke_model.go:321 (0xfa0b1b)
plugin_daemon-1  | /app/internal/server/controllers/model.go:163 (0x1471910)
plugin_daemon-1  | /app/internal/server/controllers/base.go:53 (0xfd1434)
plugin_daemon-1  | /app/internal/server/controllers/base.go:31 (0xfd18b4)
plugin_daemon-1  | /app/internal/server/controllers/base.go:37 (0xfd1335)
plugin_daemon-1  | /app/internal/server/controllers/model.go:160 (0x1471853)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa)
plugin_daemon-1  | /app/internal/server/middleware.go:170 (0x1472d93)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa)
plugin_daemon-1  | /app/internal/server/middleware.go:97 (0x1472e33)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa)
plugin_daemon-1  | /app/internal/server/middleware.go:66 (0x14768f1)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa)
plugin_daemon-1  | /app/internal/server/middleware.go:24 (0x1470a74)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf4320e)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xf431fb)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf42344)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xf4232b)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf41731)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xf411a0)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xf40cd1)
plugin_daemon-1  | /usr/local/go/src/net/http/server.go:3210 (0x7dc72d)
plugin_daemon-1  | /usr/local/go/src/net/http/server.go:2092 (0x7bbc4f)
plugin_daemon-1  | /usr/local/go/src/runtime/asm_amd64.s:1700 (0x47ca40)
plugin_daemon-1  | 

It's done

Originally created by @qq1002517 on GitHub (Jun 5, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I used Docker to deploy DIY (which can be connected to the internet) on my Mac system, and everything runs normally. I have another Linux server on the intranet, and when I want to use dify, I do it this way. 1. Install the necessary tools and plugins for dify on my Mac system, and arrange the chatflow. 2. Use the Docker save command to export Docker images. 3. Compress the entire Docker directory under the source code directory into a zip file. I modified the nginx port in the. env file and also changed the plugin port 5003 to 15003 4. Upload the files from steps 3 and 4 to my Linux server and start it up. Everything looks normal, but there is no model configured by me in the “OpenAI-API compatible” model list. ### ✔️ Expected Behavior I have configured many models in the "OpenAI-API compatible" section of the Mac system. I believe that by copying the dify-1.4.1/dock directory to the Linux machine, the new machine should display the corresponding models. I confirm that my Linux can access these model services. I think these contents should be stored in the PG database. And the dify-1.4.1/docker/volumes/db directory should contain all data information ### ❌ Actual Behavior there is no model configured by me in the “OpenAI-API compatible” model list. The log is as follows ``` plugin_daemon-1 | 2025/05/13 12:55:52 [Recovery] 2025/05/13 - 12:55:52 panic recovered: plugin_daemon-1 | runtime error: invalid memory address or nil pointer dereference plugin_daemon-1 | /usr/local/go/src/runtime/panic.go:262 (0x476858) plugin_daemon-1 | /usr/local/go/src/runtime/signal_unix.go:917 (0x476828) plugin_daemon-1 | /app/internal/core/plugin_manager/local_runtime/stdio.go:63 (0xd842f2) plugin_daemon-1 | /app/internal/core/plugin_manager/local_runtime/io.go:16 (0xd81cda) plugin_daemon-1 | /app/internal/core/plugin_daemon/generic.go:28 (0xf78556) plugin_daemon-1 | /app/internal/core/plugin_daemon/model_service.go:159 (0xfa0bac) plugin_daemon-1 | /app/internal/service/invoke_model.go:323 (0xfa0b92) plugin_daemon-1 | /app/internal/service/base_sse.go:41 (0xfaec1e) plugin_daemon-1 | /app/internal/service/invoke_model.go:321 (0xfa0b1b) plugin_daemon-1 | /app/internal/server/controllers/model.go:163 (0x1471910) plugin_daemon-1 | /app/internal/server/controllers/base.go:53 (0xfd1434) plugin_daemon-1 | /app/internal/server/controllers/base.go:31 (0xfd18b4) plugin_daemon-1 | /app/internal/server/controllers/base.go:37 (0xfd1335) plugin_daemon-1 | /app/internal/server/controllers/model.go:160 (0x1471853) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa) plugin_daemon-1 | /app/internal/server/middleware.go:170 (0x1472d93) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa) plugin_daemon-1 | /app/internal/server/middleware.go:97 (0x1472e33) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa) plugin_daemon-1 | /app/internal/server/middleware.go:66 (0x14768f1) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf356aa) plugin_daemon-1 | /app/internal/server/middleware.go:24 (0x1470a74) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf4320e) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xf431fb) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf42344) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xf4232b) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf41731) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xf411a0) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xf40cd1) plugin_daemon-1 | /usr/local/go/src/net/http/server.go:3210 (0x7dc72d) plugin_daemon-1 | /usr/local/go/src/net/http/server.go:2092 (0x7bbc4f) plugin_daemon-1 | /usr/local/go/src/runtime/asm_amd64.s:1700 (0x47ca40) plugin_daemon-1 | ``` It's done
yindo closed this issue 2026-02-16 10:19:03 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 5, 2025):

Hi @qq1002517! I'm Dosu and I’m helping the dify team.

The error you're seeing ("invalid memory address or nil pointer dereference") is often caused by missing or misconfigured data, especially when moving Docker volumes or databases between systems. In Dify, model configurations are stored in the PostgreSQL database, which is mounted as a Docker volume. If the volume wasn't copied or mounted correctly on your Linux server, the application may not find your models, and attempts to access missing data can trigger this kind of error.

Here are the most likely causes and what you can check:

  • Make sure the entire contents of your docker/volumes/db/data directory from your Mac were copied to the same path on your Linux server, and that the Docker Compose file on Linux is mounting this directory correctly.
  • Confirm that file and directory permissions on the Linux server allow the database container to read and write to the volume.
  • Double-check your .env file and Docker Compose configuration to ensure all environment variables (especially database credentials and paths) are correct and match your previous setup.
  • If you changed the database or plugin ports, verify that all services are using the updated ports and that there are no conflicts.
  • If the database did not start correctly or is missing data, Dify may return empty results or None objects, which can cause nil pointer dereference errors in the backend code when it tries to access expected data structures.

If after checking these points the issue persists, try inspecting the database container logs for errors on startup, and verify that the expected tables and data exist in the database. This will help confirm whether the data migration was successful.

Let me know if you need more specific troubleshooting steps for any of these checks.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 5, 2025): <!-- Greeting --> Hi @qq1002517! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The error you're seeing ("invalid memory address or nil pointer dereference") is often caused by missing or misconfigured data, especially when moving Docker volumes or databases between systems. In Dify, model configurations are stored in the PostgreSQL database, which is mounted as a Docker volume. If the volume wasn't copied or mounted correctly on your Linux server, the application may not find your models, and attempts to access missing data can trigger this kind of error. Here are the most likely causes and what you can check: - Make sure the entire contents of your `docker/volumes/db/data` directory from your Mac were copied to the same path on your Linux server, and that the Docker Compose file on Linux is mounting this directory correctly. - Confirm that file and directory permissions on the Linux server allow the database container to read and write to the volume. - Double-check your `.env` file and Docker Compose configuration to ensure all environment variables (especially database credentials and paths) are correct and match your previous setup. - If you changed the database or plugin ports, verify that all services are using the updated ports and that there are no conflicts. - If the database did not start correctly or is missing data, Dify may return empty results or None objects, which can cause nil pointer dereference errors in the backend code when it tries to access expected data structures. If after checking these points the issue persists, try inspecting the database container logs for errors on startup, and verify that the expected tables and data exist in the database. This will help confirm whether the data migration was successful. Let me know if you need more specific troubleshooting steps for any of these checks. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/1b0c450d-88e5-49c0-995a-3fa5f3892cf2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1b0c450d-88e5-49c0-995a-3fa5f3892cf2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1b0c450d-88e5-49c0-995a-3fa5f3892cf2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1b0c450d-88e5-49c0-995a-3fa5f3892cf2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1b0c450d-88e5-49c0-995a-3fa5f3892cf2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1b0c450d-88e5-49c0-995a-3fa5f3892cf2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1b0c450d-88e5-49c0-995a-3fa5f3892cf2?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20695)
Author
Owner

@qq1002517 commented on GitHub (Jun 5, 2025):

@dosu,I check my file and diff two system .It's seems same. the other,I kown the pg db contain two scheme that is dify and dify_plugin.I confirm that my file is complete and correctly mounted。Because I can see all my installed plugins in the plugin list.But I can't see the already configured model, and I can't see it even after reconfiguring it. I only have the error message provided last time.
I will try to restore. env to default later, but I want to know which model data is stored in which table of PG. I will check the database. Can you tell me the table name? @dosu

@qq1002517 commented on GitHub (Jun 5, 2025): @dosu,I check my file and diff two system .It's seems same. the other,I kown the pg db contain two scheme that is dify and dify_plugin.I confirm that my file is complete and correctly mounted。Because I can see all my installed plugins in the plugin list.But I can't see the already configured model, and I can't see it even after reconfiguring it. I only have the error message provided last time. I will try to restore. env to default later, but I want to know which model data is stored in which table of PG. I will check the database. Can you tell me the table name? @dosu
Author
Owner

@dosubot[bot] commented on GitHub (Jun 5, 2025):

Model configuration data is stored in the following PostgreSQL tables under the dify schema: app_model_configs (main model configs), provider_models (API provider models and their configs), provider_model_settings (model enabled/load balancing status), and load_balancing_model_configs (load balancing configs) [source][source]. These are not in the dify_plugin schema.

To check if your model data is present, you can connect to your PostgreSQL instance and run, for example:

SELECT * FROM app_model_configs;
SELECT * FROM provider_models;
SELECT * FROM provider_model_settings;
SELECT * FROM load_balancing_model_configs;

If these tables are empty or missing expected entries, it likely means the migration or volume mount did not bring over your model data. If you see your plugins but not your models, focus on these tables for troubleshooting.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 5, 2025): <!-- Answer --> Model configuration data is stored in the following PostgreSQL tables under the dify schema: app_model_configs (main model configs), provider_models (API provider models and their configs), provider_model_settings (model enabled/load balancing status), and load_balancing_model_configs (load balancing configs) [[source](https://github.com/langgenius/dify/blob/38554c5f3e50eb9a5f28c06d1ecdca669ce8e3c8/api/models/model.py)][[source](https://github.com/langgenius/dify/blob/38554c5f3e50eb9a5f28c06d1ecdca669ce8e3c8/api/models/provider.py)]. These are not in the dify_plugin schema. To check if your model data is present, you can connect to your PostgreSQL instance and run, for example: ```sql SELECT * FROM app_model_configs; SELECT * FROM provider_models; SELECT * FROM provider_model_settings; SELECT * FROM load_balancing_model_configs; ``` If these tables are empty or missing expected entries, it likely means the migration or volume mount did not bring over your model data. If you see your plugins but not your models, focus on these tables for troubleshooting. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/78af551c-4cdb-482e-866b-2546eff8af51?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/78af551c-4cdb-482e-866b-2546eff8af51?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/78af551c-4cdb-482e-866b-2546eff8af51?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/78af551c-4cdb-482e-866b-2546eff8af51?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/78af551c-4cdb-482e-866b-2546eff8af51?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/78af551c-4cdb-482e-866b-2546eff8af51?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/78af551c-4cdb-482e-866b-2546eff8af51?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20695)
Author
Owner

@qq1002517 commented on GitHub (Jun 5, 2025):

hi @dosu ,thank you for table_name.

  1. I checked the data in the corresponding data table of the PG database, and the data is normal.
  2. I tried to restore. env to default, so that the port would also default. After restarting, the performance remains the same as before The model in the database cannot be displayed.
  3. All plugin log information is as follows
2025/06/06 01:19:56 pool.go:32: [INFO]init routine pool, size: 10000
2025/06/06 01:19:57 init.go:99: [INFO]dify plugin db initialized
2025/06/06 01:19:57 manager.go:176: [INFO]start plugin manager daemon...
2025/06/06 01:19:57 init.go:19: [INFO]Persistence initialized
2025/06/06 01:19:57 watcher.go:16: [INFO]start to handle new plugins in path: plugin
2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: jaguarliuu/rookie_data_alchemy:0.0.4
2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin jaguarliuu/rookie_data_alchemy:0.0.4
2025/06/06 01:19:57 environment_python.go:51: [ERROR]failed to patch the plugin sdk: failed to get the path of the plugin sdk: fork/exec /app/storage/cwd/jaguarliuu/rookie_data_alchemy-0.0.4@94581419ef8404cea60ecd3497f634cd6f0aad4cc84aa7dd8d6c3feb962e8add/.venv/bin/python: no such file or directory
2025/06/06 01:19:57 run.go:108: [INFO]plugin jaguarliuu/rookie_data_alchemy:0.0.4 stopped
2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: junjiem/mcp_see_agent:0.1.10
2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin junjiem/mcp_see_agent:0.1.10
2025/06/06 01:19:57 run.go:108: [INFO]plugin junjiem/mcp_see_agent:0.1.10 stopped
2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: langgenius/agent:0.0.15
2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin langgenius/agent:0.0.15
2025/06/06 01:19:57 run.go:108: [INFO]plugin langgenius/agent:0.0.15 stopped
2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: langgenius/echarts:0.0.1
2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin langgenius/echarts:0.0.1
2025/06/06 01:19:57 environment_python.go:51: [ERROR]failed to patch the plugin sdk: failed to get the path of the plugin sdk: fork/exec /app/storage/cwd/langgenius/echarts-0.0.1@e390de4320a5ab32ef24899983f84c31aa39e4690c7b294be11f2c10268c3a68/.venv/bin/python: no such file or directory
2025/06/06 01:19:57 run.go:108: [INFO]plugin langgenius/echarts:0.0.1 stopped
[gnet] 2025-06-06T01:19:57.408097673Z   INFO    logging/logger.go:256   Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:15004
2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: langgenius/openai_api_compatible:0.0.16
2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin langgenius/openai_api_compatible:0.0.16
2025/06/06 01:19:57 run.go:108: [INFO]plugin langgenius/openai_api_compatible:0.0.16 stopped
2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: svcvit/artifacts:0.0.3
2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin svcvit/artifacts:0.0.3
2025/06/06 01:19:57 environment_python.go:363: [ERROR]failed to get the version of the plugin sdk: failed to find the version of the plugin sdk
2025/06/06 01:19:57 run.go:108: [INFO]plugin svcvit/artifacts:0.0.3 stopped
2025/06/06 01:20:27 cluster_lifetime.go:113: [INFO]current node has become the master of the cluster
2025/06/06 01:20:27 node.go:213: [INFO]node f55e0f7d-ee69-4fcb-873f-5e8036a90daa has been removed from the cluster due to being disconnected
2025/06/06 01:20:27 node.go:213: [INFO]node 89c5b230-f90e-426f-9346-eddbc8d2e394 has been removed from the cluster due to being disconnected
[GIN] 2025/06/06 - 01:21:50 | 200 |    1.661672ms |      172.30.5.9 | POST     "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/debugging/key"
[GIN] 2025/06/06 - 01:21:50 | 200 |   17.748246ms |      172.30.5.9 | GET      "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/list?page=1&page_size=256"
[GIN] 2025/06/06 - 01:21:50 | 200 |   20.336047ms |      172.30.5.9 | GET      "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/list?page=1&page_size=100"
[GIN] 2025/06/06 - 01:21:50 | 200 |    1.541117ms |      172.30.5.9 | GET      "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/install/tasks?page=1&page_size=100"
[GIN] 2025/06/06 - 01:21:52 | 200 |    2.229469ms |      172.30.5.9 | GET      "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256"
[GIN] 2025/06/06 - 01:21:52 | 200 |    1.930297ms |      172.30.5.9 | GET      "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256"
[GIN] 2025/06/06 - 01:21:53 | 200 |   12.742784ms |      172.30.5.9 | GET      "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256"
[GIN] 2025/06/06 - 01:21:53 | 200 |   15.363199ms |      172.30.5.9 | GET      "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256"

2025/06/06 01:21:53 [Recovery] 2025/06/06 - 01:21:53 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:262 (0x4768b8)
/usr/local/go/src/runtime/signal_unix.go:917 (0x476888)
/app/internal/core/plugin_manager/local_runtime/stdio.go:85 (0xdb8512)
/app/internal/core/plugin_manager/local_runtime/io.go:16 (0xdb5e7a)
[GIN] 2025/06/06 - 01:21:53 | 500 |    7.818864ms |      172.30.5.9 | POST     "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/dispatch/model/schema"
/app/internal/core/plugin_daemon/generic.go:27 (0xfc0a36)
/app/internal/core/plugin_daemon/model.gen.go:161 (0xfecceb)
/app/internal/service/model.gen.go:210 (0xfeccd2)
/app/internal/service/base_sse.go:116 (0xff6a9a)
/app/internal/service/base_sse.go:44 (0xff6cfe)
/app/internal/service/base_sse.go:114 (0xff69e4)
/app/internal/service/model.gen.go:208 (0xfecc91)
/app/internal/server/controllers/model.gen.go:163 (0x1cfb950)
/app/internal/server/controllers/base.go:53 (0x101f5b4)
/app/internal/server/controllers/base.go:31 (0x101fa34)
/app/internal/server/controllers/base.go:37 (0x101f4b5)
/app/internal/server/controllers/model.gen.go:160 (0x1cfb893)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a)
/app/internal/server/middleware.go:170 (0x1cfe2d3)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a)
/app/internal/server/middleware.go:97 (0x1cfe373)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a)
/app/internal/server/middleware.go:66 (0x1d02171)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a)
/app/internal/server/middleware.go:24 (0x1cfdb14)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8386e)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xf8385b)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf829a4)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xf8298b)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf81d91)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xf81800)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xf81331)
/usr/local/go/src/net/http/server.go:3210 (0x7e062d)
/usr/local/go/src/net/http/server.go:2092 (0x7bfb4f)
/usr/local/go/src/runtime/asm_amd64.s:1700 (0x47caa0)

langgenius/openai_api_compatible version is 0.0.16

@qq1002517 commented on GitHub (Jun 5, 2025): hi @dosu ,thank you for table_name. 1. I checked the data in the corresponding data table of the PG database, and the data is normal. 2. I tried to restore. env to default, so that the port would also default. After restarting, the performance remains the same as before The model in the database cannot be displayed. 3. All plugin log information is as follows ``` 2025/06/06 01:19:56 pool.go:32: [INFO]init routine pool, size: 10000 2025/06/06 01:19:57 init.go:99: [INFO]dify plugin db initialized 2025/06/06 01:19:57 manager.go:176: [INFO]start plugin manager daemon... 2025/06/06 01:19:57 init.go:19: [INFO]Persistence initialized 2025/06/06 01:19:57 watcher.go:16: [INFO]start to handle new plugins in path: plugin 2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: jaguarliuu/rookie_data_alchemy:0.0.4 2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin jaguarliuu/rookie_data_alchemy:0.0.4 2025/06/06 01:19:57 environment_python.go:51: [ERROR]failed to patch the plugin sdk: failed to get the path of the plugin sdk: fork/exec /app/storage/cwd/jaguarliuu/rookie_data_alchemy-0.0.4@94581419ef8404cea60ecd3497f634cd6f0aad4cc84aa7dd8d6c3feb962e8add/.venv/bin/python: no such file or directory 2025/06/06 01:19:57 run.go:108: [INFO]plugin jaguarliuu/rookie_data_alchemy:0.0.4 stopped 2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: junjiem/mcp_see_agent:0.1.10 2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin junjiem/mcp_see_agent:0.1.10 2025/06/06 01:19:57 run.go:108: [INFO]plugin junjiem/mcp_see_agent:0.1.10 stopped 2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: langgenius/agent:0.0.15 2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin langgenius/agent:0.0.15 2025/06/06 01:19:57 run.go:108: [INFO]plugin langgenius/agent:0.0.15 stopped 2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: langgenius/echarts:0.0.1 2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin langgenius/echarts:0.0.1 2025/06/06 01:19:57 environment_python.go:51: [ERROR]failed to patch the plugin sdk: failed to get the path of the plugin sdk: fork/exec /app/storage/cwd/langgenius/echarts-0.0.1@e390de4320a5ab32ef24899983f84c31aa39e4690c7b294be11f2c10268c3a68/.venv/bin/python: no such file or directory 2025/06/06 01:19:57 run.go:108: [INFO]plugin langgenius/echarts:0.0.1 stopped [gnet] 2025-06-06T01:19:57.408097673Z INFO logging/logger.go:256 Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:15004 2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: langgenius/openai_api_compatible:0.0.16 2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin langgenius/openai_api_compatible:0.0.16 2025/06/06 01:19:57 run.go:108: [INFO]plugin langgenius/openai_api_compatible:0.0.16 stopped 2025/06/06 01:19:57 full_duplex.go:27: [INFO]new plugin logged in: svcvit/artifacts:0.0.3 2025/06/06 01:19:57 full_duplex.go:59: [INFO]init environment for plugin svcvit/artifacts:0.0.3 2025/06/06 01:19:57 environment_python.go:363: [ERROR]failed to get the version of the plugin sdk: failed to find the version of the plugin sdk 2025/06/06 01:19:57 run.go:108: [INFO]plugin svcvit/artifacts:0.0.3 stopped 2025/06/06 01:20:27 cluster_lifetime.go:113: [INFO]current node has become the master of the cluster 2025/06/06 01:20:27 node.go:213: [INFO]node f55e0f7d-ee69-4fcb-873f-5e8036a90daa has been removed from the cluster due to being disconnected 2025/06/06 01:20:27 node.go:213: [INFO]node 89c5b230-f90e-426f-9346-eddbc8d2e394 has been removed from the cluster due to being disconnected [GIN] 2025/06/06 - 01:21:50 | 200 | 1.661672ms | 172.30.5.9 | POST "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/debugging/key" [GIN] 2025/06/06 - 01:21:50 | 200 | 17.748246ms | 172.30.5.9 | GET "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/list?page=1&page_size=256" [GIN] 2025/06/06 - 01:21:50 | 200 | 20.336047ms | 172.30.5.9 | GET "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/list?page=1&page_size=100" [GIN] 2025/06/06 - 01:21:50 | 200 | 1.541117ms | 172.30.5.9 | GET "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/install/tasks?page=1&page_size=100" [GIN] 2025/06/06 - 01:21:52 | 200 | 2.229469ms | 172.30.5.9 | GET "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256" [GIN] 2025/06/06 - 01:21:52 | 200 | 1.930297ms | 172.30.5.9 | GET "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256" [GIN] 2025/06/06 - 01:21:53 | 200 | 12.742784ms | 172.30.5.9 | GET "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256" [GIN] 2025/06/06 - 01:21:53 | 200 | 15.363199ms | 172.30.5.9 | GET "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/management/models?page=1&page_size=256" 2025/06/06 01:21:53 [Recovery] 2025/06/06 - 01:21:53 panic recovered: runtime error: invalid memory address or nil pointer dereference /usr/local/go/src/runtime/panic.go:262 (0x4768b8) /usr/local/go/src/runtime/signal_unix.go:917 (0x476888) /app/internal/core/plugin_manager/local_runtime/stdio.go:85 (0xdb8512) /app/internal/core/plugin_manager/local_runtime/io.go:16 (0xdb5e7a) [GIN] 2025/06/06 - 01:21:53 | 500 | 7.818864ms | 172.30.5.9 | POST "/plugin/69e27fb3-6219-47a7-b07c-0053f6c54d1c/dispatch/model/schema" /app/internal/core/plugin_daemon/generic.go:27 (0xfc0a36) /app/internal/core/plugin_daemon/model.gen.go:161 (0xfecceb) /app/internal/service/model.gen.go:210 (0xfeccd2) /app/internal/service/base_sse.go:116 (0xff6a9a) /app/internal/service/base_sse.go:44 (0xff6cfe) /app/internal/service/base_sse.go:114 (0xff69e4) /app/internal/service/model.gen.go:208 (0xfecc91) /app/internal/server/controllers/model.gen.go:163 (0x1cfb950) /app/internal/server/controllers/base.go:53 (0x101f5b4) /app/internal/server/controllers/base.go:31 (0x101fa34) /app/internal/server/controllers/base.go:37 (0x101f4b5) /app/internal/server/controllers/model.gen.go:160 (0x1cfb893) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a) /app/internal/server/middleware.go:170 (0x1cfe2d3) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a) /app/internal/server/middleware.go:97 (0x1cfe373) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a) /app/internal/server/middleware.go:66 (0x1d02171) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf75d0a) /app/internal/server/middleware.go:24 (0x1cfdb14) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8386e) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xf8385b) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf829a4) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xf8298b) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf81d91) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xf81800) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xf81331) /usr/local/go/src/net/http/server.go:3210 (0x7e062d) /usr/local/go/src/net/http/server.go:2092 (0x7bfb4f) /usr/local/go/src/runtime/asm_amd64.s:1700 (0x47caa0) ``` langgenius/openai_api_compatible version is 0.0.16
Author
Owner

@qq1002517 commented on GitHub (Jun 9, 2025):

@dosu,I want to know if it is necessary to have a Python environment when dify is running offline

@qq1002517 commented on GitHub (Jun 9, 2025): @dosu,I want to know if it is necessary to have a Python environment when dify is running offline
Author
Owner

@yang-y-f commented on GitHub (Jun 12, 2025):

hi. I meet the same question. Have you solved it?

@yang-y-f commented on GitHub (Jun 12, 2025): hi. I meet the same question. Have you solved it?
Author
Owner

@qq1002517 commented on GitHub (Jun 12, 2025):

hi. I meet the same question. Have you solved it?

It's a bad message,I can't solv it. and the plugin system is a big and bad idea. from 1.1.0 ,all question is it made.

@qq1002517 commented on GitHub (Jun 12, 2025): > hi. I meet the same question. Have you solved it? It's a bad message,I can't solv it. and the plugin system is a big and bad idea. from 1.1.0 ,all question is it made.
Author
Owner

@liyunhan commented on GitHub (Jun 20, 2025):

Meet same error!

@liyunhan commented on GitHub (Jun 20, 2025): Meet same error!
Author
Owner

@liyunhan commented on GitHub (Jun 20, 2025):

@dosu How to resolve this problem? Nobody cares?

@liyunhan commented on GitHub (Jun 20, 2025): @dosu How to resolve this problem? Nobody cares?
Author
Owner

@liyunhan commented on GitHub (Jun 20, 2025):

@qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系

@liyunhan commented on GitHub (Jun 20, 2025): @qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系
Author
Owner

@qq1002517 commented on GitHub (Jun 26, 2025):

@qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系

实验了,把软连都建起来重启一样。我这git抽风不定期能访问。

@qq1002517 commented on GitHub (Jun 26, 2025): > [@qq1002517](https://github.com/qq1002517) 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系 实验了,把软连都建起来重启一样。我这git抽风不定期能访问。
Author
Owner

@liyunhan commented on GitHub (Jun 26, 2025):

@qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系

实验了,把软连都建起来重启一样。我这git抽风不定期能访问。

别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行

@liyunhan commented on GitHub (Jun 26, 2025): > > [@qq1002517](https://github.com/qq1002517) 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系 > > 实验了,把软连都建起来重启一样。我这git抽风不定期能访问。 别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行
Author
Owner

@liyunhan commented on GitHub (Jun 26, 2025):

@qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系

实验了,把软连都建起来重启一样。我这git抽风不定期能访问。

别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行

当然我不确定你面对的问题是不是完全和我一样....至少从报错上看可能是一样的,我的确是解决了软链接就没再遇到这个问题。

@liyunhan commented on GitHub (Jun 26, 2025): > > > [@qq1002517](https://github.com/qq1002517) 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系 > > > > > > 实验了,把软连都建起来重启一样。我这git抽风不定期能访问。 > > 别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行 当然我不确定你面对的问题是不是完全和我一样....至少从报错上看可能是一样的,我的确是解决了软链接就没再遇到这个问题。
Author
Owner

@qq1002517 commented on GitHub (Jun 26, 2025):

@qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系

实验了,把软连都建起来重启一样。我这git抽风不定期能访问。

别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行

当然我不确定你面对的问题是不是完全和我一样....至少从报错上看可能是一样的,我的确是解决了软链接就没再遇到这个问题。

我明天试试 我当时用的是zip压缩,在服务器上解压之后发现软连接没了 所以重建了 但是并没解决问题。

@qq1002517 commented on GitHub (Jun 26, 2025): > > > > [@qq1002517](https://github.com/qq1002517) 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系 > > > > > > > > > 实验了,把软连都建起来重启一样。我这git抽风不定期能访问。 > > > > > > 别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行 > > 当然我不确定你面对的问题是不是完全和我一样....至少从报错上看可能是一样的,我的确是解决了软链接就没再遇到这个问题。 我明天试试 我当时用的是zip压缩,在服务器上解压之后发现软连接没了 所以重建了 但是并没解决问题。
Author
Owner

@AlexMoxie commented on GitHub (Jul 3, 2025):

set PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple in .env and reload dify

@AlexMoxie commented on GitHub (Jul 3, 2025): set PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple in .env and reload dify
Author
Owner

@qq1002517 commented on GitHub (Jul 3, 2025):

set PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple in .env and reload dify

I 'm offline。

@qq1002517 commented on GitHub (Jul 3, 2025): > set PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple in .env and reload dify I 'm offline。
Author
Owner

@AlexMoxie commented on GitHub (Jul 3, 2025):

set PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple in .env and reload dify

I 'm offline。

host a your own simple repository.

@AlexMoxie commented on GitHub (Jul 3, 2025): > > set PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple in .env and reload dify > > I 'm offline。 host a your own simple repository.
Author
Owner

@qq1002517 commented on GitHub (Jul 9, 2025):

@qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系

实验了,把软连都建起来重启一样。我这git抽风不定期能访问。

别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行

感谢,可以了。@all 离线就这么干。但是不要用zip 一定要用 tar -zcvf

@qq1002517 commented on GitHub (Jul 9, 2025): > > > [@qq1002517](https://github.com/qq1002517) 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系 > > > > > > 实验了,把软连都建起来重启一样。我这git抽风不定期能访问。 > > 别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行 感谢,可以了。@all 离线就这么干。但是不要用zip 一定要用 tar -zcvf
Author
Owner

@liyunhan commented on GitHub (Jul 10, 2025):

@qq1002517 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系

实验了,把软连都建起来重启一样。我这git抽风不定期能访问。

别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行

感谢,可以了。@ALL 离线就这么干。但是不要用zip 一定要用 tar -zcvf

哈哈,我一开始也是zip的,后面发现了这个情况就尝试用tar,心路历程都一样。

@liyunhan commented on GitHub (Jul 10, 2025): > > > > [@qq1002517](https://github.com/qq1002517) 我看了正常volumes下的目录结构,在plugin_daemon的,比如openai_api_compatible的.venv/bin目录下是有python -> /usr/bin/python3.12这样的软链接在,但是通过打包的方式迁移到目标机器时,这些软链接都丢了,不知道和这个有没有关系 > > > > > > > > > 实验了,把软连都建起来重启一样。我这git抽风不定期能访问。 > > > > > > 别在宿主机新建软链接,它的环境都在docker容器内,建软链接也要进容器内建才有可能建正确。我这边最后的解决方案是迁移时用tar czvf 打包整个dify的目录(里面应该包括vloumes这些各种目录,就是官方提供的那个docker文件夹),它会自动保留所有软链接,这样再docker compose up -d启动就没问题了。你可以再试试看行不行 > > 感谢,可以了。[@ALL](https://github.com/ALL) 离线就这么干。但是不要用zip 一定要用 tar -zcvf 哈哈,我一开始也是zip的,后面发现了这个情况就尝试用tar,心路历程都一样。
Author
Owner

@dosubot[bot] commented on GitHub (Aug 21, 2025):

Hi, @qq1002517. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that after migrating Dify 1.4.1 via Docker from Mac to Linux, your custom OpenAI-API compatible models did not appear.
  • The problem involved nil pointer dereference errors, likely due to missing or misconfigured data related to plugin Python virtual environments inside Docker volumes.
  • It was clarified that model data is stored in PostgreSQL tables under the dify schema, and verifying volume mounts and database contents is important.
  • Contributors suggested using tar instead of zip to migrate the entire Dify directory, preserving symlinks and Python virtual environments.
  • The issue was resolved by properly migrating with tar, ensuring plugin environments and custom models appeared correctly after migration.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of dify-official-plugins; if so, you can keep the discussion open by commenting here.
  • Otherwise, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 21, 2025): Hi, @qq1002517. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that after migrating Dify 1.4.1 via Docker from Mac to Linux, your custom OpenAI-API compatible models did not appear. - The problem involved nil pointer dereference errors, likely due to missing or misconfigured data related to plugin Python virtual environments inside Docker volumes. - It was clarified that model data is stored in PostgreSQL tables under the dify schema, and verifying volume mounts and database contents is important. - Contributors suggested using tar instead of zip to migrate the entire Dify directory, preserving symlinks and Python virtual environments. - The issue was resolved by properly migrating with tar, ensuring plugin environments and custom models appeared correctly after migration. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of dify-official-plugins; if so, you can keep the discussion open by commenting here. - Otherwise, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Author
Owner

@outhereter commented on GitHub (Sep 5, 2025):

@qq1002517 @liyunhan
这几天我也遇到了同样的问题,感觉上在有些硬件环境下,不一定会发生这个问题。
不知道是硬件问题,还是在特定的硬件下plugin才会发生问题,我感到很困惑。

首先,我把下面的参数已经设置得很大了,但是后台log来看并没有等待这么久,我感觉最多等了不到5分钟就报错了,并没有等满到我设置的时间(也许不是这个地方起作用)。
PLUGIN_PYTHON_ENV_INIT_TIMEOUT=3200
PLUGIN_MAX_EXECUTION_TIMEOUT=3200

另外,不管是在windows,linux(wsl 虚拟环境)下,.venv都不会被打进zip,7z,tar里面怎么都会报错(不知道是不是我方法不对)。

我是半个月前才开始使用接触dify,以及docker来做一个客户的调研任务,所以下面解决办法,只是我的个人操做的结果,
不代表是一定就是客观事实,仅供参考。
请注意我的办法,只是让它跑起来了,感觉方法很恶心,但是没法要交差,出此下策


下面是我的恶心办法

注意: 下面的Step2開始的所有步骤都要全程启动着docker-plugin_daemon-1容器,只到插件正常安装完毕

Step1. plugin_daemon 下的volumes里加一个临时的文件夹后,docker compose down -> up -d
volumes:
- ./volumes/plugin_daemon:/app/storage <- 缺省的
- ./volumes/plugin_daemon_tmp:/app/storage_tmp <- 新加的

Step2. 进入docker的docker-plugin_daemon-1容器的bash命令行,建立临时plugin构造venv环境的目录,复制原始目录里除了.venv文件夹以外的所有内容
※我把关键的执行内容贴上来(linux也不太懂,完全是试出来的)
执行:
docker exec -it docker-plugin_daemon-1 /bin/bash

进来后是下面这个样子:

root@cbf021e1dfa7:/app# ls
entrypoint.sh main storage storage_tmp

mkdir -p storage_tmp/azure_openai
root@cbf021e1dfa7:/app/storage/cwd/langgenius/azure_openai-0.0.28@9b0339feb86b34393abd921e9cc906192fc46daad3a0f15c1d2a35ba20e8f704# tar --exclude='./.venv' -cf - . | (cd /app/storage_tmp/azure_openai && tar -xf -)

这里有点慢,执行完了会有下面的样子:

root@cbf021e1dfa7:/app/storage_tmp/azure_openai# ls -l -a
total 4
drwxr-xr-x 1 root root 512 Sep 5 04:36 .
drwxrwxrwx 1 root root 512 Sep 5 04:34 ..
-rw-r--r-- 1 root root 145 Sep 5 04:28 .env.example
-rw-r--r-- 1 root root 36 Sep 5 04:28 .verification.dify.json
-rw-r--r-- 1 root root 734 Sep 5 04:28 README.md
drwxr-xr-x 1 root root 512 Sep 5 04:28 _assets
-rw-r--r-- 1 root root 125 Sep 5 04:28 main.py
-rw-r--r-- 1 root root 463 Sep 5 04:28 manifest.yaml
drwxr-xr-x 1 root root 512 Sep 5 04:28 models
drwxr-xr-x 1 root root 512 Sep 5 04:28 provider
-rw-r--r-- 1 root root 85 Sep 5 04:28 requirements.tx

Step3. 手动启动虚拟环境,并手动安装package
root@cbf021e1dfa7:/app/storage_tmp/azure_openai# source .venv/bin/activate
(.venv) root@cbf021e1dfa7:/app/storage_tmp/azure_openai# uv pip install -r requirements.txt
不知道是不是公司网络限制,非常的慢,我花了一个小时,才执行完,下面的样子:

Resolved 45 packages in 1.53s
Prepared 16 packages in 2.20s
Installed 45 packages in 60m 30s

  • annotated-types==0.7.0
  • anyio==4.10.0
  • blinker==1.9.0
  • certifi==2025.8.3
  • charset-normalizer==3.4.3
  • click==8.2.1
  • dify-plugin==0.4.4
  • distro==1.9.0
  • dpkt==1.9.8
  • flask==3.0.3
  • gevent==25.5.1
  • greenlet==3.2.4
  • h11==0.16.0
  • httpcore==1.0.9
  • httpx==0.28.1
  • idna==3.10
  • itsdangerous==2.2.0
  • jinja2==3.1.6
  • jiter==0.10.0
  • markupsafe==3.0.2
  • multidict==6.6.4
  • numpy==2.2.6
  • openai==1.99.9
  • packaging==25.0
  • pillow==11.2.1
  • propcache==0.3.2
  • pydantic==2.11.7
  • pydantic-core==2.33.2
  • pydantic-settings==2.10.1
  • python-dotenv==1.1.1
  • pyyaml==6.0.2
  • regex==2025.9.1
  • requests==2.32.5
  • setuptools==80.9.0
  • sniffio==1.3.1
  • socksio==1.0.0
  • tiktoken==0.8.0
  • tqdm==4.67.1
  • typing-extensions==4.15.0
  • typing-inspection==0.4.1
  • urllib3==2.5.0
  • werkzeug==3.0.6
  • yarl==1.20.1
  • zope-event==5.1.1
  • zope-interface==7.2

Step4. 手动把零时文件夹的package文件夹拷贝到,真正的plugin文件夹里面去
① .venv\lib\python3.12\site-packages
Dify_Work\dify\docker\volumes\plugin_daemon_tmp\azure_openai.venv\lib\python3.12\site-packages

C:\Users\Z-ROOSTER03\Desktop\Dify_Work\dify\docker\volumes\plugin_daemon\cwd\langgenius\azure_openai-0.0.28@9b0339feb86b34393abd921e9cc906192fc46daad3a0f15c1d2a35ba20e8f704.venv\lib\python3.12\site-packages
※我linux不熟,直接通过windows的文件夹拷贝进行的,这一步可能因为文件路径太长了,有一些版权声明文件放不进去我就无视了

② .venv\include (这个目录我在我的原始目录里没有,所以也拷贝了,有没有用不知道)
C:\Users\Z-ROOSTER03\Desktop\Dify_Work\dify\docker\volumes\plugin_daemon_tmp\azure_openai.venv\include

C:\Users\Z-ROOSTER03\Desktop\Dify_Work\dify\docker\volumes\plugin_daemon\cwd\langgenius\azure_openai-0.0.28@9b0339feb86b34393abd921e9cc906192fc46daad3a0f15c1d2a35ba20e8f704.venv\include

Step5. 等待plugin预编译
我的windows desktop 的log如下表示:
※到我拷贝中,plugin也同时在尝试初始化,但是当拷贝完时,我看见了 "[INFO]pre-compiling langgenius/azure_openai:0.0.28" 开始的log, 知道最后的成功。我在画面上的插件也正常能运行了。

2025-09-05 14:40:32.429 | 2025/09/05 05:40:32 full_duplex.go:59: [INFO]init environment for plugin langgenius/azure_openai:0.0.28
2025-09-05 14:50:47.958 | 2025/09/05 05:50:47 full_duplex.go:65: [ERROR]init environment failed: failed to install dependencies: signal: killed, output: Resolved 45 packages in 2.77s
2025-09-05 14:50:47.959 | warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
2025-09-05 14:50:47.959 | If the cache and target directories are on different filesystems, hardlinking may not be supported.
2025-09-05 14:50:47.959 | If this is intentional, set export UV_LINK_MODE=copy or use --link-mode=copy to suppress this warning.
2025-09-05 14:50:47.959 | , retrying
2025-09-05 14:50:47.959 | 2025/09/05 05:50:47 full_duplex.go:29: [INFO]plugin langgenius/azure_openai:0.0.28 has exited
2025-09-05 14:50:47.959 | 2025/09/05 05:50:47 watcher.go:87: [ERROR]plugin launch error: init environment for plugin langgenius/azure_openai:0.0.28 failed too many times, you should consider the package is corrupted or your network is unstable
2025-09-05 14:51:07.575 | 2025/09/05 05:51:07 full_duplex.go:27: [INFO]new plugin logged in: langgenius/azure_openai:0.0.28
2025-09-05 14:51:07.575 | 2025/09/05 05:51:07 full_duplex.go:59: [INFO]init environment for plugin langgenius/azure_openai:0.0.28
2025-09-05 15:00:09.425 | 2025/09/05 06:00:09 pool.go:32: [INFO]init routine pool, size: 10000
2025-09-05 15:00:10.224 |
2025-09-05 15:00:10.224 | 2025/09/05 06:00:10 /app/internal/db/init.go:12 SLOW SQL >= 200ms
2025-09-05 15:00:10.224 | [323.398ms] [rows:1] SELECT count(*) FROM information_schema.tables WHERE table_schema = CURRENT_SCHEMA() AND table_name = 'plugins' AND table_type = 'BASE TABLE'
2025-09-05 15:00:10.518 |
2025-09-05 15:00:10.518 | 2025/09/05 06:00:10 /app/internal/db/init.go:12 SLOW SQL >= 200ms
2025-09-05 15:00:10.518 | [234.497ms] [rows:-] SELECT c.column_name, c.is_nullable = 'YES', c.udt_name, c.character_maximum_length, c.numeric_precision, c.numeric_precision_radix, c.numeric_scale, c.datetime_precision, 8 * typlen, c.column_default, pd.description, c.identity_increment FROM information_schema.columns AS c JOIN pg_type AS pgt ON c.udt_name = pgt.typname LEFT JOIN pg_catalog.pg_description as pd ON pd.objsubid = c.ordinal_position AND pd.objoid = (SELECT oid FROM pg_catalog.pg_class WHERE relname = c.table_name AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = c.table_schema)) where table_catalog = 'dify_plugin' AND table_schema = CURRENT_SCHEMA() AND table_name = 'plugins'
2025-09-05 15:00:12.297 | 2025/09/05 06:00:12 init.go:103: [INFO]dify plugin db initialized
2025-09-05 15:00:12.298 | 2025/09/05 06:00:12 manager.go:113: [INFO]start plugin manager daemon...
2025-09-05 15:00:12.303 | 2025/09/05 06:00:12 watcher.go:16: [INFO]start to handle new plugins in path: plugin
2025-09-05 15:00:12.306 | 2025/09/05 06:00:12 init.go:20: [INFO]Persistence initialized
2025-09-05 15:00:12.407 | [gnet] 2025-09-05T06:00:12.407531295Z INFO logging/logger.go:256 Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:5003
2025-09-05 15:00:12.501 | 2025/09/05 06:00:12 full_duplex.go:27: [INFO]new plugin logged in: langgenius/azure_openai:0.0.28
2025-09-05 15:00:12.501 | 2025/09/05 06:00:12 full_duplex.go:59: [INFO]init environment for plugin langgenius/azure_openai:0.0.28
2025-09-05 15:00:12.808 | 2025/09/05 06:00:12 cluster_lifetime.go:113: [INFO]current node has become the master of the cluster
2025-09-05 15:00:22.332 | 2025/09/05 06:00:22 node.go:213: [INFO]node b3811be2-c97e-4ad7-8372-343a91239ae7 has been removed from the cluster due to being disconnected
2025-09-05 15:04:25.994 | 2025/09/05 06:04:25 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing '.'......
2025-09-05 15:04:37.607 | 2025/09/05 06:04:37 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info'......
2025-09-05 15:04:46.445 | 2025/09/05 06:04:46 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/dify_plugin/core/__init__.py'......
2025-09-05 15:05:00.585 | 2025/09/05 06:05:00 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/dify_plugin/interfaces/model/openai_compatible/provider.py'......
2025-09-05 15:05:10.370 | 2025/09/05 06:05:10 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/dpkt/ppp.py'......
2025-09-05 15:05:22.755 | 2025/09/05 06:05:22 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/gevent/monkey/_patch_thread_gte313.py'......
2025-09-05 15:05:32.832 | 2025/09/05 06:05:32 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/gevent/tests/test__events.py'......
2025-09-05 15:05:42.712 | 2025/09/05 06:05:42 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/gevent/tests/test__threading_monkey_in_thread.py'......
2025-09-05 15:05:54.429 | 2025/09/05 06:05:54 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/httpx/_client.py'......
2025-09-05 15:06:06.620 | 2025/09/05 06:06:06 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/numpy/_core/lib'......
2025-09-05 15:06:16.993 | 2025/09/05 06:06:16 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/numpy/_pyinstaller/tests/pyinstaller-smoke.py'......
2025-09-05 15:06:27.840 | 2025/09/05 06:06:27 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/numpy/f2py/tests/src/routines'......
2025-09-05 15:06:39.750 | 2025/09/05 06:06:39 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/numpy/lib/tests/test_shape_base.py'......
2025-09-05 15:06:52.292 | 2025/09/05 06:06:52 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/numpy/testing/__init__.py'......
2025-09-05 15:07:03.941 | 2025/09/05 06:07:03 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/openai/_utils'......
2025-09-05 15:07:10.370 | 2025/09/05 06:07:10 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/resources/chat/completions/messages.py'......
2025-09-05 15:07:19.487 | 2025/09/05 06:07:19 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_function_param.py'......
2025-09-05 15:07:28.768 | 2025/09/05 06:07:28 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/beta/realtime/session.py'......
2025-09-05 15:07:35.884 | 2025/09/05 06:07:35 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/beta/threads/text_content_block_param.py'......
2025-09-05 15:07:46.455 | 2025/09/05 06:07:46 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/eval_create_params.py'......
2025-09-05 15:07:55.802 | 2025/09/05 06:07:55 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/graders/score_model_grader.py'......
2025-09-05 15:08:04.298 | 2025/09/05 06:08:04 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/responses/response_format_text_config_param.py'......
2025-09-05 15:08:13.968 | 2025/09/05 06:08:13 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/responses/response_web_search_call_searching_event.py'......
2025-09-05 15:08:22.588 | 2025/09/05 06:08:22 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/webhooks/eval_run_canceled_webhook_event.py'......
2025-09-05 15:08:32.412 | 2025/09/05 06:08:32 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/pydantic/_internal/_validators.py'......
2025-09-05 15:08:43.103 | 2025/09/05 06:08:43 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/pydantic_settings/sources/providers/secrets.py'......
2025-09-05 15:08:51.439 | 2025/09/05 06:08:51 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py'......
2025-09-05 15:08:59.775 | 2025/09/05 06:08:59 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/setuptools/_vendor/importlib_metadata/_itertools.py'......
2025-09-05 15:09:11.384 | 2025/09/05 06:09:11 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info'......
2025-09-05 15:09:20.716 | 2025/09/05 06:09:20 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/setuptools/discovery.py'......
2025-09-05 15:09:31.337 | 2025/09/05 06:09:31 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/socksio/_types.py'......
2025-09-05 15:09:42.059 | 2025/09/05 06:09:42 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/werkzeug/datastructures/accept.py'......
2025-09-05 15:09:47.267 | 2025/09/05 06:09:47 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/zope/interface/common/tests/test_builtins.py'......
2025-09-05 15:09:47.299 | 2025/09/05 06:09:47 environment_python.go:333: [INFO]pre-loaded the plugin langgenius/azure_openai:0.0.28
2025-09-05 15:09:56.333 | 2025/09/05 06:09:56 run.go:147: [INFO]plugin langgenius/azure_openai:0.0.28 started
2025-09-05 15:09:56.350 | 2025/09/05 06:09:56 full_duplex.go:27: [INFO]new plugin logged in: langgenius/json_process:0.0.2
2025-09-05 15:09:56.351 | 2025/09/05 06:09:56 full_duplex.go:59: [INFO]init environment for plugin langgenius/json_process:0.0.2
2025-09-05 15:09:57.045 | 2025/09/05 06:09:57 run.go:147: [INFO]plugin langgenius/json_process:0.0.2 started
2025-09-05 15:10:09.699 | 2025/09/05 06:10:09 stdio.go:173: [INFO]plugin langgenius/json_process:0.0.2: Installed tool: json_process
2025-09-05 15:10:15.913 | 2025/09/05 06:10:15 stdio.go:173: [INFO]plugin langgenius/azure_openai:0.0.28: Installed model: azure_openai

@outhereter commented on GitHub (Sep 5, 2025): @qq1002517 @liyunhan 这几天我也遇到了同样的问题,感觉上在有些硬件环境下,不一定会发生这个问题。 不知道是硬件问题,还是在特定的硬件下plugin才会发生问题,我感到很困惑。 首先,我把下面的参数已经设置得很大了,但是后台log来看并没有等待这么久,我感觉最多等了不到5分钟就报错了,并没有等满到我设置的时间(也许不是这个地方起作用)。 PLUGIN_PYTHON_ENV_INIT_TIMEOUT=3200 PLUGIN_MAX_EXECUTION_TIMEOUT=3200 另外,不管是在windows,linux(wsl 虚拟环境)下,.venv都不会被打进zip,7z,tar里面怎么都会报错(不知道是不是我方法不对)。 我是半个月前才开始使用接触dify,以及docker来做一个客户的调研任务,所以下面解决办法,只是我的个人操做的结果, 不代表是一定就是客观事实,仅供参考。 **请注意我的办法,只是让它跑起来了,感觉方法很恶心,但是没法要交差,出此下策** --- ### 下面是我的恶心办法 **注意: 下面的Step2開始的所有步骤都要全程启动着docker-plugin_daemon-1容器**,只到插件正常安装完毕 **Step1. plugin_daemon 下的volumes里加一个临时的文件夹后,docker compose down -> up -d** volumes: - ./volumes/plugin_daemon:/app/storage <- 缺省的 - ./volumes/plugin_daemon_tmp:/app/storage_tmp <- 新加的 **Step2. 进入docker的docker-plugin_daemon-1容器的bash命令行,建立临时plugin构造venv环境的目录,复制原始目录里除了.venv文件夹以外的所有内容** ※我把关键的执行内容贴上来(linux也不太懂,完全是试出来的) 执行: docker exec -it docker-plugin_daemon-1 /bin/bash 进来后是下面这个样子: > root@cbf021e1dfa7:/app# ls > entrypoint.sh main storage storage_tmp mkdir -p storage_tmp/azure_openai root@cbf021e1dfa7:/app/storage/cwd/langgenius/azure_openai-0.0.28@9b0339feb86b34393abd921e9cc906192fc46daad3a0f15c1d2a35ba20e8f704# tar --exclude='./.venv' -cf - . | (cd /app/storage_tmp/azure_openai && tar -xf -) 这里有点慢,执行完了会有下面的样子: > root@cbf021e1dfa7:/app/storage_tmp/azure_openai# ls -l -a > total 4 > drwxr-xr-x 1 root root 512 Sep 5 04:36 . > drwxrwxrwx 1 root root 512 Sep 5 04:34 .. > -rw-r--r-- 1 root root 145 Sep 5 04:28 .env.example > -rw-r--r-- 1 root root 36 Sep 5 04:28 .verification.dify.json > -rw-r--r-- 1 root root 734 Sep 5 04:28 README.md > drwxr-xr-x 1 root root 512 Sep 5 04:28 _assets > -rw-r--r-- 1 root root 125 Sep 5 04:28 main.py > -rw-r--r-- 1 root root 463 Sep 5 04:28 manifest.yaml > drwxr-xr-x 1 root root 512 Sep 5 04:28 models > drwxr-xr-x 1 root root 512 Sep 5 04:28 provider > -rw-r--r-- 1 root root 85 Sep 5 04:28 requirements.tx **Step3. 手动启动虚拟环境,并手动安装package** root@cbf021e1dfa7:/app/storage_tmp/azure_openai# source .venv/bin/activate (.venv) root@cbf021e1dfa7:/app/storage_tmp/azure_openai# uv pip install -r requirements.txt 不知道是不是公司网络限制,非常的慢,我花了一个小时,才执行完,下面的样子: > Resolved 45 packages in 1.53s > Prepared 16 packages in 2.20s > Installed 45 packages in 60m 30s > + annotated-types==0.7.0 > + anyio==4.10.0 > + blinker==1.9.0 > + certifi==2025.8.3 > + charset-normalizer==3.4.3 > + click==8.2.1 > + dify-plugin==0.4.4 > + distro==1.9.0 > + dpkt==1.9.8 > + flask==3.0.3 > + gevent==25.5.1 > + greenlet==3.2.4 > + h11==0.16.0 > + httpcore==1.0.9 > + httpx==0.28.1 > + idna==3.10 > + itsdangerous==2.2.0 > + jinja2==3.1.6 > + jiter==0.10.0 > + markupsafe==3.0.2 > + multidict==6.6.4 > + numpy==2.2.6 > + openai==1.99.9 > + packaging==25.0 > + pillow==11.2.1 > + propcache==0.3.2 > + pydantic==2.11.7 > + pydantic-core==2.33.2 > + pydantic-settings==2.10.1 > + python-dotenv==1.1.1 > + pyyaml==6.0.2 > + regex==2025.9.1 > + requests==2.32.5 > + setuptools==80.9.0 > + sniffio==1.3.1 > + socksio==1.0.0 > + tiktoken==0.8.0 > + tqdm==4.67.1 > + typing-extensions==4.15.0 > + typing-inspection==0.4.1 > + urllib3==2.5.0 > + werkzeug==3.0.6 > + yarl==1.20.1 > + zope-event==5.1.1 > + zope-interface==7.2 **Step4. 手动把零时文件夹的package文件夹拷贝到,真正的plugin文件夹里面去** ① .venv\lib\python3.12\site-packages Dify_Work\dify\docker\volumes\plugin_daemon_tmp\azure_openai\.venv\lib\python3.12\site-packages ↓ C:\Users\Z-ROOSTER03\Desktop\Dify_Work\dify\docker\volumes\plugin_daemon\cwd\langgenius\azure_openai-0.0.28@9b0339feb86b34393abd921e9cc906192fc46daad3a0f15c1d2a35ba20e8f704\.venv\lib\python3.12\site-packages ※我linux不熟,直接通过windows的文件夹拷贝进行的,这一步可能因为文件路径太长了,有一些版权声明文件放不进去我就无视了 ② .venv\include (这个目录我在我的原始目录里没有,所以也拷贝了,有没有用不知道) C:\Users\Z-ROOSTER03\Desktop\Dify_Work\dify\docker\volumes\plugin_daemon_tmp\azure_openai\.venv\include ↓ C:\Users\Z-ROOSTER03\Desktop\Dify_Work\dify\docker\volumes\plugin_daemon\cwd\langgenius\azure_openai-0.0.28@9b0339feb86b34393abd921e9cc906192fc46daad3a0f15c1d2a35ba20e8f704\.venv\include **Step5. 等待plugin预编译** 我的windows desktop 的log如下表示: ※到我拷贝中,plugin也同时在尝试初始化,但是当拷贝完时,我看见了 "[INFO]pre-compiling langgenius/azure_openai:0.0.28" 开始的log, 知道最后的成功。我在画面上的插件也正常能运行了。 > 2025-09-05 14:40:32.429 | 2025/09/05 05:40:32 full_duplex.go:59: [INFO]init environment for plugin langgenius/azure_openai:0.0.28 > 2025-09-05 14:50:47.958 | 2025/09/05 05:50:47 full_duplex.go:65: [ERROR]init environment failed: failed to install dependencies: signal: killed, output: Resolved 45 packages in 2.77s > 2025-09-05 14:50:47.959 | warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance. > 2025-09-05 14:50:47.959 | If the cache and target directories are on different filesystems, hardlinking may not be supported. > 2025-09-05 14:50:47.959 | If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning. > 2025-09-05 14:50:47.959 | , retrying > 2025-09-05 14:50:47.959 | 2025/09/05 05:50:47 full_duplex.go:29: [INFO]plugin langgenius/azure_openai:0.0.28 has exited > 2025-09-05 14:50:47.959 | 2025/09/05 05:50:47 watcher.go:87: [ERROR]plugin launch error: init environment for plugin langgenius/azure_openai:0.0.28 failed too many times, you should consider the package is corrupted or your network is unstable > 2025-09-05 14:51:07.575 | 2025/09/05 05:51:07 full_duplex.go:27: [INFO]new plugin logged in: langgenius/azure_openai:0.0.28 > 2025-09-05 14:51:07.575 | 2025/09/05 05:51:07 full_duplex.go:59: [INFO]init environment for plugin langgenius/azure_openai:0.0.28 > 2025-09-05 15:00:09.425 | 2025/09/05 06:00:09 pool.go:32: [INFO]init routine pool, size: 10000 > 2025-09-05 15:00:10.224 | > 2025-09-05 15:00:10.224 | 2025/09/05 06:00:10 /app/internal/db/init.go:12 SLOW SQL >= 200ms > 2025-09-05 15:00:10.224 | [323.398ms] [rows:1] SELECT count(*) FROM information_schema.tables WHERE table_schema = CURRENT_SCHEMA() AND table_name = 'plugins' AND table_type = 'BASE TABLE' > 2025-09-05 15:00:10.518 | > 2025-09-05 15:00:10.518 | 2025/09/05 06:00:10 /app/internal/db/init.go:12 SLOW SQL >= 200ms > 2025-09-05 15:00:10.518 | [234.497ms] [rows:-] SELECT c.column_name, c.is_nullable = 'YES', c.udt_name, c.character_maximum_length, c.numeric_precision, c.numeric_precision_radix, c.numeric_scale, c.datetime_precision, 8 * typlen, c.column_default, pd.description, c.identity_increment FROM information_schema.columns AS c JOIN pg_type AS pgt ON c.udt_name = pgt.typname LEFT JOIN pg_catalog.pg_description as pd ON pd.objsubid = c.ordinal_position AND pd.objoid = (SELECT oid FROM pg_catalog.pg_class WHERE relname = c.table_name AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = c.table_schema)) where table_catalog = 'dify_plugin' AND table_schema = CURRENT_SCHEMA() AND table_name = 'plugins' > 2025-09-05 15:00:12.297 | 2025/09/05 06:00:12 init.go:103: [INFO]dify plugin db initialized > 2025-09-05 15:00:12.298 | 2025/09/05 06:00:12 manager.go:113: [INFO]start plugin manager daemon... > 2025-09-05 15:00:12.303 | 2025/09/05 06:00:12 watcher.go:16: [INFO]start to handle new plugins in path: plugin > 2025-09-05 15:00:12.306 | 2025/09/05 06:00:12 init.go:20: [INFO]Persistence initialized > 2025-09-05 15:00:12.407 | [gnet] 2025-09-05T06:00:12.407531295Z INFO logging/logger.go:256 Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:5003 > 2025-09-05 15:00:12.501 | 2025/09/05 06:00:12 full_duplex.go:27: [INFO]new plugin logged in: langgenius/azure_openai:0.0.28 > 2025-09-05 15:00:12.501 | 2025/09/05 06:00:12 full_duplex.go:59: [INFO]init environment for plugin langgenius/azure_openai:0.0.28 > 2025-09-05 15:00:12.808 | 2025/09/05 06:00:12 cluster_lifetime.go:113: [INFO]current node has become the master of the cluster > 2025-09-05 15:00:22.332 | 2025/09/05 06:00:22 node.go:213: [INFO]node b3811be2-c97e-4ad7-8372-343a91239ae7 has been removed from the cluster due to being disconnected > 2025-09-05 15:04:25.994 | 2025/09/05 06:04:25 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing '.'...... > 2025-09-05 15:04:37.607 | 2025/09/05 06:04:37 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info'...... > 2025-09-05 15:04:46.445 | 2025/09/05 06:04:46 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/dify_plugin/core/__init__.py'...... > 2025-09-05 15:05:00.585 | 2025/09/05 06:05:00 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/dify_plugin/interfaces/model/openai_compatible/provider.py'...... > 2025-09-05 15:05:10.370 | 2025/09/05 06:05:10 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/dpkt/ppp.py'...... > 2025-09-05 15:05:22.755 | 2025/09/05 06:05:22 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/gevent/monkey/_patch_thread_gte313.py'...... > 2025-09-05 15:05:32.832 | 2025/09/05 06:05:32 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/gevent/tests/test__events.py'...... > 2025-09-05 15:05:42.712 | 2025/09/05 06:05:42 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/gevent/tests/test__threading_monkey_in_thread.py'...... > 2025-09-05 15:05:54.429 | 2025/09/05 06:05:54 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/httpx/_client.py'...... > 2025-09-05 15:06:06.620 | 2025/09/05 06:06:06 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/numpy/_core/lib'...... > 2025-09-05 15:06:16.993 | 2025/09/05 06:06:16 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/numpy/_pyinstaller/tests/pyinstaller-smoke.py'...... > 2025-09-05 15:06:27.840 | 2025/09/05 06:06:27 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/numpy/f2py/tests/src/routines'...... > 2025-09-05 15:06:39.750 | 2025/09/05 06:06:39 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/numpy/lib/tests/test_shape_base.py'...... > 2025-09-05 15:06:52.292 | 2025/09/05 06:06:52 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/numpy/testing/__init__.py'...... > 2025-09-05 15:07:03.941 | 2025/09/05 06:07:03 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/openai/_utils'...... > 2025-09-05 15:07:10.370 | 2025/09/05 06:07:10 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/resources/chat/completions/messages.py'...... > 2025-09-05 15:07:19.487 | 2025/09/05 06:07:19 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_function_param.py'...... > 2025-09-05 15:07:28.768 | 2025/09/05 06:07:28 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/beta/realtime/session.py'...... > 2025-09-05 15:07:35.884 | 2025/09/05 06:07:35 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/beta/threads/text_content_block_param.py'...... > 2025-09-05 15:07:46.455 | 2025/09/05 06:07:46 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/eval_create_params.py'...... > 2025-09-05 15:07:55.802 | 2025/09/05 06:07:55 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/graders/score_model_grader.py'...... > 2025-09-05 15:08:04.298 | 2025/09/05 06:08:04 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/responses/response_format_text_config_param.py'...... > 2025-09-05 15:08:13.968 | 2025/09/05 06:08:13 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/responses/response_web_search_call_searching_event.py'...... > 2025-09-05 15:08:22.588 | 2025/09/05 06:08:22 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/openai/types/webhooks/eval_run_canceled_webhook_event.py'...... > 2025-09-05 15:08:32.412 | 2025/09/05 06:08:32 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/pydantic/_internal/_validators.py'...... > 2025-09-05 15:08:43.103 | 2025/09/05 06:08:43 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/pydantic_settings/sources/providers/secrets.py'...... > 2025-09-05 15:08:51.439 | 2025/09/05 06:08:51 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py'...... > 2025-09-05 15:08:59.775 | 2025/09/05 06:08:59 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/setuptools/_vendor/importlib_metadata/_itertools.py'...... > 2025-09-05 15:09:11.384 | 2025/09/05 06:09:11 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Listing './.venv/lib/python3.12/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info'...... > 2025-09-05 15:09:20.716 | 2025/09/05 06:09:20 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/setuptools/discovery.py'...... > 2025-09-05 15:09:31.337 | 2025/09/05 06:09:31 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/socksio/_types.py'...... > 2025-09-05 15:09:42.059 | 2025/09/05 06:09:42 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/werkzeug/datastructures/accept.py'...... > 2025-09-05 15:09:47.267 | 2025/09/05 06:09:47 environment_python.go:300: [INFO]pre-compiling langgenius/azure_openai:0.0.28 - Compiling './.venv/lib/python3.12/site-packages/zope/interface/common/tests/test_builtins.py'...... > 2025-09-05 15:09:47.299 | 2025/09/05 06:09:47 environment_python.go:333: [INFO]pre-loaded the plugin langgenius/azure_openai:0.0.28 > 2025-09-05 15:09:56.333 | 2025/09/05 06:09:56 run.go:147: [INFO]plugin langgenius/azure_openai:0.0.28 started > 2025-09-05 15:09:56.350 | 2025/09/05 06:09:56 full_duplex.go:27: [INFO]new plugin logged in: langgenius/json_process:0.0.2 > 2025-09-05 15:09:56.351 | 2025/09/05 06:09:56 full_duplex.go:59: [INFO]init environment for plugin langgenius/json_process:0.0.2 > 2025-09-05 15:09:57.045 | 2025/09/05 06:09:57 run.go:147: [INFO]plugin langgenius/json_process:0.0.2 started > 2025-09-05 15:10:09.699 | 2025/09/05 06:10:09 stdio.go:173: [INFO]plugin langgenius/json_process:0.0.2: Installed tool: json_process > 2025-09-05 15:10:15.913 | 2025/09/05 06:10:15 stdio.go:173: [INFO]plugin langgenius/azure_openai:0.0.28: Installed model: azure_openai
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#340