reworkd / AgentGPT

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

Authentication Error. Please make sure you are logged in. #884

Open starascendin opened 1 year ago

starascendin commented 1 year ago

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

Expected Behavior

Able to login and start agent

Current behaviour

should be able to start agent without hitting this Auth error

Steps to reproduce

i followed the setup guide:

Possible solution

No response

Which Operating Systems are you using?

Acknowledgements

jasangill1 commented 1 year ago

Hello @starascendin This is a bug that the dev team is currently working on!! would you be able to provide some console logs in regard to this issue?

starascendin commented 1 year ago

sure @jasangill1

after setting up, im getting 403 forbidden:

Screenshot 2023-06-28 at 3 12 33 PM

I was able to create a user and see it's session in DB:

Screenshot 2023-06-28 at 3 13 35 PM Screenshot 2023-06-28 at 3 13 46 PM
Authorization:
Bearer b349dea0-3c2b-4a1f-ae6f-408f9f2bf553

It looks like calls w/ the session as Authorization Bearer token doesn't work

jasangill1 commented 1 year ago

Hello @starascendin would you be able to send a screenshot of ur .env file as well please hid any sensitive information before sending!!

starascendin commented 1 year ago
# Deployment Environment:
NODE_ENV=development
NEXT_PUBLIC_VERCEL_ENV=${NODE_ENV}

# NextJS:
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_MAX_LOOPS=25

# Next Auth config:
NEXTAUTH_SECRET=CzJYBw+ZScaaJaDAKQu7ffEbcSroWQpYe/YL2Rig06s=
NEXTAUTH_URL=http://localhost:3000

# Auth providers (Use if you want to get out of development mode sign-in):
GOOGLE_CLIENT_ID=***
GOOGLE_CLIENT_SECRET=***
GITHUB_CLIENT_ID=***
GITHUB_CLIENT_SECRET=***
DISCORD_CLIENT_SECRET=***
DISCORD_CLIENT_ID=***

# Backend:
REWORKD_PLATFORM_ENVIRONMENT=${NODE_ENV}
REWORKD_PLATFORM_FF_MOCK_MODE_ENABLED=false
REWORKD_PLATFORM_MAX_LOOPS=${NEXT_PUBLIC_MAX_LOOPS}
REWORKD_PLATFORM_OPENAI_API_KEY=""
REWORKD_PLATFORM_FRONTEND_URL=http://localhost:3000
REWORKD_PLATFORM_RELOAD=true
REWORKD_PLATFORM_OPENAI_API_BASE=https://api.openai.com/v1
REWORKD_PLATFORM_SERP_API_KEY=""
REWORKD_PLATFORM_REPLICATE_API_KEY=""

# Database (Backend):
REWORKD_PLATFORM_DATABASE_USER=reworkd_platform
REWORKD_PLATFORM_DATABASE_PASSWORD=reworkd_platform
REWORKD_PLATFORM_DATABASE_HOST=db
REWORKD_PLATFORM_DATABASE_PORT=3317
REWORKD_PLATFORM_DATABASE_NAME=reworkd_platform
REWORKD_PLATFORM_DATABASE_URL=mysql://${REWORKD_PLATFORM_DATABASE_USER}:${REWORKD_PLATFORM_DATABASE_PASSWORD}@${REWORKD_PLATFORM_DATABASE_HOST}:${REWORKD_PLATFORM_DATABASE_PORT}/${REWORKD_PLATFORM_DATABASE_NAME}

# Database (Frontend):
DATABASE_USER=reworkd_platform
DATABASE_PASSWORD=reworkd_platform
DATABASE_HOST=db
DATABASE_PORT=3317
DATABASE_NAME=reworkd_platform
DATABASE_URL=mysql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
asim-shrestha commented 1 year ago

Thanks @starascendin, very strange. Can you try in incognito and see if that fixes it? It may be a bad session or something like that.

Additionally, does the site let you sign out at the bottom left?

image

Click on the name if its there and a dialog will appear

Wetradetogether commented 1 year ago

Same error AgentGPT (2)

Wetradetogether commented 1 year ago

Request URL: http://localhost:8000/api/agent/start Request Method: POST Status Code: 403 Forbidden Remote Address:

Referrer Policy: strict-origin-when-cross-origin Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: http://localhost:3000 Content-Length: 34 Content-Type: application/json Date: Sun, 02 Jul 2023 10:03:48 GMT Server: uvicorn Vary: Origin Accept: application/json, text/plain, / Accept-Encoding: gzip, deflate, br Accept-Language: it-IT,it;q=0.9 Authorization: Bearer 0c89fc5d-345a-45b4-a42d-d873ef6f9aca Connection: keep-alive Content-Length: 173 Content-Type: application/json Host: localhost:8000 Origin: http://localhost:3000 Referer: http://localhost:3000/ Sec-Ch-Ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114" Sec-Ch-Ua-Mobile: ?1 Sec-Ch-Ua-Platform: "Android" Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-site User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36

jasangill1 commented 1 year ago

Hello @Wetradetogether It seems that the server understood your request but is refusing to reply, This could be due to several issues.

Looking forward to your response !!

asim-shrestha commented 1 year ago

Can you two try heading to http://localhost:8000/api/docs?

This is the frontend for the FastAPI API. From here, try running an API call or two with / without the authorization token and lets see what happens

jasangill1 commented 12 months ago

Hello @Wetradetogether @starascendin Any luck with this issue? I will be closing this due to inactivity if you would still like to discuss this further please feel free to message me or reopen this issue !!!

Wetradetogether commented 12 months ago

Hi @asim-shrestha and @jasangill1, yes I'm running the application locally with docker. I'm still investigating, unfortunately at the moment no results yet

jasangill1 commented 12 months ago

Hello @Wetradetogether I have reopened this issue and will try to investigate this further

Wetradetogether commented 11 months ago

I've experienced an issue while setting up a project. Initially, I cloned the project repository from GitHub using the git clone command. However, I encountered several problems with Authentication Error . Despite trying several suggested solutions, the problems persisted.

I decided to delete everything and start from scratch. Instead of using git clone to get the project files, I chose to download the project as a .zip file directly from the GitHub repository. After decompressing the file and setting up the project in the same environment as before, everything worked fine.

Could you help me understand why the setup process worked with the .zip file but not with the cloned repository? Is it possible that the issues were related to file or directory permissions inconsistencies?

jasangill1 commented 11 months ago

Hello @Wetradetogether Great questions !! perhaps it was just the deleting of the old clone that could have fixed ur problem I wonder if u cloned after downloading if the problem would have been solved !! have you tried cloning multiple times to end up with the same issue? Also, I will be closing soon as a solution has been found!! If you have any other questions please feel free to message me!!!

Wetradetogether commented 11 months ago

It's quite possible that simply deleting the old clone and performing a fresh clone could have resolved the issue. However, please note that I had to perform several cloning operations before I was finally able to successfully install the ZIP file, indicating that the solution was not as straightforward.

Wetradetogether commented 11 months ago

I would like to take this opportunity to kindly ask for guidance on performing installation tests of AgentGPT on a public server, similar to https://agentgpt.reworkd.ai. Specifically, could you please provide some instructions or suggestions on setting up the .env files, settings.py, and so forth?"

jasangill1 commented 11 months ago

Hello @Wetradetogether I assume your wanting to deploy the application? If this is the case you can use Vercel and railway as the frontend would be hosted on Vercel and the backend would be on railway. make sure to update the endpoint of the application to the ones that are provided by the services

showkeyjar commented 7 months ago

I have the same problem, but I run agentgpt manual on windows, when I run agent, it tell me must sign in, and then error. and I found that the database is empty when I connect to mysql.