1Panel-dev / MaxKB

🚀 MaxKB 是一款基于大语言模型和 RAG 的开源知识库问答系统,广泛应用于智能客服、企业内部知识库、学术研究与教育等场景。
https://maxkb.cn/
GNU General Public License v3.0
11.51k stars 1.51k forks source link

[BUG]后端无响应,无法接收请求,无法自动重启 #720

Closed nmbtwzt closed 4 months ago

nmbtwzt commented 4 months ago

联系方式

No response

MaxKB 版本

1.3

问题描述

感谢查看问题,现在后端启动时, 完全无响应,无法接收请求,同时修改代码时也不会自动保存,没有任何相关报错信息。 在源代码基础上自己修改增加了rerank功能,但是相关代码全部注释也会有此问题,且没有任何报错信息。 有时启动后完全正常,但修改后端代码自动重启又可能变成无响应状态。 从1.2更新至1.3问题依旧,实在排查不出问题在哪 麻烦您帮忙查看可能是哪里的问题,再次表示感谢。

image

后端启动后的日志信息,标红处为数据库相关,按照指示运行代码也没有消除该报错,但之前一直使用都正常,没有看到影响。 尝试更新django框架5.0版本,也没有解决。

重现步骤

直接启动后端后遇到此问题

期待的正确结果

后端可以正常响应,且修改代码后可以自动重启。

相关日志输出

Building prefix dict from the default dictionary ...
DEBUG:jieba:Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
DEBUG:jieba:Loading model from cache /tmp/jieba.cache
Loading model cost 0.925 seconds.
DEBUG:jieba:Loading model cost 0.925 seconds.
Prefix dict has been built successfully.
DEBUG:jieba:Prefix dict has been built successfully.
Operations to perform:
  Apply all migrations: application, contenttypes, dataset, django_apscheduler, embedding, setting, users
Running migrations:
  No migrations to apply.
  Your models in app(s): 'application' have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
Building prefix dict from the default dictionary ...
DEBUG:jieba:Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
DEBUG:jieba:Loading model from cache /tmp/jieba.cache
Loading model cost 0.756 seconds.
DEBUG:jieba:Loading model cost 0.756 seconds.
Prefix dict has been built successfully.
DEBUG:jieba:Prefix dict has been built successfully.
Operations to perform:
  Apply all migrations: application, contenttypes, dataset, django_apscheduler, embedding, setting, users
Running migrations:
  No migrations to apply.
  Your models in app(s): 'application' have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
July 08, 2024 - 17:41:03
Django version 5.0.6, using settings 'smartdoc.settings'
Starting development server at http://0.0.0.0:8080/
Quit the server with CONTROL-C.

附加信息

No response

nmbtwzt commented 4 months ago

除日志打印代码外,其他全部修改代码已经注释,问题依旧发生,请教一下该情况应该如何自查并解决问题?

nmbtwzt commented 4 months ago

问题疑似解决了,可能是环境问题,在旧的环境上,按照1.3的poetry重新升级相关依赖后就好了。 记录一下错误的环境依赖列表

_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
aiohttp                   3.9.5                    pypi_0    pypi
aiolimiter                1.1.0                    pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
annotated-types           0.7.0                    pypi_0    pypi
anyio                     4.4.0                    pypi_0    pypi
apscheduler               3.10.4                   pypi_0    pypi
asgiref                   3.8.1                    pypi_0    pypi
attrs                     23.2.0                   pypi_0    pypi
bce-python-sdk            0.9.11                   pypi_0    pypi
bcembedding               0.1.5                    pypi_0    pypi
beautifulsoup4            4.12.3                   pypi_0    pypi
blinker                   1.8.2                    pypi_0    pypi
build                     1.2.1                    pypi_0    pypi
bzip2                     1.0.8                hd590300_5    conda-forge
ca-certificates           2024.6.2             hbcca054_0    conda-forge
cachecontrol              0.14.0                   pypi_0    pypi
cachetools                5.3.3                    pypi_0    pypi
certifi                   2024.6.2                 pypi_0    pypi
cffi                      1.16.0                   pypi_0    pypi
charset-normalizer        3.3.2                    pypi_0    pypi
cleo                      2.1.0                    pypi_0    pypi
click                     8.1.7                    pypi_0    pypi
crashtest                 0.4.1                    pypi_0    pypi
cryptography              42.0.7                   pypi_0    pypi
dashscope                 1.19.2                   pypi_0    pypi
dataclasses-json          0.6.6                    pypi_0    pypi
datasets                  2.20.0                   pypi_0    pypi
deprecated                1.2.14                   pypi_0    pypi
dill                      0.3.8                    pypi_0    pypi
dirtyjson                 1.0.8                    pypi_0    pypi
diskcache                 5.6.3                    pypi_0    pypi
distlib                   0.3.8                    pypi_0    pypi
distro                    1.9.0                    pypi_0    pypi
django                    5.0.6                    pypi_0    pypi
django-apscheduler        0.6.2                    pypi_0    pypi
django-filter             23.2                     pypi_0    pypi
django-ipware             6.0.5                    pypi_0    pypi
djangorestframework       3.14.0                   pypi_0    pypi
drf-yasg                  1.21.7                   pypi_0    pypi
dulwich                   0.21.7                   pypi_0    pypi
et-xmlfile                1.1.0                    pypi_0    pypi
fastjsonschema            2.19.1                   pypi_0    pypi
filelock                  3.14.0                   pypi_0    pypi
filetype                  1.2.0                    pypi_0    pypi
frozenlist                1.4.1                    pypi_0    pypi
fsspec                    2024.5.0                 pypi_0    pypi
future                    1.0.0                    pypi_0    pypi
google-ai-generativelanguage 0.6.4                    pypi_0    pypi
google-api-core           2.19.0                   pypi_0    pypi
google-api-python-client  2.131.0                  pypi_0    pypi
google-auth               2.29.0                   pypi_0    pypi
google-auth-httplib2      0.2.0                    pypi_0    pypi
google-generativeai       0.5.4                    pypi_0    pypi
googleapis-common-protos  1.63.1                   pypi_0    pypi
greenlet                  3.0.3                    pypi_0    pypi
grpcio                    1.64.1                   pypi_0    pypi
grpcio-status             1.62.2                   pypi_0    pypi
h11                       0.14.0                   pypi_0    pypi
html2text                 2024.2.26                pypi_0    pypi
httpcore                  1.0.5                    pypi_0    pypi
httplib2                  0.22.0                   pypi_0    pypi
httpx                     0.27.0                   pypi_0    pypi
httpx-sse                 0.4.0                    pypi_0    pypi
huggingface-hub           0.23.2                   pypi_0    pypi
idna                      3.7                      pypi_0    pypi
importlib-metadata        7.1.0                    pypi_0    pypi
inflection                0.5.1                    pypi_0    pypi
installer                 0.7.0                    pypi_0    pypi
jaraco-classes            3.4.0                    pypi_0    pypi
jeepney                   0.8.0                    pypi_0    pypi
jieba                     0.42.1                   pypi_0    pypi
jinja2                    3.1.4                    pypi_0    pypi
joblib                    1.4.2                    pypi_0    pypi
jsonpatch                 1.33                     pypi_0    pypi
jsonpointer               2.4                      pypi_0    pypi
keyring                   24.3.1                   pypi_0    pypi
langchain                 0.1.20                   pypi_0    pypi
langchain-community       0.0.38                   pypi_0    pypi
langchain-core            0.1.52                   pypi_0    pypi
langchain-google-genai    1.0.4                    pypi_0    pypi
langchain-huggingface     0.0.3                    pypi_0    pypi
langchain-openai          0.0.8                    pypi_0    pypi
langchain-text-splitters  0.0.2                    pypi_0    pypi
langsmith                 0.1.68                   pypi_0    pypi
ld_impl_linux-64          2.40                 hf3520f5_1    conda-forge
libexpat                  2.6.2                h59595ed_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h77fa898_7    conda-forge
libgomp                   13.2.0               h77fa898_7    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libsqlite                 3.45.3               h2797004_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
llama-cloud               0.0.6                    pypi_0    pypi
llama-index               0.10.51                  pypi_0    pypi
llama-index-agent-openai  0.2.7                    pypi_0    pypi
llama-index-cli           0.1.12                   pypi_0    pypi
llama-index-core          0.10.51                  pypi_0    pypi
llama-index-embeddings-openai 0.1.10                   pypi_0    pypi
llama-index-indices-managed-llama-cloud 0.2.2                    pypi_0    pypi
llama-index-legacy        0.9.48                   pypi_0    pypi
llama-index-llms-openai   0.1.24                   pypi_0    pypi
llama-index-multi-modal-llms-openai 0.1.6                    pypi_0    pypi
llama-index-program-openai 0.1.6                    pypi_0    pypi
llama-index-question-gen-openai 0.1.3                    pypi_0    pypi
llama-index-readers-file  0.1.25                   pypi_0    pypi
llama-index-readers-llama-parse 0.1.4                    pypi_0    pypi
llama-parse               0.4.5                    pypi_0    pypi
lxml                      5.2.2                    pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                2.1.5                    pypi_0    pypi
marshmallow               3.21.2                   pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
more-itertools            10.2.0                   pypi_0    pypi
mpmath                    1.3.0                    pypi_0    pypi
msgpack                   1.0.8                    pypi_0    pypi
multidict                 6.0.5                    pypi_0    pypi
multiprocess              0.70.16                  pypi_0    pypi
mypy-extensions           1.0.0                    pypi_0    pypi
ncurses                   6.5                  h59595ed_0    conda-forge
nest-asyncio              1.6.0                    pypi_0    pypi
networkx                  3.3                      pypi_0    pypi
nltk                      3.8.1                    pypi_0    pypi
numpy                     1.26.4                   pypi_0    pypi
nvidia-cublas-cu12        12.1.3.1                 pypi_0    pypi
nvidia-cuda-cupti-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-nvrtc-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-runtime-cu12  12.1.105                 pypi_0    pypi
nvidia-cudnn-cu12         8.9.2.26                 pypi_0    pypi
nvidia-cufft-cu12         11.0.2.54                pypi_0    pypi
nvidia-curand-cu12        10.3.2.106               pypi_0    pypi
nvidia-cusolver-cu12      11.4.5.107               pypi_0    pypi
nvidia-cusparse-cu12      12.1.0.106               pypi_0    pypi
nvidia-nccl-cu12          2.20.5                   pypi_0    pypi
nvidia-nvjitlink-cu12     12.5.40                  pypi_0    pypi
nvidia-nvtx-cu12          12.1.105                 pypi_0    pypi
openai                    1.31.0                   pypi_0    pypi
openpyxl                  3.1.3                    pypi_0    pypi
openssl                   3.3.0                h4ab18f5_3    conda-forge
orjson                    3.10.3                   pypi_0    pypi
packaging                 23.2                     pypi_0    pypi
pandas                    2.2.2                    pypi_0    pypi
pexpect                   4.9.0                    pypi_0    pypi
pillow                    10.3.0                   pypi_0    pypi
pip                       24.0               pyhd8ed1ab_0    conda-forge
pkginfo                   1.11.0                   pypi_0    pypi
platformdirs              4.2.2                    pypi_0    pypi
poetry                    1.8.3                    pypi_0    pypi
poetry-core               1.9.0                    pypi_0    pypi
poetry-plugin-export      1.8.0                    pypi_0    pypi
prompt-toolkit            3.0.45                   pypi_0    pypi
proto-plus                1.23.0                   pypi_0    pypi
protobuf                  4.25.3                   pypi_0    pypi
psycopg2-binary           2.9.7                    pypi_0    pypi
ptyprocess                0.7.0                    pypi_0    pypi
pyarrow                   16.1.0                   pypi_0    pypi
pyarrow-hotfix            0.6                      pypi_0    pypi
pyasn1                    0.6.0                    pypi_0    pypi
pyasn1-modules            0.4.0                    pypi_0    pypi
pycparser                 2.22                     pypi_0    pypi
pycryptodome              3.20.0                   pypi_0    pypi
pydantic                  2.7.3                    pypi_0    pypi
pydantic-core             2.18.4                   pypi_0    pypi
pygments                  2.18.0                   pypi_0    pypi
pyjwt                     2.8.0                    pypi_0    pypi
pymupdf                   1.24.1                   pypi_0    pypi
pymupdfb                  1.24.1                   pypi_0    pypi
pyparsing                 3.1.2                    pypi_0    pypi
pypdf                     4.2.0                    pypi_0    pypi
pyproject-hooks           1.1.0                    pypi_0    pypi
python                    3.11.9          hb806964_0_cpython    conda-forge
python-dateutil           2.9.0.post0              pypi_0    pypi
python-docx               1.1.2                    pypi_0    pypi
python-dotenv             1.0.1                    pypi_0    pypi
python-ipware             3.0.0                    pypi_0    pypi
pytz                      2024.1                   pypi_0    pypi
pyyaml                    6.0.1                    pypi_0    pypi
qianfan                   0.3.14                   pypi_0    pypi
rapidfuzz                 3.9.3                    pypi_0    pypi
readline                  8.2                  h8228510_1    conda-forge
regex                     2024.5.15                pypi_0    pypi
requests                  2.32.3                   pypi_0    pypi
requests-toolbelt         1.0.0                    pypi_0    pypi
rich                      13.7.1                   pypi_0    pypi
rsa                       4.9                      pypi_0    pypi
safetensors               0.4.3                    pypi_0    pypi
scikit-learn              1.5.0                    pypi_0    pypi
scipy                     1.13.1                   pypi_0    pypi
secretstorage             3.3.3                    pypi_0    pypi
sentence-transformers     2.7.0                    pypi_0    pypi
setuptools                70.0.0             pyhd8ed1ab_0    conda-forge
shellingham               1.5.4                    pypi_0    pypi
six                       1.16.0                   pypi_0    pypi
sniffio                   1.3.1                    pypi_0    pypi
soupsieve                 2.5                      pypi_0    pypi
sqlalchemy                2.0.30                   pypi_0    pypi
sqlparse                  0.5.0                    pypi_0    pypi
striprtf                  0.0.26                   pypi_0    pypi
style                     1.1.0                    pypi_0    pypi
sympy                     1.12.1                   pypi_0    pypi
tenacity                  8.3.0                    pypi_0    pypi
threadpoolctl             3.5.0                    pypi_0    pypi
tiktoken                  0.5.2                    pypi_0    pypi
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tokenizers                0.19.1                   pypi_0    pypi
tomlkit                   0.12.5                   pypi_0    pypi
torch                     2.3.0                    pypi_0    pypi
tqdm                      4.66.4                   pypi_0    pypi
transformers              4.41.2                   pypi_0    pypi
triton                    2.3.0                    pypi_0    pypi
trove-classifiers         2024.5.22                pypi_0    pypi
typer                     0.12.3                   pypi_0    pypi
typing-extensions         4.12.1                   pypi_0    pypi
typing-inspect            0.9.0                    pypi_0    pypi
tzdata                    2024.1                   pypi_0    pypi
tzlocal                   5.2                      pypi_0    pypi
update                    0.0.1                    pypi_0    pypi
uritemplate               4.1.1                    pypi_0    pypi
urllib3                   2.2.1                    pypi_0    pypi
virtualenv                20.26.2                  pypi_0    pypi
wcwidth                   0.2.13                   pypi_0    pypi
websocket-client          1.8.0                    pypi_0    pypi
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
wrapt                     1.16.0                   pypi_0    pypi
xlrd                      2.0.1                    pypi_0    pypi
xlwt                      1.3.0                    pypi_0    pypi
xxhash                    3.4.1                    pypi_0    pypi
xz                        5.2.6                h166bdaf_0    conda-forge
yarl                      1.9.4                    pypi_0    pypi
zhipuai                   2.1.0.20240521           pypi_0    pypi
zipp                      3.19.1                   pypi_0    pypi
shaohuzhang1 commented 4 months ago

项目启动没有问题,无法访问接口需要查看是否是网络问题

myzf commented 4 months ago

@nmbtwzt 我本地启动后,打开前端页面,为啥一直跳转404页面呢 image 有遇到过没