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
11.95k stars 595 forks source link

[FIX] Docker-compose up #748

Open JC1738 opened 1 month ago

JC1738 commented 1 month ago

Describe the bug

A clear and concise description of what the bug is. Please include what you were expecting to happen vs. what actually happened.

CleanShot 2024-05-24 at 14 47 25

To Reproduce

Steps to reproduce the behavior:

Downloaded the sample docker-compse.yml and updated the user/password and ran docker-compose up

Screenshots

If applicable, add screenshots to help explain your problem.

Platform

If self-hosted

Additional context

Add any other context about the problem here.

JC1738 commented 1 month ago

I tried two different ubuntu machines (pop and regular) running 22.04 and get the same error. I was able to get it to work if I build the docker image. So unblocked, bug still think there is something wrong.

willlee1995 commented 1 month ago

Same here for linux NAS. I have not tried building from scratch, I am able to work from my windows host, but not in a NAS linux server. Wondering why the log won't show anything in the docker container even I use --verbose=1 to hopefully get the logger show up some errors. No luck now. Still, not blocked.

ssuukk commented 1 month ago

Same on Synology NAS. Just fails with server-1 exited with code 132, running it manually produces nothing:

root@storage2:~/khoj# docker-compose run server /bin/bash
WARN[0000] /root/khoj/docker-compose.yaml: `version` is obsolete
[+] Creating 1/0
 ✔ Container khoj-database-1  Running                                                                                                                                            0.0s

root@storage2:~/khoj#

Found this in dmesg:

[2869088.218453] traps: python3[21932] trap invalid opcode ip:7f8e2643d25b sp:7ffff75753b0 error:0 in libllama.so[7f8e26321000+135000]
GabrielLanghans commented 1 month ago

Same error here

nmathey commented 4 weeks ago

Same here on Synology NAS: any workaround available yet? Should we try specific OS/Arch image https://github.com/khoj-ai/khoj/pkgs/container/khoj?

For now issue happen with release 1.13, 1.12.1 and 1.11.0

nmathey commented 4 weeks ago

Ok all docker images are getting the same issue starting release 1.9.0 included. It DOES work with 1.8.0 and lower (at least the container is up and running) It might be related to https://github.com/khoj-ai/khoj/pull/680 which sounds link with the error you get in dmesg @ssuukk https://github.com/khoj-ai/khoj/issues/748#issuecomment-2139134293.

@JC1738 maybe we can change the title of this issue to be more precise?

sabaimran commented 4 weeks ago

Hey guys, I'm trying to reproduce this error. I just did a clean install on my Ubuntu 22.04.2 LTS with 16 GB RAM and it's working fine for me. Do you mind sharing more about your machine specs?

Sometimes when docker containers immediately exit like that, it's because of a memory constraint. You can try increasing the allocated memory to the Docker conatiner You can see some instructions on how to do that here for Linux.

This is happening at first run? Can you try building it again with KHOJ_DEBUG=True in your environment variables and see if that gives you anymore info?

nmathey commented 4 weeks ago

Me and @ssuukk trying to make it work on our Synology NAS. I got my self 16G Ram on it but I think the only thing I can do with memory and cpu is limitation which it is not active, so I guess it is getting all ressource it can I guess.

Yes it did happen on very first run.

I'll try rebuilding with debug on and let you know.

nmathey commented 4 weeks ago

Since the container stop immediately after few seconds I can't get any logs actually. Here are my NAS specs

Capture d’écran 2024-06-09 à 16 24 30

Here is Docker engine info

  Version:          20.10.23
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.19.1
  Git commit:       5fcb1cf
  Built:            Fri Sep  8 08:18:18 2023
  OS/Arch:          linux/amd64
  Experimental:     false