zhipuai:0.0.19 fails to start: ModuleNotFoundError: No module named 'sniffio' (.venv lacks pip and missing dependency declaration) #848

Closed
opened 2026-02-16 10:20:42 -05:00 by yindo · 6 comments
Owner

Originally created by @GDNDZZK on GitHub (Dec 3, 2025).

Originally assigned to: @hjlarry on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image 1. In the Dify admin console, go to Settings → Model Providers, and add ZhipuAI (智谱) as a model provider. 2. Enter a ZhipuAI API key and click Save.

✔️ Expected Behavior

After clicking Save with a ZhipuAI API key:

  • The system should either save successfully,
  • or show a clear error message if something goes wrong.
  • No silent failure.

Actual Behavior

  • The web UI shows no feedback — no loading spinner, no success banner, no error message. It appears as if nothing happened.
  • checking the backend:
    docker compose logs -f
    2025/12/03 07:43:21 run.go:135: [ERROR]plugin langgenius/zhipuai:0.0.19 exited with error: exit status 1 plugin_daemon-1 | odule> plugin_daemon-1 | plugin_daemon-1 | from ._base_models import BaseModel, construct_type plugin_daemon-1 | plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_base_models.py", line 39, in <module> plugin_daemon-1 | plugin_daemon-1 | from ._utils import ( plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_utils/__init__.py", line 1, in <module> plugin_daemon-1 | plugin_daemon-1 | from ._transform import ( plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_utils/_transform.py", line 26, in <module> plugin_daemon-1 | plugin_daemon-1 | from ._utils import ( plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_utils/_utils.py", line 22, in <module> plugin_daemon-1 | plugin_daemon-1 | import sniffio plugin_daemon-1 | plugin_daemon-1 | ModuleNotFoundError: No module named 'sniffio'
Originally created by @GDNDZZK on GitHub (Dec 3, 2025). Originally assigned to: @hjlarry on GitHub. ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce <img width="1008" height="218" alt="Image" src="https://github.com/user-attachments/assets/deebdbcd-a3da-48d1-b1a7-827836f4bfec" /> 1. In the Dify admin console, go to Settings → Model Providers, and add ZhipuAI (智谱) as a model provider. 2. Enter a ZhipuAI API key and click Save. ### ✔️ Expected Behavior After clicking Save with a ZhipuAI API key: - The system should either save successfully, - or show a clear error message if something goes wrong. - No silent failure. ### ❌ Actual Behavior - The web UI shows no feedback — no loading spinner, no success banner, no error message. It appears as if nothing happened. - checking the backend: `docker compose logs -f` `2025/12/03 07:43:21 run.go:135: [ERROR]plugin langgenius/zhipuai:0.0.19 exited with error: exit status 1 plugin_daemon-1 | odule> plugin_daemon-1 | plugin_daemon-1 | from ._base_models import BaseModel, construct_type plugin_daemon-1 | plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_base_models.py", line 39, in <module> plugin_daemon-1 | plugin_daemon-1 | from ._utils import ( plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_utils/__init__.py", line 1, in <module> plugin_daemon-1 | plugin_daemon-1 | from ._transform import ( plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_utils/_transform.py", line 26, in <module> plugin_daemon-1 | plugin_daemon-1 | from ._utils import ( plugin_daemon-1 | File "/app/storage/cwd/langgenius/zhipuai-0.0.19@6e2b02c20363bc5a04a3619130cdae281a8e902c468bdb93484ddf5cb670b256/.venv/lib/python3.12/site-packages/zai/core/_utils/_utils.py", line 22, in <module> plugin_daemon-1 | plugin_daemon-1 | import sniffio plugin_daemon-1 | plugin_daemon-1 | ModuleNotFoundError: No module named 'sniffio'`
yindo added the bug label 2026-02-16 10:20:42 -05:00
yindo closed this issue 2026-02-16 10:20:42 -05:00
Author
Owner

@GDNDZZK commented on GitHub (Dec 3, 2025):

Workaround (Temporary Fix)

  1. Enter the plugin_daemon container:

    docker exec -it docker-plugin_daemon-1 /bin/bash
    
  2. Navigate to the ZhipuAI plugin directory:

    cd /app/storage/cwd/langgenius/zhipuai-0.0.19@*
    
  3. Activate the plugin’s virtual environment:

    source .venv/bin/activate
    
  4. Install pip into the .venv :

    python -m ensurepip --upgrade
    
  5. Install the missing dependency:

    python -m pip install sniffio
    
  6. Exit and restart the plugin daemon:

    exit
    docker compose restart
    
@GDNDZZK commented on GitHub (Dec 3, 2025): **Workaround (Temporary Fix)** 1. Enter the `plugin_daemon` container: ```bash docker exec -it docker-plugin_daemon-1 /bin/bash ``` 2. Navigate to the ZhipuAI plugin directory: ```bash cd /app/storage/cwd/langgenius/zhipuai-0.0.19@* ``` 3. Activate the plugin’s virtual environment: ```bash source .venv/bin/activate ``` 4. Install `pip` into the `.venv` : ```bash python -m ensurepip --upgrade ``` 5. Install the missing dependency: ```bash python -m pip install sniffio ``` 6. Exit and restart the plugin daemon: ```bash exit docker compose restart ```
Author
Owner

@dosubot[bot] commented on GitHub (Dec 3, 2025):

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

Your workaround is correct and matches what other users have done to resolve the missing sniffio dependency for the ZhipuAI plugin in Dify 1.10.1 self-hosted Docker setups. The root cause is that sniffio is not listed in the plugin's requirements.txt, so it isn't installed by default, leading to the ModuleNotFoundError and plugin startup failure. This issue has appeared in other plugins as well and is not unique to ZhipuAI [reference].

Until the plugin's requirements.txt is updated upstream to include sniffio, you'll need to manually install it after each plugin update or container rebuild. For a permanent fix, maintainers should add sniffio to the requirements.txt, as was done for other plugins like volcengine_maas [reference].

Keep an eye on plugin updates and changelogs—if you update or reinstall the plugin and the issue returns, just repeat your workaround steps.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 3, 2025): <!-- Greeting --> Hi @GDNDZZK! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Your workaround is correct and matches what other users have done to resolve the missing `sniffio` dependency for the ZhipuAI plugin in Dify 1.10.1 self-hosted Docker setups. The root cause is that `sniffio` is not listed in the plugin's requirements.txt, so it isn't installed by default, leading to the ModuleNotFoundError and plugin startup failure. This issue has appeared in other plugins as well and is not unique to ZhipuAI [[reference](https://github.com/langgenius/dify-official-plugins/issues/2153)]. Until the plugin's requirements.txt is updated upstream to include `sniffio`, you'll need to manually install it after each plugin update or container rebuild. For a permanent fix, maintainers should add `sniffio` to the requirements.txt, as was done for other plugins like volcengine_maas [[reference](https://github.com/langgenius/dify-official-plugins/pull/2159)]. Keep an eye on plugin updates and changelogs—if you update or reinstall the plugin and the issue returns, just repeat your workaround steps. <!-- 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/ee1ac952-6042-4ce1-8c96-d88756f07e6d?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ee1ac952-6042-4ce1-8c96-d88756f07e6d?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ee1ac952-6042-4ce1-8c96-d88756f07e6d?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ee1ac952-6042-4ce1-8c96-d88756f07e6d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ee1ac952-6042-4ce1-8c96-d88756f07e6d?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ee1ac952-6042-4ce1-8c96-d88756f07e6d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ee1ac952-6042-4ce1-8c96-d88756f07e6d?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Your%20workaround%20is%20correct%20and%20matches%20what%20other%20users%20have%20done%20to%20resolve%20the%20missing%20%60sniffio%60%20dependency%20for%20the%20ZhipuAI%20plugin%20in%20Dify%201.10.1%20self-hosted%20Docker%20setups.%20The%20root%20cause%20is%20that%20%60sniffio%60%20is%20not%20listed%20in%20the%20plugin%27s%20requirements.txt%2C%20so%20it%20isn%27t%20installed%20by%20default%2C%20leading%20to%20the%20ModuleNotFoundError%20and%20plugin%20startup%20failure.%20This%20issue%20has%20appeared%20in%20other%20plugins%20as%20well%20and%20is%20not%20unique%20to%20ZhipuAI%20%5B%5Breference%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/2153%29%5D.%0A%0AUntil%20the%20plugin%27s%20requirements.txt%20is%20updated%20upstream%20to%20include%20%60sniffio%60%2C%20you%27ll%20need%20to%20manually%20install%20it%20after%20each%20plugin%20update%20or%20container%20rebuild.%20For%20a%20permanent%20fix%2C%20maintainers%20should%20add%20%60sniffio%60%20to%20the%20requirements.txt%2C%20as%20was%20done%20for%20other%20plugins%20like%20volcengine_maas%20%5B%5Breference%5D%28https%3A//github.com/langgenius/dify-official-plugins/pull/2159%29%5D.%0A%0AKeep%20an%20eye%20on%20plugin%20updates%20and%20changelogs%E2%80%94if%20you%20update%20or%20reinstall%20the%20plugin%20and%20the%20issue%20returns%2C%20just%20repeat%20your%20workaround%20steps.)&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/29074)
Author
Owner

@dosubot[bot] commented on GitHub (Dec 3, 2025):

The ZhipuAI plugin fails because its isolated Python environment (.venv) is missing the required sniffio dependency and doesn't have pip installed, so dependencies can't be added automatically. Installing sniffio globally in the container doesn't help—each plugin runs in its own environment and needs dependencies installed there.

Workaround:

  1. Enter the plugin daemon container:
    docker exec -it docker-plugin_daemon-1 bash
    
  2. Find the plugin's .venv directory:
    VENV=$(find /app/storage -maxdepth 5 -type d -name '.venv' | head -n1)
    echo "$VENV"
    
  3. Install pip in the venv (if missing):
    "$VENV/bin/python" -m ensurepip --upgrade || (curl -fsSL https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && "$VENV/bin/python" /tmp/get-pip.py)
    
  4. Install the missing dependencies:
    "$VENV/bin/python" -m pip install -U sniffio anyio httpx
    
  5. Restart the plugin daemon container:
    exit
    docker restart docker-plugin_daemon-1
    

Reference

Permanent fix:
Add sniffio (and any other missing dependencies) to the plugin's requirements.txt, then rebuild or restart the plugin so dependencies are installed automatically in the future.

Best practice:
Always list all plugin dependencies in requirements.txt and test plugin startup after upgrades to catch missing dependencies early. Monitor plugin daemon logs for errors, since missing dependencies can cause silent failures in the UI.

This is a known issue in Dify 1.10.1 and may require manual intervention until the plugin or platform is updated to handle dependencies more robustly.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 3, 2025): <!-- Answer --> The ZhipuAI plugin fails because its isolated Python environment (.venv) is missing the required `sniffio` dependency and doesn't have pip installed, so dependencies can't be added automatically. Installing `sniffio` globally in the container doesn't help—each plugin runs in its own environment and needs dependencies installed there. **Workaround:** 1. Enter the plugin daemon container: ```sh docker exec -it docker-plugin_daemon-1 bash ``` 2. Find the plugin's .venv directory: ```sh VENV=$(find /app/storage -maxdepth 5 -type d -name '.venv' | head -n1) echo "$VENV" ``` 3. Install pip in the venv (if missing): ```sh "$VENV/bin/python" -m ensurepip --upgrade || (curl -fsSL https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && "$VENV/bin/python" /tmp/get-pip.py) ``` 4. Install the missing dependencies: ```sh "$VENV/bin/python" -m pip install -U sniffio anyio httpx ``` 5. Restart the plugin daemon container: ```sh exit docker restart docker-plugin_daemon-1 ``` [Reference](https://github.com/langgenius/dify/issues/29005#issuecomment-3600879295) **Permanent fix:** Add `sniffio` (and any other missing dependencies) to the plugin's `requirements.txt`, then rebuild or restart the plugin so dependencies are installed automatically in the future. **Best practice:** Always list all plugin dependencies in `requirements.txt` and test plugin startup after upgrades to catch missing dependencies early. Monitor plugin daemon logs for errors, since missing dependencies can cause silent failures in the UI. This is a known issue in Dify 1.10.1 and may require manual intervention until the plugin or platform is updated to handle dependencies more robustly. <!-- 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/fc27ae1e-b8d6-4f96-b6b4-7ba689ef1294?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fc27ae1e-b8d6-4f96-b6b4-7ba689ef1294?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fc27ae1e-b8d6-4f96-b6b4-7ba689ef1294?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fc27ae1e-b8d6-4f96-b6b4-7ba689ef1294?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fc27ae1e-b8d6-4f96-b6b4-7ba689ef1294?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fc27ae1e-b8d6-4f96-b6b4-7ba689ef1294?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fc27ae1e-b8d6-4f96-b6b4-7ba689ef1294?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20ZhipuAI%20plugin%20fails%20because%20its%20isolated%20Python%20environment%20%28.venv%29%20is%20missing%20the%20required%20%60sniffio%60%20dependency%20and%20doesn%27t%20have%20pip%20installed%2C%20so%20dependencies%20can%27t%20be%20added%20automatically.%20Installing%20%60sniffio%60%20globally%20in%20the%20container%20doesn%27t%20help%E2%80%94each%20plugin%20runs%20in%20its%20own%20environment%20and%20needs%20dependencies%20installed%20there.%0A%0A%2A%2AWorkaround%3A%2A%2A%20%20%0A1.%20Enter%20the%20plugin%20daemon%20container%3A%0A%20%20%20%60%60%60sh%0A%20%20%20docker%20exec%20-it%20docker-plugin_daemon-1%20bash%0A%20%20%20%60%60%60%0A2.%20Find%20the%20plugin%27s%20.venv%20directory%3A%0A%20%20%20%60%60%60sh%0A%20%20%20VENV%3D%24%28find%20/app/storage%20-maxdepth%205%20-type%20d%20-name%20%27.venv%27%20%7C%20head%20-n1%29%0A%20%20%20echo%20%22%24VENV%22%0A%20%20%20%60%60%60%0A3.%20Install%20pip%20in%20the%20venv%20%28if%20missing%29%3A%0A%20%20%20%60%60%60sh%0A%20%20%20%22%24VENV/bin/python%22%20-m%20ensurepip%20--upgrade%20%7C%7C%20%28curl%20-fsSL%20https%3A//bootstrap.pypa.io/get-pip.py%20-o%20/tmp/get-pip.py%20%26%26%20%22%24VENV/bin/python%22%20/tmp/get-pip.py%29%0A%20%20%20%60%60%60%0A4.%20Install%20the%20missing%20dependencies%3A%0A%20%20%20%60%60%60sh%0A%20%20%20%22%24VENV/bin/python%22%20-m%20pip%20install%20-U%20sniffio%20anyio%20httpx%0A%20%20%20%60%60%60%0A5.%20Restart%20the%20plugin%20daemon%20container%3A%0A%20%20%20%60%60%60sh%0A%20%20%20exit%0A%20%20%20docker%20restart%20docker-plugin_daemon-1%0A%20%20%20%60%60%60%0A%5BReference%5D%28https%3A//github.com/langgenius/dify/issues/29005%23issuecomment-3600879295%29%0A%0A%2A%2APermanent%20fix%3A%2A%2A%20%20%0AAdd%20%60sniffio%60%20%28and%20any%20other%20missing%20dependencies%29%20to%20the%20plugin%27s%20%60requirements.txt%60%2C%20then%20rebuild%20or%20restart%20the%20plugin%20so%20dependencies%20are%20installed%20automatically%20in%20the%20future.%0A%0A%2A%2ABest%20practice%3A%2A%2A%20%20%0AAlways%20list%20all%20plugin%20dependencies%20in%20%60requirements.txt%60%20and%20test%20plugin%20startup%20after%20upgrades%20to%20catch%20missing%20dependencies%20early.%20Monitor%20plugin%20daemon%20logs%20for%20errors%2C%20since%20missing%20dependencies%20can%20cause%20silent%20failures%20in%20the%20UI.%0A%0AThis%20is%20a%20known%20issue%20in%20Dify%201.10.1%20and%20may%20require%20manual%20intervention%20until%20the%20plugin%20or%20platform%20is%20updated%20to%20handle%20dependencies%20more%20robustly.)&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-official-plugins/issues/2169)
Author
Owner

@zhaobingshuang commented on GitHub (Dec 3, 2025):

I also encountered the same problem. It might be related to the update of zai-sdk. https://github.com/zai-org/z-ai-sdk-python/issues/53

@zhaobingshuang commented on GitHub (Dec 3, 2025): I also encountered the same problem. It might be related to the update of zai-sdk. https://github.com/zai-org/z-ai-sdk-python/issues/53
Author
Owner

@hjlarry commented on GitHub (Dec 3, 2025):

please try 0.0.20

@hjlarry commented on GitHub (Dec 3, 2025): please try 0.0.20
Author
Owner

@zhaobingshuang commented on GitHub (Dec 3, 2025):

problem was solved

@zhaobingshuang commented on GitHub (Dec 3, 2025): problem was solved
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#848