semanser / codel

✨ Fully autonomous AI Agent that can perform complicated tasks and projects using terminal, browser, and editor.

Home Page:https://discord.gg/uMaGSHNjzc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error on backend

ralyodio opened this issue · comments

I updated the repo, added a backend/.env and a frontend/.env.local

when I try to create a new task in the UI i get this message on the backend console:

2024/03/25 05:37:48 failed to send message to channel: %!w(*fmt.wrapError=&{failed to send to the channel: connection not found for id 7 0xc000a014b0})
2024/03/25 05:37:48 failed to process input: %!w(*fmt.wrapError=&{failed to spawn container: failed to send to the channel: connection not found for id 7 0xc0009d81e0})

How do I fix? I'm on arch linux.

As I mentioned here, it seems like you don't have FE terminal connected to the BE. I will check it now.

#2 (comment)

Are you trying to send a new command for an existing flow (by using the textarea)? Or are you creating a new task using "New Task" button first and then submitting the message?

no. i'm creating a brand new chat.

how do i fix the node:latest issue? I had manually pulled it with docker,

I pushed an update so that issue should be resoled now. You should just git pull again this repo.

nothing new in git pull

so i did docker rmi node:latest and it looks like the backend now installs it, but i'm still getting the same task errors as stated above.

Could you verify that you web client is actually connected to the be websocket?

Screenshot 2024-03-25 at 15 35 33

unable to connect to host: ws://http//localhost:8080/graphql

I think your VITE_API_URL variable is incorrect. It shouldn't have the schema. So the correct version is:

VITE_API_URL=localhost:8080

ok now i'm getting this error:

2024/03/25 07:48:33 failed to process terminal: %!w(*fmt.wrapError=&{failed to execute command: Error creating exec process: Error response from daemon: No such container: flow-12 0xc0006a1740})

i asked it to create a hello world app in react native using expo.dev, the terminal ran a docker command and then just hangs on make directory

am i supposed to run that command somewhere? or what. Its confusing, where does the code the ai generate live?

the ai generated code lives in a automatically launched container (flow-12) in your case. You can see the list of running containers with docker ps command.

The error that you're referring above is related to the fact that the container was closed for some reason.

weird. this app seems really buggy and not ready for public use yet.

I just merged a very big pull request with tons of improvements and fixes. All the communications between front-end and back-end are now made via GraphQL subscriptions. This eliminates the necessity for a separate WebSocket just for the terminal output.

getting this error now when running go run .

2024/03/26 05:22:57 Unable to ping database: failed to connect to host=localhost user=test database=test: dial error (dial tcp 127.0.0.1:5432: connect: connection refused) exit status 1

Do you have your DB up and running? What's your DATABASE_URL env variable value?

I started postgres, but now I get this error:

$ go run .                       

2024/03/26 05:27:08 Unable to run migrations: ERROR 20240325154630_initial_migration.sql: failed to run SQL migration: failed to execute SQL query "CREATE TABLE containers (\n  id BIGSERIAL PRIMARY KEY,\n  name text,\n  local_id text,\n  image text,\n  status text DEFAULT 'starting'::text\n);\nCREATE TABLE flows (\n  id BIGSERIAL PRIMARY KEY,\n  created_at timestamp DEFAULT now(),\n  updated_at timestamp DEFAULT now(),\n  name text,\n  status text,\n  container_id bigint REFERENCES containers(id)\n);\nCREATE TABLE tasks (\n  id BIGSERIAL PRIMARY KEY,\n  created_at timestamp DEFAULT now(),\n  updated_at timestamp DEFAULT now(),\n  type text,\n  status text,\n  args jsonb DEFAULT '{}'::jsonb,\n  results text DEFAULT '{}'::jsonb,\n  flow_id bigint,\n  message text\n);": ERROR: relation "flows" already exists (SQLSTATE 42P07)
exit status 1

The project migrated to a new database tool, which is incompatible with the previous table you have. You will need to create a new table or remove the tables from the previous one.

From now on, all the database updates should be much smoother since we now have migrations built-in.

ok, i droped tables.

now terminal just hangs:
Screenshot_20240326_053919

what do i do now??

npx create-ract-native-app is a heavy command that takes some time to complete. Are you sure it's completely stuck?

You can click on Finish and try to create a new flow.

weird. its rewally slow. any idea why its so slow? if i run the command outside it finishes after a few seconds.

is the terminal supposed to be interactive? or is it more just a log of output?

The terminal is not interactive, so it's just for output. We could make it interactive in the future, though.

Regarding slowness: You probably have all the necessary packages in your cache when running commands locally. However, every fresh Docker container is a new "machine" that doesn't have any cache, so it requires some time to download everything each time.

I would just call it a log, not a terminal:

i get this error now:

2024/03/26 05:49:37 failed to process input: %!w(*fmt.wrapError=&{failed to spawn container: Error pulling image: Error response from daemon: pull access denied for expo/node, repository does not exist or may require 'docker login': denied: requested access to the resource is denied 0xc0006307a0})

Codel tries to predict which Docker image to use based on the prompt. It seems like Codel wants to use an expo/node image that doesn't even exist. We should probably add a fallback to use debian:latest in case it fails to fetch image data from the Docker Hub.

I believe the initial problem that was discussed at the beginning of this issue has been resolved. I am going to close it, but feel free to post more information in separate issues. Avoid mixing different issues in a single thread as it improves visibility and assists everyone searching for a specific problem.