Issue with syncing in a PMG cluster

jedo19

Active Member
Nov 16, 2018
27
3
43
48
I have this weird error in sync which I see on my Master node :

Code:
pmgmirror[414]:database sync 'node-2' failed - DBD::Pg::st execute failed: ERROR:  duplicate key value violates unique constraint "cmailstore_pkey"#012DETAIL:  Key (cid, rid)=(2, 70691) already exists. at /usr/share/perl5/PMG/DBTools.pm line 1095.

But looking on my secondary node:

Code:
pmgmirror[1196]: cluster synchronization finished  (0 errors, 2.40 seconds (files 0.16, database 1.91, config 0.34)

all is jolly.

What I have done is migrate to a newer version from 5.x to 7.x, firstly I dissolved the cluster, upgraded the master node to the latest version, reinstalled the secondary node and rejoined it to the cluster. All seems to be working fine just that error is repeated in my log file

Code:
pmgmirror[414]: database sync 'node-2' failed - DBD::Pg::st execute failed: ERROR:  duplicate key value violates unique constraint "cmailstore_pkey"#012DETAIL:  Key (cid, rid)=(2, 70691) already exists. at /usr/share/perl5/PMG/DBTools.pm line 1095.
Dec 16 14:23:44 node-1 pmgmirror[414]: cluster synchronization finished  (1 errors, 0.03 seconds (files 0.00, database 0.03, config 0.00))


Any chance I get rid of this issue?
Thanks
 
Last edited:
I dissolved the cluster,
how did you dissolve the cluster?
(did you run `pmgcm delete <cid>` ? (<cid> being replaced by the id of the node)?

could you please post your /etc/pmg/cluster.conf (redact the fingerprints IPs if you want (if possible keep the ip's at least partially readable)
 
how did you dissolve the cluster?
(did you run `pmgcm delete <cid>` ? (<cid> being replaced by the id of the node)?

could you please post your /etc/pmg/cluster.conf (redact the fingerprints IPs if you want (if possible keep the ip's at least partially readable)
Hi Stoiko,
Thanks for coming back to me. Yes, I used pmgcm delete as you suggested. And then upgraded the main node and reinstalled the second and rejoined it after. I tried couple of times but the error always came up


After that, I think I resolved the issue by deleting data from two tables cmailstore and statistic now it looks like all is good. It is not a problem if I am missing that data it was spam so all good now :).

Thanks again for replying I really appreciate this!
Borut
 
  • Like
Reactions: Stoiko Ivanov
Glad you found a workaround that worked for you :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!