Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No default world found" error when trying to run AI Town locally #256

Open
MrCsabaToth opened this issue Oct 23, 2024 · 9 comments
Open

Comments

@MrCsabaToth
Copy link

This is on an M3 MacBook Pro.

  1. I'm following the guide, I had Ollama set up and running already, I'm serving a llama3 variant which I tested. Listening on the 1st terminal window.
  2. I configured the llm.ts to reflect the locally hosted LLM and embedding
  3. I downloaded the precompiled ARM architecture binary for the convex back-end and successfully started it (listening in a 2nd terminal window)
  4. I also executed just convex env set OLLAMA_HOST http://localhost:11434 which is not in the top local run guide, but mentioned later when the guide is fiddling with containers. This command resulted in ✔ Successfully set OLLAMA_HOST to http://localhost:11434 (on dev deployment oceanic-kudu-143) and I can see the env variable set in the convex cloud dev environment.
  5. Started the back-end separately in the 3rd temrinal window ai-town % npm run dev:backend
  6. Started the front-end separately in the 4th temrinal window ai-town % npm run dev:fontend
  7. After that GUI displays at http://localhost:5173/ai-town, however it's at the main menu and nothing happens when I click on the Interact button.
  8. When I click on the Freeze button also seemingly nothing happens, however the back-end terminal displays an error (the last three lines, in red):

[email protected] dev:backend
just convex dev --tail-logs

✔ 22:01:26 Convex functions ready! (8.5s)
10/22/2024, 10:03:24 PM [CONVEX M(testing:stop)] Uncaught Error: No default world found
at getDefaultWorld (../convex/testing.ts:120:2)
at async handler (../convex/testing.ts:71:31)

I'm new to AI town. The guide doesn't tell anything about setting a default world or anything. DO I need ot configure something on the convex web UI? Does that even come into picture when running AI Town locally? I see all of the log messages there too.
I'm stuck.

@MrCsabaToth
Copy link
Author

Looks like others have the same problem:

Also note when I peek at the logs in my convex account online, I see a world:restartDeadWorlds event every single minute.

@MrCsabaToth
Copy link
Author

In the .env file the VITE was pointing to the convex cloud. I modified that to point to my local convex server URL. Now it seems that the ai town backend kinda-sorta sees the convex server, however I still get the no default world error and not much happening when clicking on the interact button. Any help is appreciated.

Oh, I also moved the local convex server binary into the source root, looks like the gitignore even expects that. I was hoping for a miracle.

@ianmacartney
Copy link
Collaborator

ianmacartney commented Oct 23, 2024 via email

@MrCsabaToth
Copy link
Author

MrCsabaToth commented Oct 23, 2024

There’s a seed script that creates a world. It’s probably called “predev”
in package scripts and is probably something like just convex run init

So that should scaffold all the objects? I saw it in the package.json, theoretically it should be called, but I'll check it!

@MrCsabaToth
Copy link
Author

While trying to execute npm run predev I got

No CONVEX_DEPLOYMENT set, run npx convex dev to configure a Convex project

So that's something to start with.

Another question is when I start the convex backend server binary, I see that it listens on 3210 port, but it also starts a proxy right away on the 3211 port. When I configure the VITE_CONVEX_URL in .env.local should I point to the 3210, or the proxy 3211 port, or ... I shouldn't fiddle with that file at all?

@MrCsabaToth
Copy link
Author

Well, I ran npx convex dev, and since I know I already have the empty project in the convex cloud I selected "existing project" and picked that one. This modified the .env.local, adding back:

# Deployment used by `npx convex dev`
CONVEX_DEPLOYMENT=dev:blabla-foobar-123 # team: csaba-toth, project: ai-town-123456

matching my online convex dev project. What I don't understand is where do we inidicate anywhere at all that we have that local convex server? The cloud project only knows about the local ollama via an environment variable. I feel like the AI Town backend should communicate with that local convex server, but it actually doesn't? If I simply stop the local convex server in the 2nd terminal and start the AI Town server in the 3rd terminal, it sitll indicates everything is honky and dory (10:17:50 Convex functions ready! (2.65s)). I expected it to fail since the local convex server is not running. Some configuration step is missing for sure.

Should I indicate in another unkown environment variable for the convex project that I have that local convex server? BTW the convex cloud project is still bare ass empty (even after re-executing the just convex dev --run init --until-success).

@ianmacartney
Copy link
Collaborator

ianmacartney commented Oct 23, 2024 via email

@MrCsabaToth
Copy link
Author

MrCsabaToth commented Oct 23, 2024

Ah npx goes straight to cloud dev. This repo uses just convex to talk to local/dev based on setup. 3120 is right. 3211 is for http endpoints

Thanks for the fast reply. I'm definitely mixing up stuff then. Wherever I see npx I should just use just convex. Three questions then:

  1. Does the convex cloud project play any role during a local setup?
  2. Related to the first: should that project ID or cloud URL appear anywhere in the config files?
  3. What should be the approximate shape of the value of VITE_CONVEX_URL and CONVEX_DEPLOYMENT in the .env.local file?

@ianmacartney
Copy link
Collaborator

ianmacartney commented Oct 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants