ERROR: duplicate key value violates unique constraint
Because of a small error in a database query, the whole etherpad server crashes. It does not look very robust.
I use version 1.7 with postgresqlpool.
etherpad.log
....
[2018-11-04 16:09:13.999] [ERROR] console - error: duplicate key value violates unique constraint "store_pkey"
at Connection.parseE (/home/etherpad/etherpad-lite/src/node_modules/pg/lib/connection.js:569:11)
at Connection.parseMessage (/home/etherpad/etherpad-lite/src/node_modules/pg/lib/connection.js:396:17)
at Socket.
Here is my database configuration:
/* postgrespool - connection via postgresql socket */
"dbType" : "postgrespool",
"dbSettings" : {
"user" : "etherpad",
"host" : "/run/postgresql",
"password": "",
"database": "etherpad",
"max": 20,
"min": 8,
"charset" : "utf8mb4"
},
Here I found something: https://github.com/Pita/ueberDB/issues/117
@ukcb, did your problem happen during table creation or in "steady state" (when the serivce was already running since a long time)?
Regarding the use of the stored function ueberdb_insert_or_update() to perform an UPSERT, I have proposed a version that made use of feature detection in https://github.com/Pita/ueberDB/pull/99, to bypass the function creation and use the native functionality on compatible PostreSQL versions (code here), but it was not merged.
@muxator The error occurs only after a few days runtime. The database table is of course already there, because the pad has been used for some time. I use postgresql 9.6.