AgentGPT
AgentGPT copied to clipboard
Error connecting to server (again)
Please check that this issue hasn't been reported before.
- [X] I searched previous Bug Reports didn't find any similar reports.
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 "frontend | import { PrismaClient } from '@prisma/client' frontend | const prisma = new PrismaClient() frontend |
frontend |
frontend | > [email protected] 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?
- [ ] Android
- [ ] iPhone/iPad
- [ ] Linux
- [X] macOS
- [ ] Windows
Acknowledgements
- [X] My issue title is concise, descriptive, and in title casing.
- [X] I have searched the existing issues to make sure this bug has not been reported yet.
- [X] I am using the latest version of AgentGPT.
- [X] I have provided enough information for the maintainers to reproduce and diagnose the issue.
I get the same terminal output on Mac 14.4.1, same error
Same error. macOS Sonoma 14.4.1 (23E224).
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"
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.
Fresh install using the provided git files 和 docker compose. On the backend I get this error:
ModuleNotFoundError: No module named 'langchain.globals'which results inError attempting to connect to the server.使用提供的 git 文件和 docker compose 进行全新安装。在后端,我收到此错误:ModuleNotFoundError: No module named 'langchain.globals'导致Error attempting to connect to the server.
me too
https://github.com/reworkd/AgentGPT/blob/cd900e5f63572a58e0dbeaeffcc2150d9fc8781d/platform/pyproject.toml#L34
Changing this line from lanarky = "^0.7.15" to lanarky = "0.7.15" worked for me