khoj-ai / khoj

Your AI second brain. Get answers to your questions, whether they be online or in your own notes. Use online AI models (e.g gpt4) or private, local LLMs (e.g llama3). Self-host locally or use our cloud instance. Access from Obsidian, Emacs, Desktop app, Web or Whatsapp.
https://khoj.dev
GNU Affero General Public License v3.0
12.4k stars 628 forks source link

[FIX] If more than 25 files are uploaded at once, the emacs client becomes unresponsive or the server responds with an error #726

Closed yuzhou721 closed 3 months ago

yuzhou721 commented 4 months ago

Describe the bug

Such as the title

To Reproduce

Steps to reproduce the behavior: After setting up the directory, execute khoj--server-index-files

Screenshots

message buffer

khoj.el: Failed to update allcontent index. Status: http 400. Response: {"detail":"There was an error parsing the body"}
error in process sentinel: url-http-async-sentinel: Output file descriptor of app.khoj.dev is closed
error in process sentinel: Output file descriptor of app.khoj.dev is closed

Platform

If self-hosted

Additional context

Sending a lot of files with url.el doesn't seem very stable, could you change it to curl? If possible I can submit a RP

yuzhou721 commented 4 months ago

Found two issues:

  1. File name encoding issue (Chinese characters in file names will cause errors on the backend)
  2. Tried sending in batches, able to send all 20 at a time.