#Error 500 when connecting Gmail

1 messages · Page 1 of 1 (latest)

dim needle
#

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={"transientToken":"eyJredacted.eyJzdWIiOiIzOWMyredactedloM"}&code=4/0redactedw&scope=email profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/gmail.readonly openid&authuser=0&hd=redacted.com&prompt=consent

Using docker-compose up -d

my .env file:

TAG=v0.20.0

PG_DATABASE_HOST=db:5432

SERVER_URL=http://localhost:3000
# Uncoment if you are serving your front on another server than the API (eg. bucket)
# FRONT_BASE_URL=http://localhost:3000



SIGN_IN_PREFILLED=false

STORAGE_TYPE=local

# STORAGE_S3_REGION=eu-west3
# STORAGE_S3_NAME=my-bucket
# STORAGE_S3_ENDPOINT=

MESSAGE_QUEUE_TYPE=pg-boss
# === Randomly generated secrets ===
# Use openssl rand -base64 32 for each secret
ACCESS_TOKEN_SECRET=Zz..T1g=
LOGIN_TOKEN_SECRET=O..4=
REFRESH_TOKEN_SECRET=FV..w4=
FILE_TOKEN_SECRET=S..U=

POSTGRES_ADMIN_PASSWORD=Br..I=



FRONT_AUTH_CALLBACK_URL=${SERVER_URL}/verify

AUTH_PASSWORD_ENABLED=true
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=5redacted.apps.googleusercontent.com
AUTH_GOOGLE_CLIENT_SECRET=GedactedG

AUTH_GOOGLE_CALLBACK_URL=${SERVER_URL}/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=${SERVER_URL}/auth/google-apis/get-access-token

CALENDAR_PROVIDER_GOOGLE_ENABLED=true
MESSAGING_PROVIDER_GMAIL_ENABLED=true


EMAIL_SMTP_HOST=smtp.gmail.com
EMAIL_SMTP_PORT=465
[email protected]
EMAIL_SMTP_PASSWORD='re da ct ed'
lethal shore
#

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

dim needle
#

I added it to the docker worker, still no luck... I've also confirmed the callback URLs in Google APIs

faint pawn
dim needle
#

@faint pawn

amber linden
formal jungle
#

Hi @dim needle, 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

torn aurora
#

Hi @formal jungle 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="
],

outer wharf
latent escarp
#

@outer wharf, 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.

outer wharf
#

@latent escarp ok I'll try and tell you

latent escarp
#

You can try using an open-source S3 solution, like MinIO. Coolify already provides ready-made examples for this.

mossy flume
#

@dim needle @torn aurora @outer wharf anybody solve this? I'm having the same issue. Looks like an issue with the JWT auth.

feral ravine
#

Hi, facing the same issue

#

Is it possible to solve it without setting up the s3 bucket?