reworkd / AgentGPT

🤖 Assemble, configure, and deploy autonomous AI Agents in your browser.
https://agentgpt.reworkd.ai
GNU General Public License v3.0
30.6k stars 9.17k forks source link

Error connecting to server (again) #1520

Open SeanFrohman opened 3 months ago

SeanFrohman commented 3 months ago

Please check that this issue hasn't been reported before.

Expected Behavior

AgentGPT works...

Current behaviour

I have installed and run everything properly, i went as far as to get a NEXT AUTH SECRET key, and make sure almost ANYTHING that said changeme now has a working key there, and even still, with a venv and docker running perfect, and everything working as expected, I still get this error. I was told to make sure the front end and back end are able to see each other, and it seems as if it would work at this point AND I had it working at one point in the past, but I can't get past this error.

Attaching to agentgpt_db, frontend, platform agentgpt_db | 2024-04-04 09:15:38+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.36-1.el8 started. frontend | dos2unix: converting file wait-for-db.sh to Unix format... frontend | dos2unix: converting file .env.temp to Unix format... frontend | Database is unavailable - Sleeping... agentgpt_db | 2024-04-04 09:15:38+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' agentgpt_db | 2024-04-04 09:15:38+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.36-1.el8 started. agentgpt_db | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock' platform | INFO: Will watch for changes in these directories: ['/app/src'] platform | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) platform | INFO: Started reloader process [1] using WatchFiles agentgpt_db | 2024-04-04T09:15:38.640736Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. agentgpt_db | 2024-04-04T09:15:38.641075Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.36) starting as process 1 agentgpt_db | 2024-04-04T09:15:38.644698Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. agentgpt_db | 2024-04-04T09:15:38.691159Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. agentgpt_db | 2024-04-04T09:15:38.809942Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. agentgpt_db | 2024-04-04T09:15:38.809963Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. agentgpt_db | 2024-04-04T09:15:38.810815Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. agentgpt_db | 2024-04-04T09:15:38.820703Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock agentgpt_db | 2024-04-04T09:15:38.820723Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.36' socket: '/var/run/mysqld/mysqld.sock' port: 3307 MySQL Community Server - GPL. frontend | Database is available! Continuing... platform | Process SpawnProcess-1: platform | Traceback (most recent call last): platform | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap platform | self.run() platform | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run platform | self._target(*self._args, *self._kwargs) platform | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started platform | target(sockets=sockets) platform | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run platform | return asyncio.run(self.serve(sockets=sockets)) platform | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ platform | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run platform | return runner.run(main) platform | ^^^^^^^^^^^^^^^^ platform | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run platform | return self._loop.run_until_complete(task) platform | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ platform | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete platform | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 68, in serve platform | config.load() platform | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 473, in load platform | self.loaded_app = import_from_string(self.app) platform | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ platform | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 24, in import_from_string platform | raise exc from None platform | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string platform | module = importlib.import_module(module_str) platform | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ platform | File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module platform | return _bootstrap._gcd_import(name[level:], package, level) platform | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ platform | File "", line 1204, in _gcd_import platform | File "", line 1176, in _find_and_load platform | File "", line 1147, in _find_and_load_unlocked platform | File "", line 690, in _load_unlocked platform | File "", line 940, in exec_module platform | File "", line 241, in _call_with_frames_removed platform | File "/app/src/reworkd_platform/web/application.py", line 11, in platform | from reworkd_platform.web.api.router import api_router platform | File "/app/src/reworkd_platform/web/api/router.py", line 3, in platform | from reworkd_platform.web.api import agent, auth, metadata, models, monitoring platform | File "/app/src/reworkd_platform/web/api/agent/init.py", line 2, in platform | from reworkd_platform.web.api.agent.views import router platform | File "/app/src/reworkd_platform/web/api/agent/views.py", line 17, in platform | from reworkd_platform.web.api.agent.agent_service.agent_service_provider import ( platform | File "/app/src/reworkd_platform/web/api/agent/agent_service/agent_service_provider.py", line 15, in platform | from reworkd_platform.web.api.agent.agent_service.open_ai_agent_service import ( platform | File "/app/src/reworkd_platform/web/api/agent/agent_service/open_ai_agent_service.py", line 4, in platform | from lanarky.responses import StreamingResponse platform | File "/usr/local/lib/python3.11/site-packages/lanarky/init.py", line 1, in platform | from .responses import StreamingResponse platform | File "/usr/local/lib/python3.11/site-packages/lanarky/responses/init.py", line 1, in platform | from .streaming import StreamingResponse platform | File "/usr/local/lib/python3.11/site-packages/lanarky/responses/streaming.py", line 18, in platform | from lanarky.callbacks import ( platform | File "/usr/local/lib/python3.11/site-packages/lanarky/callbacks/init.py", line 11, in platform | from .agents import # noqa: F401, F403 platform | ^^^^^^^^^^^^^^^^^^^^^ platform | File "/usr/local/lib/python3.11/site-packages/lanarky/callbacks/agents.py", line 10, in platform | from .base import AsyncLanarkyCallback platform | File "/usr/local/lib/python3.11/site-packages/lanarky/callbacks/base.py", line 7, in platform | from langchain.globals import get_llm_cache platform | ModuleNotFoundError: No module named 'langchain.globals' frontend | frontend | ! unknown or unexpected option: --name frontend | frontend | Apply pending migrations to update the database schema in production/staging frontend | frontend | Usage frontend | frontend | $ prisma migrate deploy [options] frontend | frontend | Options frontend | frontend | -h, --help Display this help message frontend | --schema Custom path to your Prisma schema frontend | frontend | Examples frontend | frontend | Deploy your pending migrations to your production/staging database frontend | $ prisma migrate deploy frontend | frontend | Specify a schema frontend | $ prisma migrate deploy --schema=./schema.prisma frontend | frontend | Environment variables loaded from .env frontend | Prisma schema loaded from prisma/schema.prisma frontend | Datasource "db": MySQL database "reworkd_platform" at "agentgpt_db:3307" frontend | frontend | The database is already in sync with the Prisma schema. frontend | ✔ Generated Prisma Client (4.13.0 | library) to ./node_modules/@prisma/client in frontend | 109ms frontend | frontend | Environment variables loaded from .env frontend | Prisma schema loaded from prisma/schema.prisma frontend | frontend | ✔ Generated Prisma Client (4.13.0 | library) to ./node_modules/@prisma/client in 111ms frontend | You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client frontend | frontend | import { PrismaClient } from '@prisma/client' frontend | const prisma = new PrismaClient() frontend | frontend | frontend | > agent-gpt@1.0.0 dev frontend | > next dev frontend | frontend | ▲ Next.js 13.5.6 frontend | - Local: http://localhost:3000 frontend | - Environments: .env frontend | frontend | ✓ Ready in 1383ms frontend | Browserslist: caniuse-lite is outdated. Please run: frontend | npx update-browserslist-db@latest frontend | Why you should do it regularly: https://github.com/browserslist/update-db#readme frontend | ✓ Compiled /_error in 2.4s (390 modules) frontend | ⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload frontend | ✓ Compiled in 364ms (334 modules) frontend | ✓ Compiled / in 1249ms (1619 modules) frontend | ✓ Compiled /api/auth/[...nextauth] in 244ms (358 modules) frontend | prisma:query SELECT reworkd_platform.Session.id, reworkd_platform.Session.sessionToken, reworkd_platform.Session.userId, reworkd_platform.Session.expires FROM reworkd_platform.Session WHERE reworkd_platform.Session.sessionToken IN (?,?) frontend | prisma:query SELECT reworkd_platform.User.id, reworkd_platform.User.name, reworkd_platform.User.email, reworkd_platform.User.emailVerified, reworkd_platform.User.image, reworkd_platform.User.super_admin, reworkd_platform.User.createDate FROM reworkd_platform.User WHERE reworkd_platform.User.id IN (?) frontend | prisma:query SELECT reworkd_platform.Session.id, reworkd_platform.Session.sessionToken, reworkd_platform.Session.userId, reworkd_platform.Session.expires FROM reworkd_platform.Session WHERE reworkd_platform.Session.userId = ? ORDER BY reworkd_platform.Session.expires DESC LIMIT ? OFFSET ? frontend | prisma:query SELECT reworkd_platform.Session.id, reworkd_platform.Session.sessionToken, reworkd_platform.Session.userId, reworkd_platform.Session.expires FROM reworkd_platform.Session WHERE reworkd_platform.Session.userId = ? ORDER BY reworkd_platform.Session.expires DESC LIMIT ? OFFSET ? frontend | prisma:query SELECT reworkd_platform.organization_user.id, reworkd_platform.organization_user.user_id, reworkd_platform.organization_user.organization_id, reworkd_platform.organization_user.role, reworkd_platform.organization_user.create_date, reworkd_platform.organization_user.update_date, reworkd_platform.organization_user.delete_date FROM reworkd_platform.organization_user WHERE reworkd_platform.organization_user.user_id = ? frontend | prisma:query SELECT reworkd_platform.organization_user.id, reworkd_platform.organization_user.user_id, reworkd_platform.organization_user.organization_id, reworkd_platform.organization_user.role, reworkd_platform.organization_user.create_date, reworkd_platform.organization_user.update_date, reworkd_platform.organization_user.delete_date FROM reworkd_platform.organization_user WHERE reworkd_platform.organization_user.user_id = ? frontend | ✓ Compiled /api/trpc/[trpc] in 116ms (368 modules) frontend | prisma:query SELECT reworkd_platform.Session.id, reworkd_platform.Session.sessionToken, reworkd_platform.Session.userId, reworkd_platform.Session.expires FROM reworkd_platform.Session WHERE (reworkd_platform.Session.sessionToken = ? AND 1=1) LIMIT ? OFFSET ? frontend | prisma:query SELECT reworkd_platform.User.id, reworkd_platform.User.name, reworkd_platform.User.email, reworkd_platform.User.emailVerified, reworkd_platform.User.image, reworkd_platform.User.super_admin, reworkd_platform.User.createDate FROM reworkd_platform.User WHERE reworkd_platform.User.id IN (?) frontend | prisma:query SELECT reworkd_platform.organization_user.id, reworkd_platform.organization_user.user_id, reworkd_platform.organization_user.organization_id, reworkd_platform.organization_user.role, reworkd_platform.organization_user.create_date, reworkd_platform.organization_user.update_date, reworkd_platform.organization_user.delete_date FROM reworkd_platform.organization_user WHERE reworkd_platform.organization_user.user_id = ? frontend | prisma:query SELECT reworkd_platform.Session.id, reworkd_platform.Session.sessionToken, reworkd_platform.Session.userId, reworkd_platform.Session.expires FROM reworkd_platform.Session WHERE reworkd_platform.Session.userId = ? ORDER BY reworkd_platform.Session.expires DESC LIMIT ? OFFSET ? frontend | prisma:query SELECT reworkd_platform.Agent.id, reworkd_platform.Agent.userId, reworkd_platform.Agent.name, reworkd_platform.Agent.goal, reworkd_platform.Agent.deleteDate, reworkd_platform.Agent.createDate FROM reworkd_platform.Agent WHERE (reworkd_platform.Agent.userId = ? AND reworkd_platform.Agent.deleteDate IS NULL) ORDER BY reworkd_platform.Agent.createDate DESC LIMIT ? OFFSET ?

Does anything look off to you?

Steps to reproduce

Run env, activate docker compose up --build running....

Nothing... error connecting to server...

Possible solution

I'm missing something related to one of the keys, or I messed up something in docker...

Which Operating Systems are you using?

Acknowledgements

ckep1 commented 3 months ago

I get the same terminal output on Mac 14.4.1, same error

pschulzk commented 1 month ago

Same error. macOS Sonoma 14.4.1 (23E224).

pawel-dubiel commented 1 month ago

I would first check if you can connect to the localhost:8000 backend server (though browser). If you cannot - check logs in the Docker for the container, in my case, I had to upgrade langchain library. For more details, check this old ticket: https://github.com/reworkd/AgentGPT/issues/1393

but in yours, the issues might be different. However, you should always check logs for the platform container in the case of this error: "Error connecting to server"

Dreadarm commented 2 weeks ago

Fresh install using the provided git files and docker compose. On the backend I get this error: ModuleNotFoundError: No module named 'langchain.globals' which results in Error attempting to connect to the server.