dify icon indicating copy to clipboard operation
dify copied to clipboard

Chat API error - `Unable to retrieve billing information`

Open OrWestSide opened this issue 1 year ago • 4 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.0

Cloud or Self Hosted

Cloud

Steps to reproduce

We are facing issues with the /chat-messages endpoint. In some cases, we get a 400 error and the body we get back is the following:

{
    "code": "invalid_param", 
    "message": "Run failed: Unable to retrieve billing information. Please try again later or contact support.", 
    "status": 400
}

This is the request body we are sending:

{
    "query": "hello", 
    "inputs": {....}, 
    "response_mode": "blocking", 
    "user": "xxx",
    "conversation_id": "yyy"
}

The behavior we observe is inconsistent and seems to occur randomly. Specifically:

  • The first request often fails, but subsequent requests tend to succeed.
  • This behavior resembles a "cold start" issue, where the initial request triggers an error while subsequent ones function as expected.

Also, when logging in our dashboard, we get the same message with a popup. The network tab verifies the failed request: image

✔️ Expected Behavior

Requests to /chat-messages should be successful

❌ Actual Behavior

Requests to /chat-messages are (randomly) failing

OrWestSide avatar Jan 08 '25 11:01 OrWestSide

Hey @OrWestSide! I'm a bot here to help you with bug fixes, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer.

The error message "Unable to retrieve billing information" occurs when a GET request is made using the _send_request method, and the response status code is not httpx.codes.OK [1]. This could be related to the initial request failing due to a "cold start" issue, where the first request triggers an error, but subsequent requests succeed.

To address this, you might want to check the following:

  1. Network Stability: Ensure that there are no network issues that could be causing the initial request to fail.
  2. Service Dependencies: Verify if there are any dependencies or external services involved in the billing information retrieval process that might be affecting the /chat-messages endpoint.
  3. Rate Limiting: Check if there is any rate limiting or throttling mechanism in place that could be contributing to the observed behavior.

If the issue persists, consider logging additional details around the failed requests to identify any patterns or specific conditions that lead to the error.

To continue talking to Dosu, mention @dosu.


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

dosubot[bot] avatar Jan 08 '25 11:01 dosubot[bot]

+1

k99k5 avatar Jan 08 '25 17:01 k99k5

i have the same problem

gianlukamoraes avatar Jan 08 '25 20:01 gianlukamoraes

+1

Sakura4036 avatar Jan 09 '25 01:01 Sakura4036

We are fixing this.

crazywoola avatar Jan 09 '25 02:01 crazywoola

We're facing the same issue

sugoh avatar Jan 09 '25 04:01 sugoh

We have fixed it, however the Actions is down on GitHub, so we haven't released to the production yet.

crazywoola avatar Jan 09 '25 04:01 crazywoola

The fix has been published. @crazywoola

GarfieldDai avatar Jan 09 '25 07:01 GarfieldDai