Unknown error occurred while importing messages for message channel

I get the following error in logs when I try to add google account for calendar sync (in web I see "Sync failed" error): I've ran yarn commands on worker as instructed in docs. Full error pasted in thread
28 Replies
Sebastian
SebastianOP2mo ago
can't post more than 2k chars, attaching the log entry as file
Sebastian
SebastianOP2mo ago
fixed it with adding env vars to worker container as well, but still getting this sync failed in ui now I'm getting this one:
worker-1 | Exception Captured
worker-1 | undefined
worker-1 | [
worker-1 | TypeError: Cannot read properties of undefined (reading 'id')
worker-1 | at CallWebhookJobsJob.handle (/app/packages/twenty-server/dist/src/modules/webhook/jobs/call-webhook-jobs.job.js:70:46)
worker-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
worker-1 | at async MessageQueueExplorer.invokeProcessMethods (/app/packages/twenty-server/dist/src/engine/core-modules/message-queue/message-queue.explorer.js:111:17)
worker-1 | at async MessageQueueExplorer.handleProcessor (/app/packages/twenty-server/dist/src/engine/core-modules/message-queue/message-queue.explorer.js:105:13)
worker-1 | at async /app/packages/twenty-server/dist/src/engine/core-modules/message-queue/message-queue.explorer.js:79:17
worker-1 | at async _bullmq.Worker [as processFn] (/app/packages/twenty-server/dist/src/engine/core-modules/message-queue/drivers/bullmq.driver.js:33:13)
worker-1 | at async Worker.processJob (/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
worker-1 | at async Worker.retryIfFailed (/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
worker-1 | ]
worker-1 | Exception Captured
worker-1 | undefined
worker-1 | [
worker-1 | TypeError: Cannot read properties of undefined (reading 'id')
worker-1 | at CallWebhookJobsJob.handle (/app/packages/twenty-server/dist/src/modules/webhook/jobs/call-webhook-jobs.job.js:70:46)
worker-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
worker-1 | at async MessageQueueExplorer.invokeProcessMethods (/app/packages/twenty-server/dist/src/engine/core-modules/message-queue/message-queue.explorer.js:111:17)
worker-1 | at async MessageQueueExplorer.handleProcessor (/app/packages/twenty-server/dist/src/engine/core-modules/message-queue/message-queue.explorer.js:105:13)
worker-1 | at async /app/packages/twenty-server/dist/src/engine/core-modules/message-queue/message-queue.explorer.js:79:17
worker-1 | at async _bullmq.Worker [as processFn] (/app/packages/twenty-server/dist/src/engine/core-modules/message-queue/drivers/bullmq.driver.js:33:13)
worker-1 | at async Worker.processJob (/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
worker-1 | at async Worker.retryIfFailed (/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
worker-1 | ]
but it looks unrelated to this sync issue
charles
charles2mo ago
I have already seen this one, what version are you on? @martmull FYI
Sebastian
SebastianOP2mo ago
@charles I'm running latest tag, let me check which one is pulled right now in Releases in Settings I see: 0.32.0
martmull
martmull2mo ago
@Sebastian @charles this last issue will be fixed in https://github.com/twentyhq/twenty/pull/8644
GitHub
8643 fix sentry error by martmull · Pull Request #8644 · twentyhq/t...
fixes missing data in event payload when adding a new workspaceMember add strong typing to database event emitters
Sebastian
SebastianOP2mo ago
oh, tha's great, thanks! any ETA when this will be merged?
martmull
martmull2mo ago
today
charles
charles2mo ago
we have also figured out the issue with the release pipeline, 0.33 will be published tomorrow
Sebastian
SebastianOP4w ago
@charles @martmull updated to latest version, redeployed from scratch, applied yarn commands on worker container, but the sync from google still fails
martmull
martmull4w ago
@Raphaël any idea?
Raphaël
Raphaël4w ago
Hello @Sebastian, do you have logs that could help me identify the issue?
Sebastian
SebastianOP4w ago
this was the only error I saw in the logs.
Raphaël
Raphaël4w ago
Okay thank you, this is your server's log, do you maybe have any logs inside your worker?
Sebastian
SebastianOP4w ago
no errors in worker logs. do you want me to send them regardless?
Raphaël
Raphaël4w ago
Yes please, to see if the crons are running correctly Could you show me your .env config ? Are you using pg-boss or bull-mq ?
Sebastian
SebastianOP4w ago
sure, sec, let me paste everything
TAG=latest

PGUSER_SUPERUSER=postgres
PGPASSWORD_SUPERUSER=xxx
POSTGRES_ADMIN_PASSWORD=xxx

PG_DATABASE_HOST=db:5432
REDIS_URL=redis://redis:6379

SERVER_URL=https://crm.domain.com

# Use openssl rand -base64 32 for each secret
APP_SECRET=xxx

SIGN_IN_PREFILLED=true

STORAGE_TYPE=local

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

MESSAGING_PROVIDER_GMAIL_ENABLED=true
CALENDAR_PROVIDER_GOOGLE_ENABLED=true

AUTH_PASSWORD_ENABLED=false
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
AUTH_GOOGLE_CLIENT_SECRET=xxx
AUTH_GOOGLE_CALLBACK_URL=https://crm.domain.com/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=https://crm.domain.com/auth/google-apis/get-access-token

EMAIL_DRIVER=smtp
EMAIL_FROM_NAME='Twenty CRM'
EMAIL_SMTP_HOST=smtp.eu.mailgun.org
EMAIL_SMTP_PORT=587
EMAIL_SMTP_PASSWORD=xxx
TAG=latest

PGUSER_SUPERUSER=postgres
PGPASSWORD_SUPERUSER=xxx
POSTGRES_ADMIN_PASSWORD=xxx

PG_DATABASE_HOST=db:5432
REDIS_URL=redis://redis:6379

SERVER_URL=https://crm.domain.com

# Use openssl rand -base64 32 for each secret
APP_SECRET=xxx

SIGN_IN_PREFILLED=true

STORAGE_TYPE=local

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

MESSAGING_PROVIDER_GMAIL_ENABLED=true
CALENDAR_PROVIDER_GOOGLE_ENABLED=true

AUTH_PASSWORD_ENABLED=false
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
AUTH_GOOGLE_CLIENT_SECRET=xxx
AUTH_GOOGLE_CALLBACK_URL=https://crm.domain.com/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=https://crm.domain.com/auth/google-apis/get-access-token

EMAIL_DRIVER=smtp
EMAIL_FROM_NAME='Twenty CRM'
EMAIL_SMTP_HOST=smtp.eu.mailgun.org
EMAIL_SMTP_PORT=587
EMAIL_SMTP_PASSWORD=xxx
re: pg-boss or bull-mq, I'm not sure, I didn't set up either of them, using what's provided in docker compose
Raphaël
Raphaël4w ago
Thank you. Could you send me the calendarChannel syncStatus and the messageChannel syncStatus and also their syncStage ?
Sebastian
SebastianOP4w ago
where can I find that?
Raphaël
Raphaël4w ago
In the database in your workspace schema 🙂 Did you enable people api in your cloud console ?
Raphaël
Raphaël4w ago
No description
Sebastian
SebastianOP3w ago
just enabled it, but it still doesn't work. results from database:
default=# SELECT "syncStatus", "syncStage"
default-# FROM "workspace_7p0vvem84hpqothgegpexvj81"."calendarChannel";
syncStatus | syncStage
------------+-------------------------------------------
ACTIVE | PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING
ACTIVE | PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING
(2 rows)

default=# SELECT "syncStatus", "syncStage"
default-# FROM "workspace_7p0vvem84hpqothgegpexvj81"."messageChannel";
syncStatus | syncStage
---------------------------------+-----------
FAILED_INSUFFICIENT_PERMISSIONS | FAILED
FAILED_INSUFFICIENT_PERMISSIONS | FAILED
(2 rows)
default=# SELECT "syncStatus", "syncStage"
default-# FROM "workspace_7p0vvem84hpqothgegpexvj81"."calendarChannel";
syncStatus | syncStage
------------+-------------------------------------------
ACTIVE | PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING
ACTIVE | PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING
(2 rows)

default=# SELECT "syncStatus", "syncStage"
default-# FROM "workspace_7p0vvem84hpqothgegpexvj81"."messageChannel";
syncStatus | syncStage
---------------------------------+-----------
FAILED_INSUFFICIENT_PERMISSIONS | FAILED
FAILED_INSUFFICIENT_PERMISSIONS | FAILED
(2 rows)
Might it be related to this error? I'm getting it whenever I log in using Google SSO. But when I've tried to remove and reconnect google account, I saw only this in logs
Sebastian
SebastianOP3w ago
@Raphaël ^^
Raphaël
Raphaël3w ago
@charles
charles
charles3w ago
same as in the other help thread, I would schedule a call with Sebastian to investigate it (I think we can do one of the two), we should have a good idea of the issue then @Sebastian please re-connect your account after having enabled the People API and make sure the right scopes are attached to your individual Gmail email account
charles
charles3w ago
(sorry it's french but example on my side)
No description
Sebastian
SebastianOP3w ago
yep, already tried to enable People API and reconnect the account. Error's still the same. Having a call would be great though! Let me know when you have time. I'm pretty much available for the next 3h
Want results from more Discord servers?
Add your server