Error 500 when connecting Gmail
Hi there. I'm getting an issue connecting my gmail. I'm wondering whether this is an .env problem, docker-compose problem, an API library problem, or bug in the application?
I'm getting through to the google screens, but when I land back on the app I get an error 500.
This is the URL in my browser: http://localhost:3000/auth/google-apis/get-access-token?state=%7B%22transientToken%22:%22eyJredacted.eyJzdWIiOiIzOWMyredactedloM%22%7D&code=4/0redactedw&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/gmail.readonly%20openid&authuser=0&hd=redacted.com&prompt=consent
Using docker-compose up -d
my .env file:
15 Replies
docker compose file
Perhaps those env vars also need to live on the worker? I have a similar setup locally (which is working) and the only difference seems to be the env vars on the worker container
I added it to the docker worker, still no luck... I've also confirmed the callback URLs in Google APIs
Hello, can you please send the Google and Gmail url inside your .env ?
http://localhost:3000/auth/google/redirect (AUTH_GOOGLE_CALLBACK_URL)
http://localhost:3000/auth/google-apis/get-access-token (AUTH_GOOGLE_APIS_CALLBACK_URL)
@Uranium
Not very sure about twenty architecture, but on other projects I have only been able to make external connections like this with a publicly reachable url (non localhost). better to be confirmed by someone that knows the codebase
Hi @Cosmos, sorry for the very late reply. Are you still facing the issue?
You are looking to sign up / sign in as a Gmail account or to connect your gmail inbox / calendar to Twenty once signed in. THose are two different features
Hi @charles I am facing this issue as of now. I was just trying to connect my Gmail Inbox. I was able to get to a point where it's throwing Error 500 when it tries to redirect me to http://localhost:3000/auth/google-apis?transientToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MjhkNmU1Zi0xNjM0LTRmZjAtODcwZi1hNmI5M2ViNmYxZGEiLCJ1c2VySWQiOiI1NTdiODJlNC1jZjMyLTRkMDAtODg2My1hOGIwMjkxYmZhZjgiLCJ3b3Jrc3BhY2VJZCI6IjhkOTA5NDNlLTEyNzYtNDYzNC1iYWUwLWUxYjU2NmI0ZDc3MyIsImlhdCI6MTcyMjAyMjY3MSwiZXhwIjoxNzIyMDIyOTcxfQ.X6cmYNU6tcTZ3dBPnKq-wErrIDdqIOKQU75ivynqacI
Here's my Env of docker container twenty-server:
"Env": [
"SIGN_IN_PREFILLED=true",
"STORAGE_S3_REGION=",
"SERVER_URL=http://localhost:3000",
"REFRESH_TOKEN_SECRET=DUa6E557/PRfJvT/xsFLcPYelRv4d6cC8IFx4a5xeww=",
"LOGIN_TOKEN_SECRET=amnBbpzp7MTfJ9XhmrXpNA4UD4QCJyhNvxTopVSo4vw=",
"FILE_TOKEN_SECRET=A4SKTl2hmsMvBazixPdCtTKC8+ksxuYxLX7iulM0IFc=",
"PG_DATABASE_URL=postgres://twenty:twenty@db:5432/default",
"FRONT_BASE_URL=http://localhost:3000",
"STORAGE_S3_NAME=",
"STORAGE_S3_ENDPOINT=",
"MESSAGE_QUEUE_TYPE=pg-boss",
"STORAGE_TYPE=local",
"ACCESS_TOKEN_SECRET=SGkarixpyD8n8lrQKv1Jm4kDk7EyOb8155TPEEXIz9I=",
"PORT=3000",
"CALENDAR_PROVIDER_GOOGLE_ENABLED=true",
"MESSAGING_PROVIDER_GMAIL_ENABLED=true",
"ENABLE_DB_MIGRATIONS=true",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NODE_VERSION=18.17.1",
"YARN_VERSION=1.22.19",
"REACT_APP_SERVER_BASE_URL=",
"SENTRY_RELEASE="
],
I have the same issue, any ideas ?
@Yazane, if you haven't resolved this yet, I recommend setting up an S3 bucket to avoid permission restrictions. Also, try running it alongside a worker to ensure better performance.
@𝗻𝗶𝗰𝗼𝗹𝗮𝘀 ok I'll try and tell you
You can try using an open-source S3 solution, like MinIO. Coolify already provides ready-made examples for this.
@Cosmos @Divyadeep Sawhney @Yazane anybody solve this? I'm having the same issue. Looks like an issue with the JWT auth.
Hi, facing the same issue
Is it possible to solve it without setting up the s3 bucket?
Hey, I checked on our own google console
- we don't have any
Authorized JavaScript origins
URI
- we only have those 2 URIs for Authorized redirect URIs
http://localhost:3000/auth/google/redirect
http://localhost:3000/auth/google-apis/get-access-token
Then here are the .env
useful variables
find AUTH_GOOGLE_CLIENT_ID
and AUTH_GOOGLE_CLIENT_SECRET
in Additional Informations
section of the google console page
Make sure you restart your server when you update your environment variables.
Worker service is not useful for Google authentication
If the issue persists, can you provide your server logs when you are reaching the blank page?