ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
14.26k stars 1.37k forks source link

Axios exception broke backend, and also broke thread #368

Open aledalgrande opened 1 month ago

aledalgrande commented 1 month ago

Describe the bug

I was in a 4-5 messages deep search thread and at a certain point the loading icon kept spinning with no result. So I looked in the BE logs and I found:

error: Unhandled Rejection at: [object Promise], reason: AxiosError: Request failed with status code 400
error: Unhandled Rejection at: [object Promise], reason: AxiosError: Request failed with status code 400

I decided to restart that docker container. Then I refreshed the browser page and the UI was broken because I didn't have an input field any more so I couldn't continue the conversation. Even if I go to a new conversation and then visit the history and reopen this thread I cannot continue it.

I tried "rewrite" and that also failed.

New threads work normally.

To Reproduce

Unfortunately I don't know how to reproduce this. I am using Ollama with Llama 3.1 8B on a M1 Max 64GB. I think in dev it might be possible by trying to recreate a failed network request for the BE container/service.

Edit: It seems it was this in the search engine that then broke the BE:

ERROR:searx.engines.wolframalpha: HTTP requests timeout (search duration : 6.227550462000181 s, timeout: 6.0 s) : TimeoutException

Expected behavior

Ideally, a network issue would stop the loader state and show an error and allow to retry. Also threads shouldn't get into a broken state.

Screenshots

See empty bottom of the page:

Screenshot 2024-09-21 at 4 35 46 PM
ItzCrazyKns commented 1 week ago

Rewrite has been fixed in the latest commits, can you try creating a new chat and see if that works. (After updating)

ironicbadger commented 3 days ago

Using the example docker-compose.yaml I still see similar behavior.

perplexica-backend-1   | error: Unhandled Rejection at: [object Promise], reason: AxiosError: Request failed with status code 403
perplexica-backend-1   | error: Error in image search: Request failed with status code 403
perplexica-backend-1   | error: Unhandled Rejection at: [object Promise], reason: AxiosError: Request failed with status code 403

The chat just hangs until refreshed or a new chat is started. Happens most chats after 2-3+ responses.

ItzCrazyKns commented 8 hours ago

What are the logs from SearXNG?

Using the example docker-compose.yaml I still see similar behavior.

perplexica-backend-1   | error: Unhandled Rejection at: [object Promise], reason: AxiosError: Request failed with status code 403
perplexica-backend-1   | error: Error in image search: Request failed with status code 403
perplexica-backend-1   | error: Unhandled Rejection at: [object Promise], reason: AxiosError: Request failed with status code 403

The chat just hangs until refreshed or a new chat is started. Happens most chats after 2-3+ responses.