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

Error attempting to connect to the server. #928

Closed
6 of 10 tasks
masada-x opened this issue Jul 2, 2023 · 13 comments
Closed
6 of 10 tasks

Error attempting to connect to the server. #928

masada-x opened this issue Jul 2, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@masada-x
Copy link

masada-x commented Jul 2, 2023

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

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

It should start the prompt without giving error

Current behaviour

When i create any Agent it gives me this error "Error attempting to connect to the server."

Steps to reproduce

OS Ubuntu 22.04 VM
Git Clone the repo
sudo ./setup.sh
.env changed localhost :3000 to serverip:3000
after all services and containers are up
Accessed thru browser http://serverip:3000
Signin with development mode
Clicked on researchgpt
It gives error 5 times and
AgentGPT error

Possible solution

No response

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of AgentGPT.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@masada-x masada-x added the bug Something isn't working label Jul 2, 2023
@jasangill1
Copy link
Contributor

jasangill1 commented Jul 2, 2023

Hello, @samaviya if you were able to log in that means the front end has connected to the database. These connection issues signal that your frontend isn't able to connect to the running backend. To confirm, have you also changed your backend URL to serverip:8000 in you .env file?

Along with this could you please provide a copy of your front-end logs and your docker logs these will help me troubleshoot this further!!!

Looking forward to your reply!!!

@masada-x
Copy link
Author

masada-x commented Jul 2, 2023

I just made the fresh install on new server. All default env but same error

Platform
INFO: Will watch for changes in these directories: ['/app/src']
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO: Started reloader process [1] using WatchFiles
2023-07-02 20:18:56.495 | INFO | logging:callHandlers:1706 - Started server process [8]
2023-07-02 20:18:56.497 | INFO | logging:callHandlers:1706 - Waiting for application startup.
2023-07-02 20:19:00.720 | INFO | logging:callHandlers:1706 - Application startup complete.

WEAVIATE

2023-07-02T20:18:47Z INF action=startup default_vectorizer_module=none msg=the default vectorizer modules is set to "none", as a result all new schema classes without an explicit vectorizer setting, will use this vectorizer
2023-07-02T20:18:47Z INF action=startup auto_schema_enabled=true msg=auto schema enabled setting is set to "true"
2023-07-02T20:18:47Z INF action=grpc_startup msg=grpc server listening at [::]:50051
2023-07-02T20:18:47Z INF action=restapi_management msg=Serving weaviate at http://[::]:8080

DB
2023-07-02 20:19:01+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
2023-07-02T20:19:02.020767Z 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.
2023-07-02T20:19:02.027046Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33) starting as process 1
2023-07-02T20:19:02.039340Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-07-02T20:19:02.436145Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-07-02T20:19:02.906439Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-07-02T20:19:02.906537Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-07-02T20:19:02.909582Z 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.
2023-07-02T20:19:02.957878Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2023-07-02T20:19:02.957993Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.33' socket: '/var/run/mysqld/mysqld.sock' port: 3307 MySQL Community Server - GPL.

NEXT
Database is unavailable - Sleeping...
Database is unavailable - Sleeping...
Database is unavailable - Sleeping...
Database is unavailable - Sleeping...
Database is unavailable - Sleeping...
Database is unavailable - Sleeping...
Database is available! Continuing...
! unknown or unexpected option: --name
Apply pending migrations to update the database schema in production/staging
Usage
$ prisma migrate deploy [options]
Options
-h, --help Display this help message
--schema Custom path to your Prisma schema
Examples
Deploy your pending migrations to your production/staging database
$ prisma migrate deploy
Specify a schema
$ prisma migrate deploy --schema=./schema.prisma
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "reworkd_platform" at "db:3307"
🚀 Your database is now in sync with your Prisma schema. Done in 307ms
Running generate... (Use --skip-generate to skip the generators)
Running generate... - Prisma Client
✔ Generated Prisma Client (4.13.0 | library) to ./node_modules/@prisma/client in
516ms
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (4.13.0 | library) to ./node_modules/@prisma/client in 472ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

┌─────────────────────────────────────────────────────────┐
│ Update available 4.13.0 -> 4.16.2 │
│ Run the following to update │
│ npm i --save-dev prisma@latest │
│ npm i @prisma/client@latest │
└─────────────────────────────────────────────────────────┘

[email protected] dev
next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /next/.env
event - compiled client and server successfully in 7.4s (357 modules)
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
wait - compiling / (client and server)...
event - compiled client and server successfully in 16.4s (1412 modules)
wait - compiling...
event - compiled successfully in 3.7s (1253 modules)
wait - compiling...
event - compiled client and server successfully in 1285 ms (1412 modules)
wait - compiling /api/auth/[...nextauth] (client and server)...
event - compiled successfully in 310 ms (185 modules)
wait - compiling /signin (client and server)...
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
event - compiled client and server successfully in 1485 ms (1443 modules)
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.createDate FROM reworkd_platform.User WHERE (reworkd_platform.User.email = ? AND 1=1) LIMIT ? OFFSET ?
prisma:query BEGIN
prisma:query INSERT INTO reworkd_platform.User (id,name,email,emailVerified,createDate) VALUES (?,?,?,?,?)
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.createDate FROM reworkd_platform.User WHERE reworkd_platform.User.id = ? LIMIT ? OFFSET ?
prisma:query COMMIT
prisma:query BEGIN
prisma:query INSERT INTO reworkd_platform.Session (id,sessionToken,userId,expires) VALUES (?,?,?,?)
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.id = ? LIMIT ? OFFSET ?
prisma:query COMMIT
prisma:query SELECT 1
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 ?
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.createDate FROM reworkd_platform.User WHERE reworkd_platform.User.id IN (?)
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 ?
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 ?
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.createDate FROM reworkd_platform.User WHERE reworkd_platform.User.id IN (?)
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 ?
wait - compiling /api/trpc/[trpc] (client and server)...
event - compiled successfully in 427 ms (196 modules)
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 ?
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.createDate FROM reworkd_platform.User WHERE reworkd_platform.User.id IN (?)
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 ?
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 ?

@masada-x masada-x closed this as completed Jul 2, 2023
@masada-x masada-x reopened this Jul 2, 2023
@masada-x masada-x closed this as completed Jul 2, 2023
@masada-x masada-x reopened this Jul 2, 2023
@masada-x masada-x closed this as completed Jul 2, 2023
@masada-x masada-x reopened this Jul 2, 2023
@jasangill1
Copy link
Contributor

Hello @samaviya it seems that your server started up. Have you run ./setup, from the first screenshot it seems your version was outdated, were able to log in?

@masada-x
Copy link
Author

masada-x commented Jul 3, 2023

@jasangill1 updated version have same issue. I am not running it on localhost. I am using a VM with Ubuntu 22.04. Yes i were able to log in (development mode) also configured the production with google auth2 but all same issue. When run agent it gives "Error attempting to connect to the server" couldn't find anything to solve this.

@jasangill1
Copy link
Contributor

Hello @samaviya as you are running it on a VM this causes some along with using docker, there tends to be alot of "handshakes" the servers are all doing leading to making it hard to replicate when issues come up, would you be able to run this locally and see it that fixes the issue?

@masada-x
Copy link
Author

masada-x commented Jul 4, 2023

Its working in development mode but when change to production mode and Google Auth2.0 and using host.domain.com its giving same error. I will debug more and make an update

@jasangill1
Copy link
Contributor

Hello @samaviya Were you able to find out why it was only working in production ??

@ccfleaf
Copy link

ccfleaf commented Jul 5, 2023

1.Change localhost:8000,3000 into server ip:8000,3000 in .env
2.Edit AgentGPT/platform/reworkd_platform/web/application.py, modify allow_origins=["*"]

@jasangill1
Copy link
Contributor

Hello, @samaviya Are you still encountering this problem? Would you be able to apply @ccfleaf s solution?

@jasangill1
Copy link
Contributor

Hello @samaviya I will be closing this issue due to inactivity !! Please feel free to reopen !!

@yhyu13
Copy link

yhyu13 commented Dec 5, 2023

I am experiencing this problem with on commit release of v1.0.0, I am locally deploy both platform and next with default url, it can be solved by sign out and then sign in again, what it is a strange bug that happens everytime on a fresh new startup of both platform and next

@fmenol
Copy link

fmenol commented Dec 27, 2023

This problem persists in v1.0.0. I tried locally on a Macbook Air with MacOS 14.1.1.
Any insight?

@ChrisFengA
Copy link

#1499
This may be the last chance to try if all of above not solving the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants