T
Twenty5mo ago
paulyili

Procedure to sync emails? 0.10.0

Always loving new updates! & congrats on 10k stars! I've installed a fresh 0.10.0 on my test ubuntu VM in docker. I do this before migrating in case i stuff something up. im running my usual config, i have redis server running and seems to be working (no errors) first thing i noticed was when connecting emails (gmail) it now has a status of "not synced" how do we get it to sync?
19 Replies
charles
charles5mo ago
You'll need to set the cron working: yarn command:prod cron:messaging:gmail-fetch-messages-from-cache yarn command:prod cron:messaging:gmail-partial-sync
paulyili
paulyili5mo ago
I've ran that, everything initialized. is there something else i need to do? or just wait?
charles
charles5mo ago
can you see the logs of your worker? oh, and make sure your workspace subscriptionStatus is 'active' we forgot to remove this check for self-hosting
paulyili
paulyili5mo ago
"fbeedd91-a56f-4898-af3e-123123123" "mycompany" "workspace-logo/original/4a452104-70ab-406e-8a76-7123ab3b123c8.jpg" "123123-ea59-48d7-89bb-123123a86e2cd" "2024-04-23 14:10:30.586262+00" "2024-04-23 14:10:51.646095+00" true "active" (slighty modified) but thats the row from the workspace table (i changed it to active) as for the logs, do you mean inside the twenty-server-1 container? after running the yarn commands ? i ran the 2 commands, everything said initialized. the container logs look like this:
[Nest] 1 - 04/23/2024, 3:08:04 PM LOG [WorkspaceQueryRunnerService] query time: 23.42888903617859 ms on query person
[Nest] 1 - 04/23/2024, 3:08:04 PM LOG [WorkspaceQueryRunnerService] query time: 185.89889001846313 ms on query person
[Nest] 1 - 04/23/2024, 3:08:06 PM LOG [WorkspaceQueryRunnerService] query time: 19.949187994003296 ms on query activityTarget
[Nest] 1 - 04/23/2024, 3:08:11 PM LOG [WorkspaceQueryRunnerService] query time: 26.88669991493225 ms on query activityTarget
[Nest] 1 - 04/23/2024, 3:08:04 PM LOG [WorkspaceQueryRunnerService] query time: 23.42888903617859 ms on query person
[Nest] 1 - 04/23/2024, 3:08:04 PM LOG [WorkspaceQueryRunnerService] query time: 185.89889001846313 ms on query person
[Nest] 1 - 04/23/2024, 3:08:06 PM LOG [WorkspaceQueryRunnerService] query time: 19.949187994003296 ms on query activityTarget
[Nest] 1 - 04/23/2024, 3:08:11 PM LOG [WorkspaceQueryRunnerService] query time: 26.88669991493225 ms on query activityTarget
charles
charles5mo ago
You also need to run the worker separately: yarn worker:prod in a separate terminal/process
paulyili
paulyili5mo ago
Okay i can see it the worker running. throwing some errors from the demo workspaces. it did sync some emails and contacts. but it now says failed on the email, not syncing. and it did import some contacts, not all. and not all email messages are showing. do i need the terminal always open to sync emails? closed the terminal. added a new email but that is now not synced.
charles
charles5mo ago
mmmh ok, we have ongoing bug on the emails, I'm looking into them, you might be running into them too I have fixed the issue, I'm sure it's working so I can help you troubleshoot if it's not working could you try to remove your connected account and add it again? also keep an eye on the worker to see if everything looks normal. You should see that xxxx emails will be imported and then it should try to import it 10 by 10 (make sure to use v0.10.1 container)
paulyili
paulyili5mo ago
oh yes! it worked. took an hour or so to sync. and it now says "succeeded" how do we run the worker in the background with out having the terminal opened
charles
charles5mo ago
you'll need to run another container which run command would be yarn worker:prod
paulyili
paulyili5mo ago
as in twenty-server-2 container running yarn worker:prod command ?
charles
charles5mo ago
yes
charles
charles5mo ago
or you can also use something like pm2 to keep both process running in the same container https://pm2.keymetrics.io/
PM2 - Home
Advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, micro service management, at a glance.
paulyili
paulyili5mo ago
so something like this?
version: '3.8'

services:
server:
image: twentycrm/twenty:${TAG}
expose:
- 3000
volumes:
- server-local-data:/app/${STORAGE_LOCAL_PATH:-.local-storage}
ports:
- "3000:3000"
environment:
# Environment variables
depends_on:
db:
condition: service_healthy
networks:
- twenty_frontend
restart: always

worker:
image: twentycrm/twenty:${TAG}
volumes:
- server-local-data:/app/${STORAGE_LOCAL_PATH:-.local-storage}
environment:
# Environment variables
command: yarn worker:prod
depends_on:
- server
networks:
- twenty_frontend
restart: unless-stopped

networks:
twenty_frontend:
driver: bridge

volumes:
server-local-data:
external: true
version: '3.8'

services:
server:
image: twentycrm/twenty:${TAG}
expose:
- 3000
volumes:
- server-local-data:/app/${STORAGE_LOCAL_PATH:-.local-storage}
ports:
- "3000:3000"
environment:
# Environment variables
depends_on:
db:
condition: service_healthy
networks:
- twenty_frontend
restart: always

worker:
image: twentycrm/twenty:${TAG}
volumes:
- server-local-data:/app/${STORAGE_LOCAL_PATH:-.local-storage}
environment:
# Environment variables
command: yarn worker:prod
depends_on:
- server
networks:
- twenty_frontend
restart: unless-stopped

networks:
twenty_frontend:
driver: bridge

volumes:
server-local-data:
external: true
charles
charles5mo ago
yes!
paulyili
paulyili5mo ago
that worked well. Can't wait to see this all come together. This is defienly the longest docker-compose file i've got.
Want results from more Discord servers?
Add your server