kreneskyp / ix

Autonomous GPT-4 agent platform
MIT License
1.01k stars 121 forks source link

Help with installation #249

Closed Artsen closed 1 year ago

Artsen commented 1 year ago

I have followed the instructions step-by-step but I am still running into errors. I can get the docker cluster to run: bd-1, nginx-1, redis-1, web-1 but worker-1 will not stay up with the following error: exec /usr/bin/ix/celery.sh: no such file or directory

additionally when i try to go to the web interface i get just a blank white screen and an error saying /static/js/main.js tossing "ERR_CONNECTION_REFUSED" with nginx throwing: [error] 29#29: *10 open() "/var/static/js/main.js" failed (2: No such file or directory), client: 172.26.0.1, server: 0.0.0.0, request: "GET /static/js/main.js HTTP/1.1", host: "localhost:8000", referrer: "http://localhost:8000/" nginx is running on 8000 and web-1 doesnt show any errors and is running on 8001

any tips?

kreneskyp commented 1 year ago

What command did you use to start the cluster?

Artsen commented 1 year ago

I ran the docker file within the project, i tried using the make dev_setup at first but make would not run for me in windows

kreneskyp commented 1 year ago

Are you running in windows or in WSL?

Artsen commented 1 year ago

I tried in VSCode and then ran it in WSL but was getting an error about docker wsl2. The docker setting is enabled for wsl2, and wsl2 is installed. When trying to install docker within WSL I was met with errors.

WSL Ubuntu was the build

kreneskyp commented 1 year ago

Can you post a stack trace of build errors?

Artsen commented 1 year ago

ix@MC-L000:~$ make dev_setup echo building SANDBOX ghcr.io/kreneskyp/ix/sandbox:47dd2181e8e771de66565b54a6c66e1f building SANDBOX ghcr.io/kreneskyp/ix/sandbox:47dd2181e8e771de66565b54a6c66e1f docker build -t ghcr.io/kreneskyp/ix/sandbox:47dd2181e8e771de66565b54a6c66e1f -f Dockerfile .

The command 'docker' could not be found in this WSL 2 distro. We recommend to activate the WSL integration in Docker Desktop settings.

For details about using Docker Desktop with WSL 2, visit:

https://docs.docker.com/go/wsl2/

make: *** [Makefile:60: .sentinel/image] Error 1 ix@MC-L000:~$ wsl.exe -l -v NAME STATE VERSION

No current configuration is defined in the workspace state. Assuming 'Default'. No target defined in the workspace state. Assuming 'Default'. Dropping various extension output files at /home/ix/.vscode-server/data/User/workspaceStorage/e08760cce7b6413aef205ffede050bab/ms-vscode.makefile-tools Logging level: Normal Configurations cached at /home/ix/.vscode-server/data/User/workspaceStorage/e08760cce7b6413aef205ffede050bab/ms-vscode.makefile-tools/configurationCache.log No path to the makefile is defined in the settings file. No folder path to the makefile is defined in the settings file. Always pre-configure: false Dry-run switches: '--always-make', '--keep-going', '--print-directory' No current launch configuration is set in the workspace state. Default launch configuration: MIMode = undefined, miDebuggerPath = undefined, stopAtEntry = undefined, symbolSearchPath = undefined Configure on open: true Configure on edit: true Configure after command: true Only .PHONY targets: false Save before build or configure: true Build before launch: true Clear output before build: true Ignore directory commands: true compile_commands.json path: null Deduced command 'make ' for configuration "Default" The makefile entry point was not found. Make sure it exists at the location defined by makefile.makefilePath, makefile.configurations[].makefilePath, makefile.makeDirectory, makefile.configurations[].makeDirectoryor in the root of the workspace. The project needs a configure to populate the launch targets correctly. The launch targets list may not be accurate because configure failed. The project needs a configure to populate the launch targets correctly. The launch targets list may not be accurate because configure failed. The project needs a configure to populate the launch targets correctly. The launch targets list may not be accurate because configure failed. The project needs a configure to populate the launch targets correctly. The launch targets list may not be accurate because configure failed. Saving opened files before build. Generating configuration cache with command: 'make --dry-run --keep-going --print-directory' Writing the dry-run output: /home/ix/.vscode-server/data/User/workspaceStorage/e08760cce7b6413aef205ffede050bab/ms-vscode.makefile-tools/dryrun.log TypeError [ERR_INVALID_ARG_TYPE]: The "options.shell" property must be one of type boolean or string. Received an instance of Object Preprocessing: "undefined" Configure failed. Configure elapsed time: 0.014 Dryrun timeout. Verify that the make command works properly in your development terminal (it could wait for stdin). Double check the dryrun output log: /home/ix/.vscode-server/data/User/workspaceStorage/e08760cce7b6413aef205ffede050bab/ms-vscode.makefile-tools/dryrun.log

ix@MC-L000:~$ make --dry-run --always-make --keep-going --print-directory make: Entering directory '/home/ix' echo ghcr.io/kreneskyp/ix/sandbox make: Leaving directory '/home/ix'

Artsen commented 1 year ago

Any pointers?

kreneskyp commented 1 year ago

The command 'docker' could not be found in this WSL 2 distro.

ix@MC-L000:~$ wsl.exe -l -v NAME STATE VERSION

  • docker-desktop-data Running 2 docker-desktop Running 2 Ubuntu Running 2

It looks like docker isn't present in your shell. I think your shell opened in the docker-desktop-data VM instead of the Ubuntu VM

Here is what I see when I run wsl.exe -l -v

C:\Users\Peter>wsl.exe -l -v NAME STATE VERSION

  • Ubuntu Running 2 docker-desktop-data Running 2 docker-desktop Running 2

Try opening the shell in Ubuntu and the see if docker is available

wsl.exe -d Ubuntu docker --version

Artsen commented 1 year ago

I am getting this error when building, and the file path it is looking for the docker-desktop-bind-mount is wrong, it should be here: "\wsl.localhost\Ubuntu\mnt\wsl\docker-desktop-bind-mounts\Ubuntu"


Starting IX Sandbox
image: ghcr.io/kreneskyp/ix/sandbox:latest
env: /home/oct_ix/ix/ix.env
------------------------------------------------
Error response from daemon: remove agent_ix_static: volume is in use - [cbb9e290245fc68203d6be51de51924e21a6670bac7ab94ae7b5e1e4b0611089, 8e8a14ad7567303164f2ad06b8d1988cff5317f62638a83760ce64d350b12db4]
latest: Pulling from kreneskyp/ix/sandbox
Digest: sha256:2c8955582ca98948da9ec793b8fbc535baa0e56689216d9c86397de9fff37dc4
Status: Image is up to date for ghcr.io/kreneskyp/ix/sandbox:latest
ghcr.io/kreneskyp/ix/sandbox:latest

What's Next?
  1. Sign in to your Docker account → docker login
  2. View a summary of image vulnerabilities and recommendations → docker scout quickview ghcr.io/kreneskyp/ix/sandbox:latest
[+] Running 7/7
 ✔ Container ix-chroma-1  Started                                                                                                                                                                                                 0.0s 
 ✔ Container ix-vault-1   Created                                                                                                                                                                                                 0.0s 
 ✔ Container ix-db-1      Running                                                                                                                                                                                                 0.0s 
 ✔ Container ix-redis-1   Running                                                                                                                                                                                                 0.0s 
 ✔ Container ix-web-1     Running                                                                                                                                                                                                 0.0s 
 ✔ Container ix-worker-1  Running                                                                                                                                                                                                 0.0s 
 ✔ Container ix-nginx-1   Running                                                                                                                                                                                                 0.0s 
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/d83d6639ceef7d34e60b5712789f72a217d2af9d74c9bf0b169e18482056d933" to rootfs at "/vault/config/config.hcl": mount /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/d83d6639ceef7d34e60b5712789f72a217d2af9d74c9bf0b169e18482056d933:/vault/config/config.hcl (via /proc/self/fd/9), flags: 0x5001: no such file or directory: unknown
================================================
IX Sandbox (latest) is running on http://localhost:8000

Edit ix.env to set global keys for LLMs and other services.

---- Management Commands ----
stop       : ix down
restart    : ix restart
scale      : ix scale 3
web log    : ix log web nginx
worker log : ix log worker```
kreneskyp commented 1 year ago

This file might be missing from the library: "/vault/config/config.hcl

kreneskyp commented 1 year ago

Does the file .ix/vault-config.hcl exist in the directory you were running it from?

(venv) peter@DESKTOP-BMB4AFO:~/tmp$ ls .ix
certs  database_init  docker-compose.yml  ix_env.py  nginx.conf  vault-config.hcl  vault.env
Artsen commented 1 year ago

I tried installing again, and I was able to get the vault to work, however. Now whenever I go to the front-end it just gives me a spinning wheel and it never loads the page. I get a a 500 error for the /api/chats/ as well as Axios ("AxiosError: Request failed with status code 500\n at settle (webpack-internal:///./node_modules/axios/lib/core/settle.js:24:12)\n at XMLHttpRequest.onloadend (webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:129:66)"), ayncToGenerate.js, etc...

kreneskyp commented 1 year ago

The most likely cause is that the database didn't initialize. You can do that manually with:

ix up
ix setup
Artsen commented 1 year ago

thanks! i tried the ix setup but I got this: ss

Running migrations:
  No migrations to apply.
Loading fixture: fake_user
Installed 1 object(s) from 1 fixture(s)
Loading fixture: agent/ix
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/core/serializers/base.py", line 314, in save_deferred_fields
    value = deserialize_fk_value(
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/core/serializers/base.py", line 398, in deserialize_fk_value
    obj = default_manager.db_manager(using).get_by_natural_key(*field_value)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/app/ix/chains/models.py", line 26, in get_by_natural_key
    return self.get(class_path=class_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 637, in get
    raise self.model.DoesNotExist(
ix.chains.models.NodeType.DoesNotExist: NodeType matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/app/./manage.py", line 22, in <module>
    main()
  File "/var/app/./manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/app/ix/task_log/management/commands/setup.py", line 23, in handle
    call_command("loaddata", fixture)
  File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 194, in call_command
    return command.execute(*args, **defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/loaddata.py", line 102, in handle
    self.loaddata(fixture_labels)
  File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/loaddata.py", line 165, in loaddata
    obj.save_deferred_fields(using=self.using)
  File "/usr/local/lib/python3.11/site-packages/django/core/serializers/base.py", line 318, in save_deferred_fields
    raise DeserializationError.WithData(
django.core.serializers.base.DeserializationError: NodeType matching query does not exist.: (chains.chainnode:pk=##hidden##) field_value was '['langchain.memory.ConversationBufferMemory']'
kreneskyp commented 1 year ago

Alright I think we're almost to the root of this. Looks like the setup command isn't initializing the components.

IX_IMAGE_TAG=latest IX_ENV=../ix.env docker-compose -f .ix/docker-compose.yml run web ./manage.py import_langchain

then

ix setup
Artsen commented 1 year ago

That did it! you are a legend. Thank you sir.

kreneskyp commented 1 year ago

Awesome! Thanks for the patience working through this.

Permanent fix coming in #284

kreneskyp commented 1 year ago

Just pushed the fix out in v0.11.0

kreneskyp commented 1 year ago

Closing this. Please re-open if you run into anymore issues!

happy15 commented 8 months ago

The most likely cause is that the database didn't initialize. You can do that manually with:

ix up
ix setup

Solved my 500 problem. And I think it would be great it's mentioned in README.md.