khoj-ai / khoj

Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
https://khoj.dev
GNU Affero General Public License v3.0
14.18k stars 705 forks source link

cant start server #598

Closed kalle07 closed 10 months ago

kalle07 commented 10 months ago

after is installed all fine without error in windows powershell env

error: ... (.venv) PS E:\khoj> khoj Traceback (most recent call last): File "E:\khoj.venv\Lib\site-packages\django\db\backends\base\base.py", line 289, in ensure_connection self.connect() File "E:\khoj.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\backends\base\base.py", line 270, in connect self.connection = self.get_new_connection(conn_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\backends\postgresql\base.py", line 275, in get_new_connection connection = self.Database.connect(conn_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\psycopg2__init__.py", line 122, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections? connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections?

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "E:\khoj.venv\Scripts\khoj.exe__main.py", line 4, in File "E:\khoj.venv\Lib\site-packages\khoj\main.py", line 40, in call_command("migrate", "--noinput") File "E:\khoj.venv\Lib\site-packages\django\core\management__init.py", line 194, in call_command return command.execute(*args, defaults) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\core\management\base.py", line 458, in execute output = self.handle(*args, *options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\core\management\base.py", line 106, in wrapper res = handle_func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\core\management\commands\migrate.py", line 117, in handle executor = MigrationExecutor(connection, self.migration_progress_callback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\migrations\executor.py", line 18, in init self.loader = MigrationLoader(self.connection) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\migrations\loader.py", line 58, in init__ self.build_graph() File "E:\khoj.venv\Lib\site-packages\django\db\migrations\loader.py", line 235, in build_graph self.applied_migrations = recorder.applied_migrations() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\migrations\recorder.py", line 81, in applied_migrations if self.has_table(): ^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\migrations\recorder.py", line 57, in has_table with self.connection.cursor() as cursor: ^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\backends\base\base.py", line 330, in cursor return self._cursor() ^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\backends\base\base.py", line 306, in _cursor self.ensure_connection() File "E:\khoj.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\backends\base\base.py", line 288, in ensure_connection with self.wrap_database_errors: File "E:\khoj.venv\Lib\site-packages\django\db\utils.py", line 91, in exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "E:\khoj.venv\Lib\site-packages\django\db\backends\base\base.py", line 289, in ensure_connection self.connect() File "E:\khoj.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\backends\base\base.py", line 270, in connect self.connection = self.get_new_connection(conn_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\django\db\backends\postgresql\base.py", line 275, in get_new_connection connection = self.Database.connect(conn_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\khoj.venv\Lib\site-packages\psycopg2__init__.py", line 122, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ django.db.utils.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections? connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections?

and all other local servers run, like automatic1111, privateGPT and so on ... what can it be ? oc "localhost" name is not alowed on my machine so only 127.0.0.1 , can that be the problem ?

debanjum commented 10 months ago

How have you installed Khoj on your machine? Which python and windows version are you using?

The error indicates that connection to the postgres db is not established. Have you setup postgres db?

We recommend using docker to setup on your local machine. If that doesn't work for you follow these instructions to setup khoj with pip

kalle07 commented 10 months ago

docer i get and WSL error and pgvector still experimental ... so ill wait ;)