error: error: duplicate key value violates unique constraint
After upgrading to
v0.53
(following help steps from: https://discord.com/channels/1130383047699738754/1381926650828292096) I now see following repeating errors in the logs:
and users are complaining that there might be missing or disappeared data (see screenshot)
25 Replies
how can I check if data might have been removed?
Hello,
@Guillaume does this look like your position null issue or totally out of scope ?
sorry, I didn't get the question
I think it might be that now empty records are being created (or displayed):

out of scope
Did you upgrade to 53 or from 53 to 55 ?
I've upgraded gradually from 0.50 to 0.53
@Guillaume should I try to update to 0.55 gradually?
Hello @Sebastian I don't think this will resolve our issue here but you can give this a try in order to put on the side any potentiel lower version usage edge cases
updated to
0.55
, but now I'm getting this error, no matter what I select - people, companies, opportunities, etc.
Are you logged in with an admin workspace member ?
Yes, I have admin role
Do you please have any more information regarding the stacktrace itself ?
@Weiko could you please give this is a look when you have some free time please 🙏 ?
that's the problem - I don't see any errors in the logs when this happens
Do you have Permissions V2 enabled in the lab?
I can't see this option

My bad, not in the lab, I meant on your workspace, but it's probably not enabled then 🤔
Can you check the admin panel and see what feature flag you have
/settings/admin-panel > type your admin email address in the feature flag input
that's all I see if I go to
/settings/admin-panel

how can I enable perms in database? I'll connect and just updated the field
Do you have access to your DB? Can you see any role attached to your user? You can check userWorkspaceRole table
As for the attached role (most likely admin), do you have canReadAllObjectRecords as true?
If all of that is fine, it might be due to your cache. You can try flushing it with
npx nx run twenty-server:command cache:flush
+ restart your server containerI can see Admin role is attached to my user
@Weiko should I run this command in server container?
it asks me to install nx
my bad, try
yarn command:prod cache:flush
thanks, it helped. I can see everything. but I still get a feeling that sync from gmail doesn't work, even though it's "Importing..." and I can't see any errors in the logs. how can I check if it's syncing?
Do you have a worker container running?
yes
Can you check this https://twenty.com/developers/section/self-hosting/setup#background-jobs-for-calendar-&-messaging and see if the crons are correctly running on your side?
I ran:
yarn command:prod cron:messaging:message-list-fetch
and I've got this error
@Weiko should I ignore this error?