Skip to content

[Bug]: An error occurred while processing the request: terminated (When LLM response takes >5 min) #13577

Description

@Svagtlys

What happened?

When my LLM backend spends a long time (seems to be over 5 minutes) processing a prompt without returning tokens, I get the following error in LibreChat:

Something went wrong. Here's the specific error message we encountered: An error occurred while processing the request: terminated

When the backend subsequently tries to reach out to LibreChat, this error appears in the backend's logs:

[Error] (HttpClient) CURL error: Failed writing received data to disk/application
[Error] (WrappedServer) Streaming request failed: CURL error: Failed writing received data to disk/application
[Info] (Process) srv stop: cancel task, id_task = 1830

These errors seem to be specific to LibreChat, as other frontends (OpenCode) do not have anything similar even with similarly long (or longer) processing times. I assume that LibreChat closes the connection if it doesn't receive a response from the LLM backend in a certain amount of time. I haven't found any information in the LibreChat docs on increasing the timeout via config.

Version Information

registry.librechat.ai/danny-avila/librechat-api:latest 73c23d345657

No special build args

Steps to Reproduce

  1. Prompt in LibreChat something that will take a model a long time to process (generally happens after a lot of web searches, for me)
  2. Wait 5+ minutes
  3. Error appears in LibreChat UI, then when model responds the CURL error appears in the backend logs

What browsers are you seeing the problem on?

Firefox

Relevant log output

Browser logs:

19:16:48.626 [ResumableSSE] Stream aborted (intentional close) - no reconnect index.C1VeOx9R.js:2:1094680
19:16:48.875 Uncaught TypeError: can't access property "status", this.xhr is null
    _onStreamFailure https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    stream https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    SSE https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    V https://chat.domain.tld/assets/index.C1VeOx9R.js:2
    <anonymous> https://chat.domain.tld/assets/index.C1VeOx9R.js:2
    async* https://chat.domain.tld/assets/index.C1VeOx9R.js:2
    el https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    bc https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    yc https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    yc https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    oc https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Bi https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    ec https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    ec https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Jl https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Qa https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Batcher https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    l https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    applyActionsToStore https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    queueOrPerformStateUpdate https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    setRecoilValue https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    useSetRecoilState https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    _ https://chat.domain.tld/assets/index.C1VeOx9R.js:2
    R https://chat.domain.tld/assets/index.C1VeOx9R.js:2
    u https://chat.domain.tld/assets/index.C1VeOx9R.js:2
    de https://chat.domain.tld/assets/forms.BwoCjvk7.js:1
    Pe https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    qe https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Ir https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Ir https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Lr https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    zr https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Re https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    zr https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Vt https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Ft https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    S https://chat.domain.tld/assets/index.C1VeOx9R.js:2
    Pe https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    qe https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Ir https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Ir https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Lr https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    zr https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    ac https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Re https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    zr https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Vt https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
    Ft https://chat.domain.tld/assets/vendor.CFTORYSF.js:1
vendor.CFTORYSF.js:1:1860282
19:16:48.931 XHR
GET
https://chat.domain.tld/api/mcp/servers
[HTTP/2 401  6ms]

19:16:48.945 401 error, refreshing token index.C1VeOx9R.js:2:206270
19:16:48.983 tokenUpdated event received event index.C1VeOx9R.js:2:599248

Screenshots

Image

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions