Junjiem/db_query updates to a new version with architecture compatibility issues, unable to roll back #21291

Closed
opened 2026-02-21 20:11:48 -05:00 by yindo · 1 comment
Owner

Originally created by @idleQing on GitHub (Dec 25, 2025).

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.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I updated the version of the junjiem/db_query plugin tool today, which caused an error when using it. According to the backend logs, it was due to a mismatch in the machine architecture when importing a new package. Even when I lowered the version again, the same error occurred. Is this a bug and how can I avoid it??

2025/12/25 15:31:19 run.go:135: [ERROR]plugin junjiem/db_query:0.0.5 exited with error: exit status 1
b_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/__init__.py", line 112, in
from numpy.config import show_config
File "/app/storage/cwd/junjiem/db_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/__config__.py", line 4, in
from numpy._core._multiarray_umath import (
File "/app/storage/cwd/junjiem/db_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/_core/__init__.py", line 22, in
from . import multiarray

File "/app/storage/cwd/junjiem/db_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/_core/multiarray.py", line 11, in

from . import _multiarray_umath, overrides

RuntimeError: NumPy was built with baseline optimizations:
(X86_V2) but your machine doesn't support:

✔️ Expected Behavior

Fix plugin version reduction cannot be completely rolled back, and I need to avoid current errors

Actual Behavior

No response

Originally created by @idleQing on GitHub (Dec 25, 2025). ### 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.9.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I updated the version of the junjiem/db_query plugin tool today, which caused an error when using it. According to the backend logs, it was due to a mismatch in the machine architecture when importing a new package. Even when I lowered the version again, the same error occurred. Is this a bug and how can I avoid it?? 2025/12/25 15:31:19 run.go:135: [ERROR]plugin junjiem/db_query:0.0.5 exited with error: exit status 1 b_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/__init__.py", line 112, in <module> from numpy.__config__ import show_config File "/app/storage/cwd/junjiem/db_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/__config__.py", line 4, in <module> from numpy._core._multiarray_umath import ( File "/app/storage/cwd/junjiem/db_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/_core/__init__.py", line 22, in <module> from . import multiarray File "/app/storage/cwd/junjiem/db_query-0.0.5@33a1535a51ca0bd52f1c311bc15ffbd04675af73dde84e1a81a093cd5e5c4272/.venv/lib/python3.12/site-packages/numpy/_core/multiarray.py", line 11, in <module> from . import _multiarray_umath, overrides RuntimeError: NumPy was built with baseline optimizations: (X86_V2) but your machine doesn't support: ### ✔️ Expected Behavior Fix plugin version reduction cannot be completely rolled back, and I need to avoid current errors ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 20:11:48 -05:00
yindo closed this issue 2026-02-21 20:11:48 -05:00
Author
Owner

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

This is a known limitation in Dify's plugin management for self-hosted Docker setups: rolling back a plugin version does not always clean or rebuild the plugin's Python virtual environment. As a result, incompatible or cached binaries (like NumPy built for a different CPU architecture) can persist and cause runtime errors even after downgrading the plugin. The system does not automatically reset the environment during plugin upgrades or rollbacks, so manual intervention is often required to resolve these issues (source).

To fix the architecture mismatch error, you can manually clean and rebuild the plugin's environment:

  1. Enter the plugin daemon container:
    docker exec -it docker-plugin_daemon-1 bash
    
  2. Find the plugin's .venv directory (adjust the path if you have multiple plugins):
    VENV=$(find /app/storage -maxdepth 5 -type d -name '.venv' | head -n1)
    echo "$VENV"
    
  3. (Optional) If pip is missing, install it:
    "$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. Reinstall NumPy (and any other dependencies needed by your plugin):
    "$VENV/bin/python" -m pip install --force-reinstall --no-cache-dir numpy
    
  5. Exit the container and restart the plugin daemon:
    exit
    docker restart docker-plugin_daemon-1
    

For a permanent fix, always list all required dependencies in the plugin's requirements.txt and ensure the plugin environment is rebuilt after version changes. This helps avoid missing or incompatible dependencies in the future (source).

If you frequently encounter this issue, consider suggesting a feature for Dify to automatically clean or rebuild plugin environments during upgrades or rollbacks.

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 25, 2025): <!-- Answer --> This is a known limitation in Dify's plugin management for self-hosted Docker setups: rolling back a plugin version does not always clean or rebuild the plugin's Python virtual environment. As a result, incompatible or cached binaries (like NumPy built for a different CPU architecture) can persist and cause runtime errors even after downgrading the plugin. The system does not automatically reset the environment during plugin upgrades or rollbacks, so manual intervention is often required to resolve these issues ([source](https://github.com/langgenius/dify-official-plugins/issues/2233)). To fix the architecture mismatch error, you can manually clean and rebuild the plugin's environment: 1. Enter the plugin daemon container: ```sh docker exec -it docker-plugin_daemon-1 bash ``` 2. Find the plugin's `.venv` directory (adjust the path if you have multiple plugins): ```sh VENV=$(find /app/storage -maxdepth 5 -type d -name '.venv' | head -n1) echo "$VENV" ``` 3. (Optional) If pip is missing, install it: ```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. Reinstall NumPy (and any other dependencies needed by your plugin): ```sh "$VENV/bin/python" -m pip install --force-reinstall --no-cache-dir numpy ``` 5. Exit the container and restart the plugin daemon: ```sh exit docker restart docker-plugin_daemon-1 ``` For a permanent fix, always list all required dependencies in the plugin's `requirements.txt` and ensure the plugin environment is rebuilt after version changes. This helps avoid missing or incompatible dependencies in the future ([source](https://github.com/langgenius/dify-official-plugins/issues/2169)). If you frequently encounter this issue, consider suggesting a feature for Dify to automatically clean or rebuild plugin environments during upgrades or rollbacks. <!-- 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/da63318a-0814-443b-97d2-e7e366535382?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/da63318a-0814-443b-97d2-e7e366535382?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/da63318a-0814-443b-97d2-e7e366535382?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/da63318a-0814-443b-97d2-e7e366535382?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/da63318a-0814-443b-97d2-e7e366535382?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/da63318a-0814-443b-97d2-e7e366535382?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/da63318a-0814-443b-97d2-e7e366535382?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=This%20is%20a%20known%20limitation%20in%20Dify%27s%20plugin%20management%20for%20self-hosted%20Docker%20setups%3A%20rolling%20back%20a%20plugin%20version%20does%20not%20always%20clean%20or%20rebuild%20the%20plugin%27s%20Python%20virtual%20environment.%20As%20a%20result%2C%20incompatible%20or%20cached%20binaries%20%28like%20NumPy%20built%20for%20a%20different%20CPU%20architecture%29%20can%20persist%20and%20cause%20runtime%20errors%20even%20after%20downgrading%20the%20plugin.%20The%20system%20does%20not%20automatically%20reset%20the%20environment%20during%20plugin%20upgrades%20or%20rollbacks%2C%20so%20manual%20intervention%20is%20often%20required%20to%20resolve%20these%20issues%20%28%5Bsource%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/2233%29%29.%0A%0ATo%20fix%20the%20architecture%20mismatch%20error%2C%20you%20can%20manually%20clean%20and%20rebuild%20the%20plugin%27s%20environment%3A%0A%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%60.venv%60%20directory%20%28adjust%20the%20path%20if%20you%20have%20multiple%20plugins%29%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.%20%28Optional%29%20If%20pip%20is%20missing%2C%20install%20it%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.%20Reinstall%20NumPy%20%28and%20any%20other%20dependencies%20needed%20by%20your%20plugin%29%3A%0A%20%20%20%60%60%60sh%0A%20%20%20%22%24VENV/bin/python%22%20-m%20pip%20install%20--force-reinstall%20--no-cache-dir%20numpy%0A%20%20%20%60%60%60%0A5.%20Exit%20the%20container%20and%20restart%20the%20plugin%20daemon%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%0AFor%20a%20permanent%20fix%2C%20always%20list%20all%20required%20dependencies%20in%20the%20plugin%27s%20%60requirements.txt%60%20and%20ensure%20the%20plugin%20environment%20is%20rebuilt%20after%20version%20changes.%20This%20helps%20avoid%20missing%20or%20incompatible%20dependencies%20in%20the%20future%20%28%5Bsource%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/2169%29%29.%0A%0AIf%20you%20frequently%20encounter%20this%20issue%2C%20consider%20suggesting%20a%20feature%20for%20Dify%20to%20automatically%20clean%20or%20rebuild%20plugin%20environments%20during%20upgrades%20or%20rollbacks.)&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/30178)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21291