Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chatchat0.3.1.3启动报错FileNotFoundError: [Errno 2] No such file or directory #5146

Closed
15927566740 opened this issue Dec 19, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@15927566740
Copy link

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/numpy/init.py", line 141, in
from . import core
File "/usr/local/lib/python3.11/site-packages/numpy/core/init.py", line 23, in
from . import multiarray
File "/usr/local/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in
from . import overrides
File "/usr/local/lib/python3.11/site-packages/numpy/core/overrides.py", line 6, in
from numpy.core._multiarray_umath import (
KeyboardInterrupt

==============================Langchain-Chatchat Configuration==============================
操作系统:Linux-5.4.0-81-generic-x86_64-with-glibc2.36.
python版本:3.11.9 (main, Aug 13 2024, 02:18:20) [GCC 12.2.0]
项目版本:0.3.1.3
langchain版本:0.1.17
数据目录:/root/chatchat_data

当前使用的分词器:ChineseRecursiveTextSplitter
默认选用的 Embedding 名称: custom-embedding
==============================Langchain-Chatchat Configuration==============================

2024-12-19 16:54:42.058 | INFO | chatchat.startup:start_main_server:257 - 正在启动服务:
2024-12-19 16:54:42.062 | INFO | chatchat.startup:start_main_server:258 - 如需查看 llm_api 日志,请前往 /root/chatchat_data/data/logs
Traceback (most recent call last):
File "/usr/local/bin/chatchat", line 6, in
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/Langchain-Chatchat/libs/chatchat-server/chatchat/startup.py", line 374, in main
loop.run_until_complete(start_main_server(args))
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/root/Langchain-Chatchat/libs/chatchat-server/chatchat/startup.py", line 265, in start_main_server
api_started = manager.Event()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/multiprocessing/managers.py", line 727, in temp
token, exp = self._create(typeid, *args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/multiprocessing/managers.py", line 607, in _create
conn = self._Client(self._address, authkey=self._authkey)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 519, in Client
c = SocketClient(address)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 647, in SocketClient
s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

root@f6fc06b0299c:/chatchat_data# ls
basic_settings.yaml data data.tar.gz kb_settings.yaml model_settings.yaml prompt_settings.yaml tool_settings.yaml
root@f6fc06b0299c:
/chatchat_data# pwd
/root/chatchat_data
root@f6fc06b0299c:~/chatchat_data#

@15927566740 15927566740 added the bug Something isn't working label Dec 19, 2024
Copy link

dosubot bot commented Dec 19, 2024

I found that the Langchain-Chatchat startup process requires specific files or directories, such as /root/nltk_data/tokenizers/punkt.zip and /root/nltk_data/taggers/averaged_perceptron_tagger.zip. These files need to be downloaded and placed in the specified directories to avoid FileNotFoundError during startup [1].

Additionally, ensure that all necessary configuration files are correctly set up in your /root/chatchat_data directory. If these files are missing or incorrectly configured, it could lead to startup errors.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@15927566740
Copy link
Author

root@354e4d900ca2:/chatchat_data# pwd
/root/chatchat_data
root@354e4d900ca2:
/chatchat_data# cd ..
root@354e4d900ca2:# ls
Langchain-Chatchat chatchat_data
root@354e4d900ca2:
# cd chatchat_data/
root@354e4d900ca2:/chatchat_data# ls
basic_settings.yaml data data.tar.gz kb_settings.yaml model_settings.yaml prompt_settings.yaml tool_settings.yaml
root@354e4d900ca2:
/chatchat_data# cd data
root@354e4d900ca2:/chatchat_data/data# ls
knowledge_base logs media nltk_data temp
root@354e4d900ca2:
/chatchat_data/data# cd nltk_data/
root@354e4d900ca2:/chatchat_data/data/nltk_data# ls
corpora taggers tokenizers
root@354e4d900ca2:
/chatchat_data/data/nltk_data# ls tokenizers/punkt/
PY3 danish.pickle estonian.pickle german.pickle malayalam.pickle portuguese.pickle spanish.pickle
README dutch.pickle finnish.pickle greek.pickle norwegian.pickle russian.pickle swedish.pickle
czech.pickle english.pickle french.pickle italian.pickle polish.pickle slovene.pickle turkish.pickle
root@354e4d900ca2:~/chatchat_data/data/nltk_data# ls taggers/averaged_perceptron_tagger/
averaged_perceptron_tagger.pickle
这些东西已经下载了

I found that the Langchain-Chatchat startup process requires specific files or directories, such as /root/nltk_data/tokenizers/punkt.zip and /root/nltk_data/taggers/averaged_perceptron_tagger.zip. These files need to be downloaded and placed in the specified directories to avoid FileNotFoundError during startup [1].

Additionally, ensure that all necessary configuration files are correctly set up in your /root/chatchat_data directory. If these files are missing or incorrectly configured, it could lead to startup errors.

To continue talking to Dosu, mention @dosu.

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Copy link

dosubot bot commented Dec 19, 2024

It seems like the necessary files for the NLTK data are already downloaded and placed correctly in your /root/chatchat_data/data/nltk_data directory. Since you're still encountering a FileNotFoundError, here are a few additional steps you can take to troubleshoot the issue:

  1. Verify Configuration Files: Ensure that all configuration files (basic_settings.yaml, kb_settings.yaml, model_settings.yaml, prompt_settings.yaml, tool_settings.yaml) in /root/chatchat_data are correctly configured and not missing any required settings.

  2. Check Log Files: Review the log files located in /root/chatchat_data/data/logs for any additional error messages or warnings that might provide more context about the missing file or directory.

  3. Environment Variables: Make sure that the CHATCHAT_ROOT environment variable is set correctly to /root/chatchat_data. This ensures that the application looks in the right directory for its data and configuration files.

  4. Permissions: Verify that the user running the application has the necessary permissions to read the files and directories in /root/chatchat_data.

  5. Reinitialize Data: If the issue persists, consider reinitializing the data directory by running chatchat init to regenerate any missing default configurations and directories.

If these steps do not resolve the issue, there might be a deeper configuration or environment problem that needs to be addressed.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@15927566740
Copy link
Author

It seems like the necessary files for the NLTK data are already downloaded and placed correctly in your /root/chatchat_data/data/nltk_data directory. Since you're still encountering a FileNotFoundError, here are a few additional steps you can take to troubleshoot the issue:

  1. Verify Configuration Files: Ensure that all configuration files (basic_settings.yaml, kb_settings.yaml, model_settings.yaml, prompt_settings.yaml, tool_settings.yaml) in /root/chatchat_data are correctly configured and not missing any required settings.
  2. Check Log Files: Review the log files located in /root/chatchat_data/data/logs for any additional error messages or warnings that might provide more context about the missing file or directory.
  3. Environment Variables: Make sure that the CHATCHAT_ROOT environment variable is set correctly to /root/chatchat_data. This ensures that the application looks in the right directory for its data and configuration files.
  4. Permissions: Verify that the user running the application has the necessary permissions to read the files and directories in /root/chatchat_data.
  5. Reinitialize Data: If the issue persists, consider reinitializing the data directory by running chatchat init to regenerate any missing default configurations and directories.

If these steps do not resolve the issue, there might be a deeper configuration or environment problem that needs to be addressed.

To continue talking to Dosu, mention @dosu.

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

root@354e4d900ca2:~/chatchat_data# ls
basic_settings.yaml data data.bak data.tar.gz kb_settings.yaml model_settings.yaml prompt_settings.yaml tool_settings.yaml
2.
the full logs is what I posted
3.
I already printed :export CHATCHAT_ROOT=/root/chatchat_data
4.
I'm running it as root
5.
chatchat init still hasn't changed anyting...

@dosu.

Copy link

dosubot bot commented Dec 19, 2024

Since you've verified the configuration files, checked the logs, set the CHATCHAT_ROOT environment variable, ensured proper permissions, and reinitialized the data without resolving the issue, consider the following additional steps:

  1. Check for Missing Dependencies: Ensure all dependencies listed in the pyproject.toml file are installed correctly. You can do this by running poetry install or checking the installed packages manually [1].

  2. Inspect Log Files Again: Double-check the log files in /root/chatchat_data/data/logs for any overlooked details that might indicate the specific file or directory causing the FileNotFoundError.

  3. Review Network and Socket Configurations: The error might be related to network or socket configurations, especially if the application is trying to connect to a service or database. Ensure that all services the application depends on are running and accessible.

  4. Debugging Mode: Run the application in a debugging mode if available, to get more detailed error messages and stack traces that might help pinpoint the issue.

  5. Check for Hardcoded Paths: Look through the code for any hardcoded paths that might not align with your current directory structure.

If these steps do not resolve the issue, it might be helpful to isolate the problem by running a minimal version of the application or checking for any recent changes that could have introduced the error.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@948024326
Copy link

没得,试下python3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants