[wenxin] Bad Request Error, 'results' #7007

Closed
opened 2026-02-21 18:18:23 -05:00 by yindo · 5 comments
Owner

Originally created by @johnduan888 on GitHub (Dec 1, 2024).

Originally assigned to: @yihong0618 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.12.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Recall topK and retrieve topK issues

image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @johnduan888 on GitHub (Dec 1, 2024). Originally assigned to: @yihong0618 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.12.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce Recall topK and retrieve topK issues ![image](https://github.com/user-attachments/assets/9bc18d7c-3852-4383-ac16-159dc0e99321) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:18:23 -05:00
yindo closed this issue 2026-02-21 18:18:23 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 1, 2024):

The 'Bad Request Error' related to the 'results' field in Dify version 0.12.1 could be due to several specific error codes and messages. Here are some potential causes:

  1. App Configuration Issues:

    • AppUnavailableError with the message "App unavailable, please check your app configurations."
  2. API Route Mismatches:

    • NotCompletionAppError, NotChatAppError, or NotWorkflowAppError indicating a mismatch between the app mode and the API route.
  3. Conversation State:

    • ConversationCompletedError indicating that the conversation has ended and a new one needs to be started.
  4. Provider Configuration:

    • ProviderNotInitializeError or ProviderQuotaExceededError related to model provider credentials or quota issues.
  5. Model Support:

    • ProviderModelCurrentlyNotSupportError indicating unsupported models in the current setup.
  6. Request Failures:

    • CompletionRequestError indicating a failure in the completion request.
  7. File Upload Issues:

    • Errors like NoAudioUploadedError, ProviderNotSupportSpeechToTextError, NoFileUploadedError, or TooManyFilesError related to file uploads.

These errors might be affecting the 'recall topK' and 'retrieve topK' features if they are part of the request or response handling process. Ensure that your app configurations, API routes, and provider settings are correctly set up to avoid these errors [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Dec 1, 2024): <!-- Answer --> The 'Bad Request Error' related to the 'results' field in Dify version 0.12.1 could be due to several specific error codes and messages. Here are some potential causes: 1. **App Configuration Issues**: - `AppUnavailableError` with the message "App unavailable, please check your app configurations." 2. **API Route Mismatches**: - `NotCompletionAppError`, `NotChatAppError`, or `NotWorkflowAppError` indicating a mismatch between the app mode and the API route. 3. **Conversation State**: - `ConversationCompletedError` indicating that the conversation has ended and a new one needs to be started. 4. **Provider Configuration**: - `ProviderNotInitializeError` or `ProviderQuotaExceededError` related to model provider credentials or quota issues. 5. **Model Support**: - `ProviderModelCurrentlyNotSupportError` indicating unsupported models in the current setup. 6. **Request Failures**: - `CompletionRequestError` indicating a failure in the completion request. 7. **File Upload Issues**: - Errors like `NoAudioUploadedError`, `ProviderNotSupportSpeechToTextError`, `NoFileUploadedError`, or `TooManyFilesError` related to file uploads. These errors might be affecting the 'recall topK' and 'retrieve topK' features if they are part of the request or response handling process. Ensure that your app configurations, API routes, and provider settings are correctly set up to avoid these errors <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/controllers/web/error.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@johnduan888 commented on GitHub (Dec 2, 2024):

@dosu
When Recall topK > retrieve topK, using bce_reranker_base, an error will be reported: core.model_runtime errors. Invoke. InvokeBadRequestError: [wenxin] Bad Request Error, 'results'

@johnduan888 commented on GitHub (Dec 2, 2024): @dosu When Recall topK > retrieve topK, using bce_reranker_base, an error will be reported: core.model_runtime errors. Invoke. InvokeBadRequestError: [wenxin] Bad Request Error, 'results'
Author
Owner

@dosubot[bot] commented on GitHub (Dec 2, 2024):

The error you're encountering, InvokeBadRequestError related to the 'results' key, might be due to a mismatch or misconfiguration when using bce_reranker_base with 'recall topK' and 'retrieve topK'. This error typically indicates that the request made to the server was malformed or invalid. Here are a few things you might want to check:

  1. Configuration Mismatch: Ensure that the configurations for bce_reranker_base are correctly set up to handle the number of items specified by 'recall topK' and 'retrieve topK'. If 'recall topK' is greater than 'retrieve topK', it might lead to unexpected behavior if the reranker is not configured to handle such cases.

  2. Data Handling: Verify that the data being processed by the reranker is correctly formatted and that all necessary fields, including 'results', are present and correctly populated.

  3. Error Handling: Review the error handling mechanisms in place for the core.model_runtime module to ensure that any potential issues are being caught and managed appropriately.

  4. Version Compatibility: Check if there are any known issues or updates in the Dify documentation or release notes that address this specific scenario.

If these steps do not resolve the issue, you might need to delve deeper into the specific implementation details of bce_reranker_base and how it interacts with the 'recall topK' and 'retrieve topK' processes.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Dec 2, 2024): <!-- Answer --> The error you're encountering, `InvokeBadRequestError` related to the 'results' key, might be due to a mismatch or misconfiguration when using `bce_reranker_base` with 'recall topK' and 'retrieve topK'. This error typically indicates that the request made to the server was malformed or invalid. Here are a few things you might want to check: 1. **Configuration Mismatch**: Ensure that the configurations for `bce_reranker_base` are correctly set up to handle the number of items specified by 'recall topK' and 'retrieve topK'. If 'recall topK' is greater than 'retrieve topK', it might lead to unexpected behavior if the reranker is not configured to handle such cases. 2. **Data Handling**: Verify that the data being processed by the reranker is correctly formatted and that all necessary fields, including 'results', are present and correctly populated. 3. **Error Handling**: Review the error handling mechanisms in place for the `core.model_runtime` module to ensure that any potential issues are being caught and managed appropriately. 4. **Version Compatibility**: Check if there are any known issues or updates in the Dify documentation or release notes that address this specific scenario. If these steps do not resolve the issue, you might need to delve deeper into the specific implementation details of `bce_reranker_base` and how it interacts with the 'recall topK' and 'retrieve topK' processes. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@yihong0618 commented on GitHub (Dec 2, 2024):

@dq7532183 its because baidu rerank model topK can not bigger than the documents length.

can you make topK smaller than try it again?
make topK smaller to 1 and give a try
image

@laipz8200 I would like to make this better because baidu status_code always 200....the try catch things did not handle the error ....
can I do that?

@yihong0618 commented on GitHub (Dec 2, 2024): @dq7532183 its because baidu rerank model topK can not bigger than the documents length. can you make topK smaller than try it again? make topK smaller to 1 and give a try ![image](https://github.com/user-attachments/assets/997ad083-3b2e-4b0f-b723-bf0026c346b0) @laipz8200 I would like to make this better because baidu status_code always 200....the try catch things did not handle the error .... can I do that?
Author
Owner

@laipz8200 commented on GitHub (Dec 3, 2024):

@yihong0618 Of course! Feel free to do it!

@laipz8200 commented on GitHub (Dec 3, 2024): @yihong0618 Of course! Feel free to do it!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7007