Unable to access a knowledge base because of some version issue #4971

Closed
opened 2026-02-21 18:08:49 -05:00 by yindo · 7 comments
Owner

Originally created by @PeriwigXu on GitHub (Aug 9, 2024).

Originally assigned to: @crazywoola on GitHub.

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.16

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I was trying to config my knowledge base, but it told me there was a client-side exception.
knowledgebase-exception
I guess it was caused by some version mistakes of certain python packages, but I'm not sure how to solve it.
The error message is below.

✔️ Expected Behavior

No response

Actual Behavior

difyapi | /app/api/core/workflow/nodes/llm/llm_node.py:305: DeprecationWarning: This method is deprecated, use get instead.
difyapi | variable_value = variable_pool.get_any(variable_selector.value_selector)
difyapi | /app/api/core/workflow/nodes/llm/llm_node.py:353: DeprecationWarning: This method is deprecated, use get instead.
difyapi | context_value = variable_pool.get_any(node_data.context.variable_selector)
difyapi | /app/api/.venv/lib/python3.10/site-packages/pydantic/main.py:1282: PydanticDeprecatedSince20: The copy method is deprecated; use model_copy instead. See the docstring of BaseModel.copy for details about how to handle include and exclude. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/
difyapi | warnings.warn(
difyapi | /app/api/.venv/lib/python3.10/site-packages/pydantic/main.py:1358: PydanticDeprecatedSince20: The validate method is deprecated; use model_validate instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/
difyapi | warnings.warn(

Originally created by @PeriwigXu on GitHub (Aug 9, 2024). Originally assigned to: @crazywoola on GitHub. ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.16 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I was trying to config my knowledge base, but it told me there was a client-side exception. ![knowledgebase-exception](https://github.com/user-attachments/assets/937b8ec5-425a-49ab-8498-0e4a5cbd71f9) I guess it was caused by some version mistakes of certain python packages, but I'm not sure how to solve it. The error message is below. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior difyapi | /app/api/core/workflow/nodes/llm/llm_node.py:305: DeprecationWarning: This method is deprecated, use `get` instead. difyapi | variable_value = variable_pool.get_any(variable_selector.value_selector) difyapi | /app/api/core/workflow/nodes/llm/llm_node.py:353: DeprecationWarning: This method is deprecated, use `get` instead. difyapi | context_value = variable_pool.get_any(node_data.context.variable_selector) difyapi | /app/api/.venv/lib/python3.10/site-packages/pydantic/main.py:1282: PydanticDeprecatedSince20: The `copy` method is deprecated; use `model_copy` instead. See the docstring of `BaseModel.copy` for details about how to handle `include` and `exclude`. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/ difyapi | warnings.warn( difyapi | /app/api/.venv/lib/python3.10/site-packages/pydantic/main.py:1358: PydanticDeprecatedSince20: The `validate` method is deprecated; use `model_validate` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/ difyapi | warnings.warn(
yindo added the 🐞 bug label 2026-02-21 18:08:49 -05:00
yindo closed this issue 2026-02-21 18:08:49 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 9, 2024):

To resolve the client-side exception and deprecation warnings you're encountering in Dify v0.6.16, follow these steps:

  1. Update Python Packages:
    Ensure that the Python packages are updated to their latest compatible versions. You can do this by updating the requirements.txt file and using Poetry to manage dependencies.

    poetry shell
    poetry add $(cat requirements.txt)
    poetry add $(cat requirements-dev.txt) --group dev
    
  2. Handle Deprecation Warnings:
    The deprecation warnings indicate that certain methods are deprecated and should be replaced. Specifically:

    • Replace copy with model_copy.
    • Replace validate with model_validate.

    Update your code to use these new methods as per the Pydantic V2 Migration Guide.

  3. Configure SSL/TLS:
    Ensure that your self-hosted instance is using secure connections. Update your environment variables to use https URLs and configure SSL/TLS in your Docker setup.

    Example environment variables:

    CONSOLE_API_URL=https://api.console.dify.ai
    CONSOLE_WEB_URL=https://console.dify.ai
    SERVICE_API_URL=https://api.dify.ai
    APP_API_URL=https://app.dify.ai
    APP_WEB_URL=https://api.app.dify.ai
    

    Example Nginx configuration for SSL termination:

    server {
        listen 443 ssl;
        server_name your_domain.com;
    
        ssl_certificate /path/to/your/certificate.crt;
        ssl_certificate_key /path/to/your/private.key;
    
        location / {
            proxy_pass http://your_application_container:5001;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
    
  4. Check Vector Search Settings:
    Ensure that the vector search settings are correctly configured for English queries. Adjust the TopK, Score threshold, and Rerank model settings as needed.

    TopK: 3
    Score threshold: 0.5
    Rerank model: <API_KEY>
    

By following these steps, you should be able to resolve the client-side exception and deprecation warnings, ensuring a secure and functional setup for your knowledge base [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 9, 2024): <!-- Answer --> To resolve the client-side exception and deprecation warnings you're encountering in Dify v0.6.16, follow these steps: 1. **Update Python Packages:** Ensure that the Python packages are updated to their latest compatible versions. You can do this by updating the `requirements.txt` file and using Poetry to manage dependencies. ```bash poetry shell poetry add $(cat requirements.txt) poetry add $(cat requirements-dev.txt) --group dev ``` 2. **Handle Deprecation Warnings:** The deprecation warnings indicate that certain methods are deprecated and should be replaced. Specifically: - Replace `copy` with `model_copy`. - Replace `validate` with `model_validate`. Update your code to use these new methods as per the Pydantic V2 Migration Guide. 3. **Configure SSL/TLS:** Ensure that your self-hosted instance is using secure connections. Update your environment variables to use `https` URLs and configure SSL/TLS in your Docker setup. Example environment variables: ```env CONSOLE_API_URL=https://api.console.dify.ai CONSOLE_WEB_URL=https://console.dify.ai SERVICE_API_URL=https://api.dify.ai APP_API_URL=https://app.dify.ai APP_WEB_URL=https://api.app.dify.ai ``` Example Nginx configuration for SSL termination: ```nginx server { listen 443 ssl; server_name your_domain.com; ssl_certificate /path/to/your/certificate.crt; ssl_certificate_key /path/to/your/private.key; location / { proxy_pass http://your_application_container:5001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ``` 4. **Check Vector Search Settings:** Ensure that the vector search settings are correctly configured for English queries. Adjust the `TopK`, `Score threshold`, and `Rerank model` settings as needed. ```yaml TopK: 3 Score threshold: 0.5 Rerank model: <API_KEY> ``` By following these steps, you should be able to resolve the client-side exception and deprecation warnings, ensuring a secure and functional setup for your knowledge base <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/local-source-code.md)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/README.md)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/web/public/vs/language/typescript/tsWorker.js)</sup><sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/getting-started/install-self-hosted/environments.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 9, 2024):

Hello can you paste the errors in web console? It seems to be a frontend issue.

@crazywoola commented on GitHub (Aug 9, 2024): Hello can you paste the errors in web console? It seems to be a frontend issue.
Author
Owner

@PeriwigXu commented on GitHub (Aug 9, 2024):

Hello can you paste the errors in web console? It seems to be a frontend issue.

Sure
frontend_err

@PeriwigXu commented on GitHub (Aug 9, 2024): > Hello can you paste the errors in web console? It seems to be a frontend issue. Sure ![frontend_err](https://github.com/user-attachments/assets/cfec85b5-f104-4fb8-86bf-3bea552a0a60)
Author
Owner

@crazywoola commented on GitHub (Aug 9, 2024):

@dosu Generate a fix for this

Hello can you paste the errors in web console? It seems to be a frontend issue.

Sure frontend_err

@crazywoola commented on GitHub (Aug 9, 2024): @dosu Generate a fix for this > > Hello can you paste the errors in web console? It seems to be a frontend issue. > > Sure ![frontend_err](https://private-user-images.githubusercontent.com/35323725/356508762-cfec85b5-f104-4fb8-86bf-3bea552a0a60.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMxOTIyMzgsIm5iZiI6MTcyMzE5MTkzOCwicGF0aCI6Ii8zNTMyMzcyNS8zNTY1MDg3NjItY2ZlYzg1YjUtZjEwNC00ZmI4LTg2YmYtM2JlYTU1MmEwYTYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA5VDA4MjUzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFmMDYzMDAwODVhMTRlMTY1ZmQ0ODAwMWMyOGFmYmQ5ZGZjNThkM2E0YWQyZDQzZTNmOTVkNzUxZjM4YmMyOTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qq35Ao7IesL9MbM717stX8AcGOaLT8POAK570r37NPM)
Author
Owner

@dosubot[bot] commented on GitHub (Aug 9, 2024):

To address the frontend issues you're encountering, follow these steps:

  1. Deprecation Warnings for -ms-high-contrast-adjust:
    These warnings are related to CSS properties that are no longer supported. Update your CSS to remove or replace deprecated properties.

  2. 403 Error for Failed Resource Load:
    This error indicates a permission issue. Ensure that the resource URL is correct and that the server has the necessary permissions to access it. Check your server configuration and authentication settings.

  3. TypeError: Cannot Read Properties of Undefined (Reading 'extension'):
    This error suggests that a variable is being accessed before it is defined. Use optional chaining to prevent this error:

    const extension = someObject?.extension;
    
  4. TypeError: Cannot Read Properties of Null (Reading 'postMessage'):
    Similar to the previous error, this indicates that a null value is being accessed. Ensure that the object is not null before accessing its properties:

    if (someObject !== null) {
        someObject.postMessage(...);
    }
    
  5. General Debugging Steps:

    • Use Browser Developer Tools: Set breakpoints and inspect variables to identify where the errors are occurring.
    • Check for Undefined or Null Values: Add checks in your code to handle undefined or null values gracefully.
    • Review Code for Common Issues: Ensure that your code safely accesses properties and handles potential errors.

By following these steps, you should be able to resolve the client-side exceptions and improve the stability of your frontend application [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 9, 2024): <!-- Answer --> To address the frontend issues you're encountering, follow these steps: 1. **Deprecation Warnings for `-ms-high-contrast-adjust`**: These warnings are related to CSS properties that are no longer supported. Update your CSS to remove or replace deprecated properties. 2. **403 Error for Failed Resource Load**: This error indicates a permission issue. Ensure that the resource URL is correct and that the server has the necessary permissions to access it. Check your server configuration and authentication settings. 3. **TypeError: Cannot Read Properties of Undefined (Reading 'extension')**: This error suggests that a variable is being accessed before it is defined. Use optional chaining to prevent this error: ```js const extension = someObject?.extension; ``` 4. **TypeError: Cannot Read Properties of Null (Reading 'postMessage')**: Similar to the previous error, this indicates that a null value is being accessed. Ensure that the object is not null before accessing its properties: ```js if (someObject !== null) { someObject.postMessage(...); } ``` 5. **General Debugging Steps**: - **Use Browser Developer Tools**: Set breakpoints and inspect variables to identify where the errors are occurring. - **Check for Undefined or Null Values**: Add checks in your code to handle undefined or null values gracefully. - **Review Code for Common Issues**: Ensure that your code safely accesses properties and handles potential errors. By following these steps, you should be able to resolve the client-side exceptions and improve the stability of your frontend application <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/public/vs/language/typescript/tsWorker.js)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@yinlianggood commented on GitHub (Aug 16, 2024):

升级到最新版本,可以解决这个问题? 昨天新建的知识库还是正常的, 今天就打开报这个错了

@yinlianggood commented on GitHub (Aug 16, 2024): 升级到最新版本,可以解决这个问题? 昨天新建的知识库还是正常的, 今天就打开报这个错了
Author
Owner

@crazywoola commented on GitHub (Sep 23, 2024):

It should be fixed in 0.8.x

@crazywoola commented on GitHub (Sep 23, 2024): It should be fixed in 0.8.x
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4971