neuronic-ai / autogpt-ui

A web interface for AutoGPT
110 stars 25 forks source link

502 Bad Gateway #1

Closed dvitcompte closed 1 year ago

dvitcompte commented 1 year ago

Hello and thank you for your great job.

I'm able to launch the UI using the url http://server_ip:8160/. But the browser console shows me some 502 error at launch and I don't know how to fix them :

Capture d’écran 2023-06-20 à 10 37 13

I don't know if it' related but when I "docker logs ID_OF_auto-gpt-ui-api" I get

✔ Generated Prisma Client Python (v0.8.2) to ./usr/local/lib/python3.11/site-packages/prisma in 2.05s

Prisma schema loaded from schema.prisma
Datasource "db": MySQL database "auto_gpt_ui" at "mysql:3306"

Error: P1000: Authentication failed against database server at `mysql`, the provided database credentials for `autogpt` are not valid.

Please make sure to provide valid database credentials for the database server at `mysql`.

My env-backend.env file contains DATABASE_URL=mysql://autogpt:autogptpwd@mysql:3306/auto_gpt_ui

My env-mysql.env file I well configurer with the correct user name and password.

Did I missed something ? I'm on a dedicated server with stock Debian 11 Let me know if you need more information.

EncryptShawn commented 1 year ago

I see you have

DATABASE_URL=mysql://autogpt:autogptpwd@mysql:3306/auto_gpt_ui

This is using a user "autogpt" with whatever your "autogptpwd" is to login to the database "auto_gpt_ui"

Did you by chance log into the mysql instance and create the user autogpt with a password and then give it rights to the auto_gpt_ui database? If not, the current build of this app actually just uses root login for the database with the password you set in the env-mysql.env.

And this assumes that you set the password in the env-mysql.env to the same thing, whatever "autogptpwd" is in your env-backend and that your database name is auto_gpt_ui. In the env-mysql.env You are setting the root password and the database name in the env-mysql.env file and that should look something like this.

MYSQL_ROOT_PASSWORD=Password123 MYSQL_DATABASE=auto_gpt_ui

Alternatively, you dont have to use the included mysql server, you could kill the container and just use your own database if you already have one or prefer something other than a local docker container for this. This of course would require you to update your mysql connection string in the env-backend.env to your own server and credentials if so.

*Dont forget to "make all" between updates to the env files.

dvitcompte commented 1 year ago

Thanks a lot.

I had to put auto_gpt_ui in my env-mysql.env instead of just autogpt for MYSQL_DATABASE. And change DATABASE_URL to DATABASE_URL=mysql://root:autogptpwd@mysql:3306/auto_gpt_ui

Sudo make all and No more 502 error, but 404 on load :

Capture d’écran 2023-06-22 à 11 43 59

But I was able to use the UI with my ai_settings.yml file, the api calls return 200.

Apart from this : Significant-Gravitas/Auto-GPT just released v0.4.2, hope to find a new version for UI soon! Why "Resume stopped processes where we left off" was removed in version 1.1 ?

EncryptShawn commented 1 year ago

Regarding resume where we left off, we had built another additional capability to resume, on top of what is built into autogpt, it was redundant and unnecessary so we removed it.


Regarding 404, it sounds like maybe your Worker or API backend is down, can you check docker ps -a and if any container is down, check the logs and provide anything that looks helpful to troubleshoot it? . If all containers are up, also maybe just a bounce with either docker restart container or docker-compose restart in your install folder to see if a bounce of the containers resolves the issue.


In the new code we are testing now for the next release we have just used stable (Which includes 0.4.2 now), but the 0.4.2 did break it and we had to make a patch to get it back working.

There is a danger to using the stable release versus a set version since the stable code is always being updated. With the next release, provided there are no surprises, you can always get the latest patches and fixes when you updated the gui. (At the risk that some releases may break the UI and we will have to update it to make it work again)

We are hoping that the Significant Gravatis project pushes their end state architecture soon, they have been talking about significant changes in the core code. Already we see they have cleaned the code up a bit but getting a fairly stable codebase will be key to using the stable branch without having to worry about autogpt updates breaking the ui.


dvitcompte commented 1 year ago

Hello,

everything has been working fine for several days, I am closing this issue.

Thanks !