Closed muckthaa-ss closed 2 months ago
The Errno 2: No such file or directory
errors occur because the code is trying to access YAML files that do not exist in the specified directory. To resolve this issue, ensure that the required YAML files are present in the directory /home/ubuntu/dify/api/core/model_runtime/model_providers/
. Specifically, the directory structure should include the appropriate provider and model type subdirectories, and these subdirectories should contain the necessary YAML files.
Here is the relevant part of the code that constructs the directory path and attempts to list the YAML files:
# get the path of current classes
current_path = os.path.abspath(__file__)
# get parent path of the current path
provider_name = self.__class__.__module__.split('.')[-3]
model_type = self.__class__.__module__.split('.')[-1]
provider_model_type_path = os.path.join(os.path.dirname(os.path.dirname(current_path)), provider_name, model_type)
# get all yaml files path under provider_model_type_path that do not start with __
model_schema_yaml_paths = [
os.path.join(provider_model_type_path, model_schema_yaml)
for model_schema_yaml in os.listdir(provider_model_type_path)
if not model_schema_yaml.startswith('__')
and not model_schema_yaml.startswith('_')
and os.path.isfile(os.path.join(provider_model_type_path, model_schema_yaml))
and model_schema_yaml.endswith('.yaml')
]
Ensure that the directory /home/ubuntu/dify/api/core/model_runtime/model_providers/
contains the necessary subdirectories and YAML files as expected by the code [1].
Additionally, if you encounter a "File not found" error in the logs when deploying locally, it may be caused by switching deployment methods or deleting the api/storage/privkeys
file, which is used to encrypt large model keys. You can reset the encryption public and private keys with the following command:
Docker compose deployment:
docker exec -it docker-api-1 flask reset-encrypt-key-pair
Source code startup: Enter the api directory and run:
flask reset-encrypt-key-pair
Follow the prompts to reset the keys [2].
To continue talking to Dosu, mention @dosu.
but the same retaines
What commands did you run to upgrade to the v0.6.15?
You could check these files in that directory. I guess you failed to merge the code by running the git pull
command.
/home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/text_embedding/_position.yaml'
Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/rerank/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/rerank/_position.yaml'
There is no such path available in the github repository like "dify/api/core/model_runtime/model_providers/sagemaker/text_embedding/_position.yaml" and similarly for other failed to load YAML messages also. There is a _position.yaml in the "dify/api/core/model_runtime/model_provider" path.
Hello, I'm encountering the same issue. Has this problem been resolved? How was it resolved? Thank you very much.
@yuy12 the isssue still persists but does not affect the dify working. Thank You
same issue
Self Checks
Dify version
0..15
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openai/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openai/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openai/speech2text/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openai/speech2text/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openai/moderation/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openai/moderation/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openai/tts/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openai/tts/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/speech2text/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/speech2text/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/tts/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/azure_openai/tts/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/google/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/google/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/vertex_ai/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/vertex_ai/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/vertex_ai/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/vertex_ai/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/nvidia/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/nvidia/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/nvidia/rerank/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/nvidia/rerank/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/nvidia_nim/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/nvidia_nim/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/togetherai/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/togetherai/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/ollama/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/ollama/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/ollama/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/ollama/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/replicate/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/replicate/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/replicate/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/replicate/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/huggingface_hub/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/huggingface_hub/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/huggingface_hub/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/huggingface_hub/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/rerank/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/rerank/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/speech2text/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/xinference/speech2text/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/triton_inference_server/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/triton_inference_server/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/zhipuai/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/zhipuai/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/zhipuai/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/zhipuai/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/baichuan/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/baichuan/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/baichuan/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/baichuan/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/minimax/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/minimax/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/minimax/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/minimax/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/tongyi/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/tongyi/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/tongyi/tts/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/tongyi/tts/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/tongyi/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/tongyi/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/wenxin/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/wenxin/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/tencent/speech2text/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/tencent/speech2text/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/jina/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/jina/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/chatglm/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/chatglm/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openllm/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openllm/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openllm/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openllm/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/localai/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/localai/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/localai/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/localai/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/localai/rerank/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/localai/rerank/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/localai/speech2text/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/localai/speech2text/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/volcengine_maas/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/volcengine_maas/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/volcengine_maas/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/volcengine_maas/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openai_api_compatible/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openai_api_compatible/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/openai_api_compatible/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/openai_api_compatible/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/perfxcloud/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/perfxcloud/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/novita/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/novita/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/llm/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/llm/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/text_embedding/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/text_embedding/_position.yaml' Failed to load YAML file /home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/rerank/_position.yaml: [Errno 2] No such file or directory: '/home/ubuntu/dify/api/core/model_runtime/model_providers/sagemaker/rerank/_position.yaml' 2024-07-29 19:51:58,771.771 WARNING [MainThread] [ext_mail.py:50] - MAIL_TYPE is not set
✔️ Expected Behavior
flask upgrade
❌ Actual Behavior
error