PluginInvokeError: 400 Bad Request from Perplexity Plugin in Dify #146

Closed
opened 2026-02-16 10:18:14 -05:00 by yindo · 6 comments
Owner

Originally created by @svnshikhil on GitHub (Mar 28, 2025).

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

1.1.3

Cloud or Self Hosted

Cloud

Steps to reproduce

  • Install the Perplexity plugin from the Dify Plugin Marketplace.

  • Attempt to invoke it through a workflow or tool call.

  • Observe the error response.

✔️ Expected Behavior

The plugin should return a valid response from the Perplexity API, or at least provide a clearer error message indicating what is wrong with the request.

Actual Behavior

Instead of returning a response, the plugin throws the following error:
Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"HTTPError","message":"400 Client Error: Bad Request for url: https://api.perplexity.ai/chat/completions"}

Environment:

  • Dify Version: 1.1.3
  • Plugin Version: 0.0.3

Image

Originally created by @svnshikhil on GitHub (Mar 28, 2025). ### 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 1.1.3 ### Cloud or Self Hosted Cloud ### Steps to reproduce - Install the Perplexity plugin from the Dify Plugin Marketplace. - Attempt to invoke it through a workflow or tool call. - Observe the error response. ### ✔️ Expected Behavior The plugin should return a valid response from the Perplexity API, or at least provide a clearer error message indicating what is wrong with the request. ### ❌ Actual Behavior Instead of returning a response, the plugin throws the following error: `Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"HTTPError","message":"400 Client Error: Bad Request for url: https://api.perplexity.ai/chat/completions"}` **Environment**: - Dify Version: 1.1.3 - Plugin Version: 0.0.3 ![Image](https://github.com/user-attachments/assets/d5b48b3e-5bbd-4d1e-8a15-2029b4fe821a)
yindo closed this issue 2026-02-16 10:18:14 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 28, 2025):

Hello @svnshikhil! I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's tackle this issue together!

A 400 Bad Request error in the Dify platform when using the Perplexity plugin can be caused by several factors. Here are some common causes and potential solutions:

  1. Incorrect Input Format: Ensure that the input to the Perplexity plugin is correctly formatted. The expected input is a JSON object with knowledge_id (string), query (string), and retrieval_setting (object) containing top_k (int) and score_threshold (float). If metadata_condition is used, it should be an object with a conditions array [1].

  2. Special Characters in Request: If the request body contains special characters like newlines, ensure that the body format is set to 'JSON' instead of 'raw' in the HTTP request configuration to avoid formatting issues [2].

  3. API Endpoint Issues: Verify that the correct API endpoint is being used. The error message indicates a problem with the URL, so double-check the endpoint URL for any typos or incorrect paths [3].

  4. Network Restrictions: Ensure that there are no network restrictions preventing access to the Perplexity API. This can include firewall settings or lack of internet access [2].

  5. Plugin Version Compatibility: Make sure that the plugin version is compatible with the Dify platform version you are using. Recent updates to the platform might affect plugin functionality [4].

If these steps do not resolve the issue, consider using Dify's remote debugging feature to gain more detailed insights into the error [5].

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Mar 28, 2025): <!-- Greeting --> Hello @svnshikhil! I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's tackle this issue together! <!-- Answer --> A 400 Bad Request error in the Dify platform when using the Perplexity plugin can be caused by several factors. Here are some common causes and potential solutions: 1. **Incorrect Input Format**: Ensure that the input to the Perplexity plugin is correctly formatted. The expected input is a JSON object with `knowledge_id` (string), `query` (string), and `retrieval_setting` (object) containing `top_k` (int) and `score_threshold` (float). If `metadata_condition` is used, it should be an object with a `conditions` array <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/knowledge-base/external-knowledge-api-documentation.md)</sup>. 2. **Special Characters in Request**: If the request body contains special characters like newlines, ensure that the body format is set to 'JSON' instead of 'raw' in the HTTP request configuration to avoid formatting issues <sup>[[2]](https://github.com/langgenius/dify/issues/15210)</sup>. 3. **API Endpoint Issues**: Verify that the correct API endpoint is being used. The error message indicates a problem with the URL, so double-check the endpoint URL for any typos or incorrect paths <sup>[[3]](https://github.com/langgenius/dify/issues/16384)</sup>. 4. **Network Restrictions**: Ensure that there are no network restrictions preventing access to the Perplexity API. This can include firewall settings or lack of internet access <sup>[[2]](https://github.com/langgenius/dify/issues/15210)</sup>. 5. **Plugin Version Compatibility**: Make sure that the plugin version is compatible with the Dify platform version you are using. Recent updates to the platform might affect plugin functionality <sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/tools/tool-configuration/Perplexity.md)</sup>. If these steps do not resolve the issue, consider using Dify's remote debugging feature to gain more detailed insights into the error <sup>[[5]](https://github.com/langgenius/dify-docs/blob/main/jp/plugins/quick-start/develop-plugins/extension-plugin.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/9dbaf8bc-01c6-4948-895e-f8b2df26b7d3?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/9dbaf8bc-01c6-4948-895e-f8b2df26b7d3?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/9dbaf8bc-01c6-4948-895e-f8b2df26b7d3?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/9dbaf8bc-01c6-4948-895e-f8b2df26b7d3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9dbaf8bc-01c6-4948-895e-f8b2df26b7d3?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/9dbaf8bc-01c6-4948-895e-f8b2df26b7d3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9dbaf8bc-01c6-4948-895e-f8b2df26b7d3?feedback_type=other)</sup>
Author
Owner

@lleites commented on GitHub (Mar 28, 2025):

I have the same issue, just started with the platform today, no sure if it is relevant but maybe it is an issue for newbies only.

@lleites commented on GitHub (Mar 28, 2025): I have the same issue, just started with the platform today, no sure if it is relevant but maybe it is an issue for newbies only.
Author
Owner

@lleites commented on GitHub (Mar 28, 2025):

I tried the code of the client used in the plugin, only with the token + tool_parameters= {"query": "What is the capital of France?"} and it works well, so it is not changes on the API or else.
Probably there is a regression in the new Dify version.

@lleites commented on GitHub (Mar 28, 2025): I tried the code of the client used in the plugin, only with the token + `tool_parameters= {"query": "What is the capital of France?"}` and it works well, so it is not changes on the API or else. Probably there is a regression in the new Dify version.
Author
Owner

@WolfricWang commented on GitHub (Mar 30, 2025):

Same issue for me, finally find out why this happen. Wish the pull request approved soon.

@WolfricWang commented on GitHub (Mar 30, 2025): Same issue for me, finally find out why this happen. Wish the pull request approved soon.
Author
Owner

@svnshikhil commented on GitHub (Apr 1, 2025):

Fixed - https://github.com/langgenius/dify-official-plugins/pull/606

@svnshikhil commented on GitHub (Apr 1, 2025): Fixed - https://github.com/langgenius/dify-official-plugins/pull/606
Author
Owner

@k-symmons commented on GitHub (Apr 2, 2025):

Same issue still occurring to me (0.04)

@k-symmons commented on GitHub (Apr 2, 2025): Same issue still occurring to me (0.04)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#146