langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
53.72k stars 7.87k forks source link

Failed to load YAML file #6776

Closed muckthaa-ss closed 3 months ago

muckthaa-ss commented 4 months ago

Self Checks

Dify version

0..15

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

image 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

dosubot[bot] commented 4 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:

Follow the prompts to reset the keys [2].

To continue talking to Dosu, mention @dosu.

muckthaa-ss commented 4 months ago

but the same retaines

crazywoola commented 4 months ago

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'
muckthaa-ss commented 4 months ago

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.

yuy12 commented 4 months ago

Hello, I'm encountering the same issue. Has this problem been resolved? How was it resolved? Thank you very much.

muckthaa-ss commented 4 months ago

@yuy12 the isssue still persists but does not affect the dify working. Thank You

Kimi-Gao commented 4 months ago

same issue