[Bug]: duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique" #834

Closed
opened 2026-02-04 21:27:25 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @kankadev on GitHub (Oct 10, 2025).

Where is the problem occurring?

I'm not sure

What browsers are you seeing the problem on?

Firefox

Current behavior

Planka crashes every few days, sometimes even more often. Once, I saw something in the log that suggested there were two users with the same ID or name. I don't have the log from back then. But during the last crash, I saw the following:

planka-postgres  |
planka-postgres  | PostgreSQL Database directory appears to contain a database; Skipping initialization
planka-postgres  |
planka-postgres  | 2025-10-06 03:33:13.685 UTC [1] LOG:  starting PostgreSQL 16.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
planka-postgres  | 2025-10-06 03:33:13.685 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
planka-postgres  | 2025-10-06 03:33:13.686 UTC [1] LOG:  listening on IPv6 address "::", port 5432
planka-postgres  | 2025-10-06 03:33:13.688 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
planka-postgres  | 2025-10-06 03:33:13.692 UTC [29] LOG:  database system was shut down at 2025-10-06 03:20:04 UTC
planka-postgres  | 2025-10-06 03:33:13.699 UTC [1] LOG:  database system is ready to accept connections
planka-postgres  | 2025-10-06 03:38:13.748 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-06 03:38:13.861 UTC [27] LOG:  checkpoint complete: wrote 4 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.103 s, sync=0.004 s, total=0.113 s; sync files=3, longest=0.002 s, average=0.002 s; distance=1 kB, estimate=1 kB; lsn=0/1AE6DF0, redo lsn=0/1AE6DB8
planka-postgres  | 2025-10-08 06:18:57.570 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 06:18:58.186 UTC [27] LOG:  checkpoint complete: wrote 7 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.607 s, sync=0.003 s, total=0.616 s; sync files=7, longest=0.002 s, average=0.001 s; distance=9 kB, estimate=9 kB; lsn=0/1AE91F0, redo lsn=0/1AE91B8
planka-postgres  | 2025-10-08 06:28:57.326 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 06:28:59.645 UTC [27] LOG:  checkpoint complete: wrote 24 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.309 s, sync=0.005 s, total=2.320 s; sync files=24, longest=0.003 s, average=0.001 s; distance=9 kB, estimate=9 kB; lsn=0/1AEB808, redo lsn=0/1AEB7D0
planka-postgres  | 2025-10-08 06:33:57.696 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 06:34:02.932 UTC [27] LOG:  checkpoint complete: wrote 53 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.223 s, sync=0.007 s, total=5.236 s; sync files=48, longest=0.002 s, average=0.001 s; distance=34 kB, estimate=34 kB; lsn=0/1AF43C0, redo lsn=0/1AF4388
planka-postgres  | 2025-10-08 06:38:57.956 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 06:39:01.282 UTC [27] LOG:  checkpoint complete: wrote 34 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.314 s, sync=0.006 s, total=3.326 s; sync files=32, longest=0.003 s, average=0.001 s; distance=24 kB, estimate=33 kB; lsn=0/1AFA528, redo lsn=0/1AFA4F0
planka-postgres  | 2025-10-08 06:43:57.283 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 06:44:02.515 UTC [27] LOG:  checkpoint complete: wrote 53 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.220 s, sync=0.006 s, total=5.233 s; sync files=44, longest=0.002 s, average=0.001 s; distance=32 kB, estimate=33 kB; lsn=0/1B026F8, redo lsn=0/1B026C0
planka-postgres  | 2025-10-08 06:53:57.715 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 06:54:00.335 UTC [27] LOG:  checkpoint complete: wrote 27 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.609 s, sync=0.004 s, total=2.621 s; sync files=23, longest=0.003 s, average=0.001 s; distance=14 kB, estimate=31 kB; lsn=0/1B061E0, redo lsn=0/1B061A8
planka-postgres  | 2025-10-08 06:58:57.400 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 06:58:59.021 UTC [27] LOG:  checkpoint complete: wrote 17 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.610 s, sync=0.004 s, total=1.622 s; sync files=17, longest=0.003 s, average=0.001 s; distance=19 kB, estimate=30 kB; lsn=0/1B0B000, redo lsn=0/1B0AFC8
planka-postgres  | 2025-10-08 07:03:57.122 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:04:00.244 UTC [27] LOG:  checkpoint complete: wrote 32 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.112 s, sync=0.005 s, total=3.123 s; sync files=30, longest=0.002 s, average=0.001 s; distance=39 kB, estimate=39 kB; lsn=0/1B14F80, redo lsn=0/1B14F48
planka-postgres  | 2025-10-08 07:08:50.870 UTC [138036] ERROR:  duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique"
planka-postgres  | 2025-10-08 07:08:50.870 UTC [138036] DETAIL:  Key (card_id, user_id)=(1616616534124266676, 1593825223461831686) already exists.
planka-postgres  | 2025-10-08 07:08:50.870 UTC [138036] STATEMENT:  insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning *
planka-postgres  | 2025-10-08 07:08:57.318 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:09:02.248 UTC [27] LOG:  checkpoint complete: wrote 50 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.919 s, sync=0.006 s, total=4.931 s; sync files=45, longest=0.002 s, average=0.001 s; distance=56 kB, estimate=56 kB; lsn=0/1B23160, redo lsn=0/1B23128
planka-postgres  | 2025-10-08 07:13:57.334 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:14:01.258 UTC [27] LOG:  checkpoint complete: wrote 40 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.914 s, sync=0.005 s, total=3.925 s; sync files=38, longest=0.002 s, average=0.001 s; distance=45 kB, estimate=55 kB; lsn=0/1B2E560, redo lsn=0/1B2E528
planka-postgres  | 2025-10-08 07:18:57.345 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:19:00.568 UTC [27] LOG:  checkpoint complete: wrote 33 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.213 s, sync=0.005 s, total=3.224 s; sync files=29, longest=0.002 s, average=0.001 s; distance=60 kB, estimate=60 kB; lsn=0/1B3D560, redo lsn=0/1B3D528
planka-postgres  | 2025-10-08 07:23:57.644 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:24:02.067 UTC [27] LOG:  checkpoint complete: wrote 45 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.412 s, sync=0.005 s, total=4.423 s; sync files=36, longest=0.002 s, average=0.001 s; distance=120 kB, estimate=120 kB; lsn=0/1B5B7B0, redo lsn=0/1B5B740
planka-postgres  | 2025-10-08 07:28:57.167 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:29:00.189 UTC [27] LOG:  checkpoint complete: wrote 31 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.012 s, sync=0.004 s, total=3.023 s; sync files=29, longest=0.002 s, average=0.001 s; distance=72 kB, estimate=115 kB; lsn=0/1B6D788, redo lsn=0/1B6D750
planka-postgres  | 2025-10-08 07:33:57.227 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:34:01.853 UTC [27] LOG:  checkpoint complete: wrote 47 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.617 s, sync=0.004 s, total=4.627 s; sync files=37, longest=0.002 s, average=0.001 s; distance=125 kB, estimate=125 kB; lsn=0/1B8CD08, redo lsn=0/1B8CCD0
planka-postgres  | 2025-10-08 07:38:57.936 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:39:02.671 UTC [27] LOG:  checkpoint complete: wrote 48 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.721 s, sync=0.006 s, total=4.735 s; sync files=37, longest=0.002 s, average=0.001 s; distance=125 kB, estimate=125 kB; lsn=0/1BAC290, redo lsn=0/1BAC258
planka-postgres  | 2025-10-08 07:41:17.581 UTC [139539] ERROR:  duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique"
planka-postgres  | 2025-10-08 07:41:17.581 UTC [139539] DETAIL:  Key (card_id, user_id)=(1616596983307306068, 1593825223461831686) already exists.
planka-postgres  | 2025-10-08 07:41:17.581 UTC [139539] STATEMENT:  insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning *
planka-postgres  | 2025-10-08 07:43:37.073 UTC [139648] ERROR:  duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique"
planka-postgres  | 2025-10-08 07:43:37.073 UTC [139648] DETAIL:  Key (card_id, user_id)=(1616596983307306068, 1593825223461831686) already exists.
planka-postgres  | 2025-10-08 07:43:37.073 UTC [139648] STATEMENT:  insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning *
planka-postgres  | 2025-10-08 07:43:57.770 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:43:58.887 UTC [27] LOG:  checkpoint complete: wrote 12 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.106 s, sync=0.006 s, total=1.117 s; sync files=12, longest=0.002 s, average=0.001 s; distance=14 kB, estimate=114 kB; lsn=0/1BAFC90, redo lsn=0/1BAFC58
planka-postgres  | 2025-10-08 07:48:57.932 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 07:49:03.161 UTC [27] LOG:  checkpoint complete: wrote 53 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.218 s, sync=0.004 s, total=5.230 s; sync files=35, longest=0.002 s, average=0.001 s; distance=150 kB, estimate=150 kB; lsn=0/1BD5630, redo lsn=0/1BD55F8
planka-postgres  | 2025-10-08 15:34:03.527 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 15:34:05.449 UTC [27] LOG:  checkpoint complete: wrote 20 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.912 s, sync=0.003 s, total=1.923 s; sync files=19, longest=0.002 s, average=0.001 s; distance=5 kB, estimate=135 kB; lsn=0/1BD6E18, redo lsn=0/1BD6DE0
planka-postgres  | 2025-10-08 15:44:03.595 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 15:44:05.618 UTC [27] LOG:  checkpoint complete: wrote 21 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.010 s, sync=0.005 s, total=2.023 s; sync files=19, longest=0.002 s, average=0.001 s; distance=30 kB, estimate=125 kB; lsn=0/1BDE858, redo lsn=0/1BDE820
planka-postgres  | 2025-10-08 15:49:03.692 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 15:49:05.928 UTC [27] LOG:  checkpoint complete: wrote 23 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.218 s, sync=0.005 s, total=2.237 s; sync files=21, longest=0.002 s, average=0.001 s; distance=36 kB, estimate=116 kB; lsn=0/1BE7B20, redo lsn=0/1BE7AE8
planka-postgres  | 2025-10-08 15:54:03.971 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 15:54:05.887 UTC [27] LOG:  checkpoint complete: wrote 20 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.908 s, sync=0.003 s, total=1.917 s; sync files=18, longest=0.002 s, average=0.001 s; distance=22 kB, estimate=107 kB; lsn=0/1BED4B8, redo lsn=0/1BED480
planka-postgres  | 2025-10-08 16:04:04.015 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 16:04:07.647 UTC [27] LOG:  checkpoint complete: wrote 37 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.613 s, sync=0.004 s, total=3.632 s; sync files=35, longest=0.002 s, average=0.001 s; distance=52 kB, estimate=101 kB; lsn=0/1BFA7E8, redo lsn=0/1BFA7B0
planka-postgres  | 2025-10-08 16:09:04.739 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 16:09:08.095 UTC [27] LOG:  checkpoint complete: wrote 34 buffers (0.2%); 1 WAL file(s) added, 0 removed, 0 recycled; write=3.313 s, sync=0.004 s, total=3.357 s; sync files=26, longest=0.002 s, average=0.001 s; distance=78 kB, estimate=99 kB; lsn=0/1C0E228, redo lsn=0/1C0E1F0
planka-postgres  | 2025-10-08 16:24:04.226 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 16:24:07.748 UTC [27] LOG:  checkpoint complete: wrote 36 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.513 s, sync=0.004 s, total=3.522 s; sync files=34, longest=0.002 s, average=0.001 s; distance=63 kB, estimate=95 kB; lsn=0/1C1DFC0, redo lsn=0/1C1DF88
planka-postgres  | 2025-10-08 16:25:32.087 UTC [162939] ERROR:  duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique"
planka-postgres  | 2025-10-08 16:25:32.087 UTC [162939] DETAIL:  Key (card_id, user_id)=(1616895047955908036, 1612534043524465720) already exists.
planka-postgres  | 2025-10-08 16:25:32.087 UTC [162939] STATEMENT:  insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning *
planka-postgres  | 2025-10-08 16:29:04.809 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 16:29:07.230 UTC [27] LOG:  checkpoint complete: wrote 25 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.410 s, sync=0.004 s, total=2.421 s; sync files=25, longest=0.002 s, average=0.001 s; distance=36 kB, estimate=89 kB; lsn=0/1C27040, redo lsn=0/1C27008
planka-postgres  | 2025-10-08 16:34:04.330 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 16:34:06.448 UTC [27] LOG:  checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.108 s, sync=0.004 s, total=2.119 s; sync files=20, longest=0.002 s, average=0.001 s; distance=38 kB, estimate=84 kB; lsn=0/1C30AD8, redo lsn=0/1C30AA0
planka-postgres  | 2025-10-08 16:44:04.458 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 16:44:05.976 UTC [27] LOG:  checkpoint complete: wrote 16 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.507 s, sync=0.005 s, total=1.518 s; sync files=16, longest=0.003 s, average=0.001 s; distance=18 kB, estimate=78 kB; lsn=0/1C356B0, redo lsn=0/1C35678
planka-postgres  | 2025-10-08 16:49:04.978 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-08 16:49:05.692 UTC [27] LOG:  checkpoint complete: wrote 8 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.704 s, sync=0.005 s, total=0.714 s; sync files=8, longest=0.004 s, average=0.001 s; distance=10 kB, estimate=71 kB; lsn=0/1C38198, redo lsn=0/1C38160
planka-postgres  | 2025-10-09 06:18:41.290 UTC [200067] ERROR:  duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique"
planka-postgres  | 2025-10-09 06:18:41.290 UTC [200067] DETAIL:  Key (card_id, user_id)=(1616886456603641280, 1612534043524465720) already exists.
planka-postgres  | 2025-10-09 06:18:41.290 UTC [200067] STATEMENT:  insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning *
planka-postgres  | 2025-10-09 06:19:15.810 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-09 06:19:18.128 UTC [27] LOG:  checkpoint complete: wrote 24 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.309 s, sync=0.004 s, total=2.318 s; sync files=24, longest=0.003 s, average=0.001 s; distance=32 kB, estimate=67 kB; lsn=0/1C40328, redo lsn=0/1C402F0
planka-postgres  | 2025-10-09 08:04:16.734 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-09 08:04:19.256 UTC [27] LOG:  checkpoint complete: wrote 26 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.509 s, sync=0.007 s, total=2.522 s; sync files=23, longest=0.005 s, average=0.001 s; distance=58 kB, estimate=66 kB; lsn=0/1C4EDE0, redo lsn=0/1C4EDA8
planka-postgres  | 2025-10-09 08:09:16.285 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-09 08:09:18.807 UTC [27] LOG:  checkpoint complete: wrote 26 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.510 s, sync=0.007 s, total=2.523 s; sync files=24, longest=0.004 s, average=0.001 s; distance=45 kB, estimate=64 kB; lsn=0/1C5A290, redo lsn=0/1C5A258
planka-postgres  | 2025-10-09 08:14:16.876 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-09 08:14:17.588 UTC [27] LOG:  checkpoint complete: wrote 8 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.704 s, sync=0.003 s, total=0.712 s; sync files=8, longest=0.002 s, average=0.001 s; distance=15 kB, estimate=59 kB; lsn=0/1C5DFC8, redo lsn=0/1C5DF90
planka-postgres  | 2025-10-09 08:29:16.886 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-09 08:29:19.005 UTC [27] LOG:  checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.109 s, sync=0.004 s, total=2.119 s; sync files=20, longest=0.002 s, average=0.001 s; distance=44 kB, estimate=58 kB; lsn=0/1C69358, redo lsn=0/1C69320
planka-postgres  | 2025-10-10 05:59:34.725 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-10 05:59:37.555 UTC [27] LOG:  checkpoint complete: wrote 29 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.817 s, sync=0.005 s, total=2.830 s; sync files=29, longest=0.002 s, average=0.001 s; distance=41 kB, estimate=56 kB; lsn=0/1C73900, redo lsn=0/1C738C8
planka-postgres  | 2025-10-10 06:01:04.626 UTC [263482] ERROR:  duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique"
planka-postgres  | 2025-10-10 06:01:04.626 UTC [263482] DETAIL:  Key (card_id, user_id)=(1616900890596214233, 1593825223461831686) already exists.
planka-postgres  | 2025-10-10 06:01:04.626 UTC [263482] STATEMENT:  insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning *
planka-postgres  | 2025-10-10 06:04:34.632 UTC [27] LOG:  checkpoint starting: time
planka-postgres  | 2025-10-10 06:04:37.754 UTC [27] LOG:  checkpoint complete: wrote 32 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.112 s, sync=0.005 s, total=3.123 s; sync files=30, longest=0.002 s, average=0.001 s; distance=60 kB, estimate=60 kB; lsn=0/1C82C48, redo lsn=0/1C82C10
planka-postgres  | 2025-10-10 08:34:49.997 UTC [1] LOG:  received fast shutdown request
planka-postgres  | 2025-10-10 08:34:50.006 UTC [1] LOG:  aborting any active transactions
planka-postgres  | 2025-10-10 08:34:50.017 UTC [1] LOG:  background worker "logical replication launcher" (PID 32) exited with exit code 1
planka-postgres  | 2025-10-10 08:34:50.040 UTC [27] LOG:  shutting down
planka-postgres  | 2025-10-10 08:34:50.043 UTC [27] LOG:  checkpoint starting: shutdown immediate
planka-postgres  | 2025-10-10 08:34:50.063 UTC [27] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.003 s, sync=0.004 s, total=0.024 s; sync files=3, longest=0.003 s, average=0.002 s; distance=0 kB, estimate=54 kB; lsn=0/1C82CF8, redo lsn=0/1C82CF8
planka-postgres  | 2025-10-10 08:34:50.078 UTC [1] LOG:  database system is shut down
planka           |
planka           | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot
planka           | be matched up with the column names of any attributes in this model (`cardsubscription`).  This probably
planka           | means there is a bug in this adapter.
planka           | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated
planka           | in uniqueness errors, then just use an empty array for the `keys` property of this error.)
planka           | (Proceeding anyway as if these keys weren't included...)
planka           |
planka           |
planka           | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot
planka           | be matched up with the column names of any attributes in this model (`cardsubscription`).  This probably
planka           | means there is a bug in this adapter.
planka           | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated
planka           | in uniqueness errors, then just use an empty array for the `keys` property of this error.)
planka           | (Proceeding anyway as if these keys weren't included...)
planka           |
planka           |
planka           | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot
planka           | be matched up with the column names of any attributes in this model (`cardsubscription`).  This probably
planka           | means there is a bug in this adapter.
planka           | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated
planka           | in uniqueness errors, then just use an empty array for the `keys` property of this error.)
planka           | (Proceeding anyway as if these keys weren't included...)
planka           |
planka           |
planka           | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot
planka           | be matched up with the column names of any attributes in this model (`cardsubscription`).  This probably
planka           | means there is a bug in this adapter.
planka           | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated
planka           | in uniqueness errors, then just use an empty array for the `keys` property of this error.)
planka           | (Proceeding anyway as if these keys weren't included...)
planka           |
planka           |
planka           | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot
planka           | be matched up with the column names of any attributes in this model (`cardsubscription`).  This probably
planka           | means there is a bug in this adapter.
planka           | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated
planka           | in uniqueness errors, then just use an empty array for the `keys` property of this error.)
planka           | (Proceeding anyway as if these keys weren't included...)
planka           |
planka           |
planka           | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot
planka           | be matched up with the column names of any attributes in this model (`cardsubscription`).  This probably
planka           | means there is a bug in this adapter.
planka           | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated
planka           | in uniqueness errors, then just use an empty array for the `keys` property of this error.)
planka           | (Proceeding anyway as if these keys weren't included...)
planka           |

I first set up Planka normally, then activated it using Authentik SSO. I also use Traefik.

docker-compose.yml:

services:
  planka:
    image: ghcr.io/plankanban/planka:2.0.0-rc.3
    container_name: planka
    restart: on-failure
    volumes:
      - favicons:/app/public/favicons
      - user-avatars:/app/public/user-avatars
      - background-images:/app/public/background-images
      - attachments:/app/private/attachments
    env_file:
      - .env
    environment:
      - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@planka-postgres/${POSTGRES_DB}
    depends_on:
      planka-postgres:
        condition: service_healthy
    networks:
      - backend
      - frontend
    labels:
      - "traefik.enable=true"

      # HTTPS Router
      - "traefik.http.routers.planka.rule=Host(`${PLANKA_DOMAIN}`)"
      - "traefik.http.routers.planka.entrypoints=${TRAEFIK_ENTRYPOINT}"
      - "traefik.http.routers.planka.tls.certresolver=${TRAEFIK_CERT_RESOLVER}"
      - "traefik.http.services.planka.loadbalancer.server.port=1337"

      # HTTP -> HTTPS Redirect
      - "traefik.http.routers.planka-insecure.rule=Host(`${PLANKA_DOMAIN}`)"
      - "traefik.http.routers.planka-insecure.entrypoints=web"
      - "traefik.http.routers.planka-insecure.middlewares=planka-https-redirect"

      - "traefik.http.middlewares.planka-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.middlewares.planka-https-redirect.redirectscheme.permanent=true"

  planka-postgres:
    image: postgres:16-alpine
    container_name: planka-postgres
    restart: on-failure
    volumes:
      - db-data:/var/lib/postgresql/data
    env_file:
      - .env
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - backend

volumes:
  favicons:
  user-avatars:
  background-images:
  attachments:
  db-data:

networks:
  frontend:
    external: true
    name: traefik_frontend
  backend:
    external: true
    name: traefik_backend

Desired behavior

No response

Steps to reproduce

Don't know

Other information

No response

Originally created by @kankadev on GitHub (Oct 10, 2025). ### Where is the problem occurring? I'm not sure ### What browsers are you seeing the problem on? Firefox ### Current behavior Planka crashes every few days, sometimes even more often. Once, I saw something in the log that suggested there were two users with the same ID or name. I don't have the log from back then. But during the last crash, I saw the following: ``` planka-postgres | planka-postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization planka-postgres | planka-postgres | 2025-10-06 03:33:13.685 UTC [1] LOG: starting PostgreSQL 16.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit planka-postgres | 2025-10-06 03:33:13.685 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 planka-postgres | 2025-10-06 03:33:13.686 UTC [1] LOG: listening on IPv6 address "::", port 5432 planka-postgres | 2025-10-06 03:33:13.688 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" planka-postgres | 2025-10-06 03:33:13.692 UTC [29] LOG: database system was shut down at 2025-10-06 03:20:04 UTC planka-postgres | 2025-10-06 03:33:13.699 UTC [1] LOG: database system is ready to accept connections planka-postgres | 2025-10-06 03:38:13.748 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-06 03:38:13.861 UTC [27] LOG: checkpoint complete: wrote 4 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.103 s, sync=0.004 s, total=0.113 s; sync files=3, longest=0.002 s, average=0.002 s; distance=1 kB, estimate=1 kB; lsn=0/1AE6DF0, redo lsn=0/1AE6DB8 planka-postgres | 2025-10-08 06:18:57.570 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 06:18:58.186 UTC [27] LOG: checkpoint complete: wrote 7 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.607 s, sync=0.003 s, total=0.616 s; sync files=7, longest=0.002 s, average=0.001 s; distance=9 kB, estimate=9 kB; lsn=0/1AE91F0, redo lsn=0/1AE91B8 planka-postgres | 2025-10-08 06:28:57.326 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 06:28:59.645 UTC [27] LOG: checkpoint complete: wrote 24 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.309 s, sync=0.005 s, total=2.320 s; sync files=24, longest=0.003 s, average=0.001 s; distance=9 kB, estimate=9 kB; lsn=0/1AEB808, redo lsn=0/1AEB7D0 planka-postgres | 2025-10-08 06:33:57.696 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 06:34:02.932 UTC [27] LOG: checkpoint complete: wrote 53 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.223 s, sync=0.007 s, total=5.236 s; sync files=48, longest=0.002 s, average=0.001 s; distance=34 kB, estimate=34 kB; lsn=0/1AF43C0, redo lsn=0/1AF4388 planka-postgres | 2025-10-08 06:38:57.956 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 06:39:01.282 UTC [27] LOG: checkpoint complete: wrote 34 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.314 s, sync=0.006 s, total=3.326 s; sync files=32, longest=0.003 s, average=0.001 s; distance=24 kB, estimate=33 kB; lsn=0/1AFA528, redo lsn=0/1AFA4F0 planka-postgres | 2025-10-08 06:43:57.283 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 06:44:02.515 UTC [27] LOG: checkpoint complete: wrote 53 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.220 s, sync=0.006 s, total=5.233 s; sync files=44, longest=0.002 s, average=0.001 s; distance=32 kB, estimate=33 kB; lsn=0/1B026F8, redo lsn=0/1B026C0 planka-postgres | 2025-10-08 06:53:57.715 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 06:54:00.335 UTC [27] LOG: checkpoint complete: wrote 27 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.609 s, sync=0.004 s, total=2.621 s; sync files=23, longest=0.003 s, average=0.001 s; distance=14 kB, estimate=31 kB; lsn=0/1B061E0, redo lsn=0/1B061A8 planka-postgres | 2025-10-08 06:58:57.400 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 06:58:59.021 UTC [27] LOG: checkpoint complete: wrote 17 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.610 s, sync=0.004 s, total=1.622 s; sync files=17, longest=0.003 s, average=0.001 s; distance=19 kB, estimate=30 kB; lsn=0/1B0B000, redo lsn=0/1B0AFC8 planka-postgres | 2025-10-08 07:03:57.122 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:04:00.244 UTC [27] LOG: checkpoint complete: wrote 32 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.112 s, sync=0.005 s, total=3.123 s; sync files=30, longest=0.002 s, average=0.001 s; distance=39 kB, estimate=39 kB; lsn=0/1B14F80, redo lsn=0/1B14F48 planka-postgres | 2025-10-08 07:08:50.870 UTC [138036] ERROR: duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique" planka-postgres | 2025-10-08 07:08:50.870 UTC [138036] DETAIL: Key (card_id, user_id)=(1616616534124266676, 1593825223461831686) already exists. planka-postgres | 2025-10-08 07:08:50.870 UTC [138036] STATEMENT: insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning * planka-postgres | 2025-10-08 07:08:57.318 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:09:02.248 UTC [27] LOG: checkpoint complete: wrote 50 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.919 s, sync=0.006 s, total=4.931 s; sync files=45, longest=0.002 s, average=0.001 s; distance=56 kB, estimate=56 kB; lsn=0/1B23160, redo lsn=0/1B23128 planka-postgres | 2025-10-08 07:13:57.334 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:14:01.258 UTC [27] LOG: checkpoint complete: wrote 40 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.914 s, sync=0.005 s, total=3.925 s; sync files=38, longest=0.002 s, average=0.001 s; distance=45 kB, estimate=55 kB; lsn=0/1B2E560, redo lsn=0/1B2E528 planka-postgres | 2025-10-08 07:18:57.345 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:19:00.568 UTC [27] LOG: checkpoint complete: wrote 33 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.213 s, sync=0.005 s, total=3.224 s; sync files=29, longest=0.002 s, average=0.001 s; distance=60 kB, estimate=60 kB; lsn=0/1B3D560, redo lsn=0/1B3D528 planka-postgres | 2025-10-08 07:23:57.644 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:24:02.067 UTC [27] LOG: checkpoint complete: wrote 45 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.412 s, sync=0.005 s, total=4.423 s; sync files=36, longest=0.002 s, average=0.001 s; distance=120 kB, estimate=120 kB; lsn=0/1B5B7B0, redo lsn=0/1B5B740 planka-postgres | 2025-10-08 07:28:57.167 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:29:00.189 UTC [27] LOG: checkpoint complete: wrote 31 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.012 s, sync=0.004 s, total=3.023 s; sync files=29, longest=0.002 s, average=0.001 s; distance=72 kB, estimate=115 kB; lsn=0/1B6D788, redo lsn=0/1B6D750 planka-postgres | 2025-10-08 07:33:57.227 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:34:01.853 UTC [27] LOG: checkpoint complete: wrote 47 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.617 s, sync=0.004 s, total=4.627 s; sync files=37, longest=0.002 s, average=0.001 s; distance=125 kB, estimate=125 kB; lsn=0/1B8CD08, redo lsn=0/1B8CCD0 planka-postgres | 2025-10-08 07:38:57.936 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:39:02.671 UTC [27] LOG: checkpoint complete: wrote 48 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.721 s, sync=0.006 s, total=4.735 s; sync files=37, longest=0.002 s, average=0.001 s; distance=125 kB, estimate=125 kB; lsn=0/1BAC290, redo lsn=0/1BAC258 planka-postgres | 2025-10-08 07:41:17.581 UTC [139539] ERROR: duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique" planka-postgres | 2025-10-08 07:41:17.581 UTC [139539] DETAIL: Key (card_id, user_id)=(1616596983307306068, 1593825223461831686) already exists. planka-postgres | 2025-10-08 07:41:17.581 UTC [139539] STATEMENT: insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning * planka-postgres | 2025-10-08 07:43:37.073 UTC [139648] ERROR: duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique" planka-postgres | 2025-10-08 07:43:37.073 UTC [139648] DETAIL: Key (card_id, user_id)=(1616596983307306068, 1593825223461831686) already exists. planka-postgres | 2025-10-08 07:43:37.073 UTC [139648] STATEMENT: insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning * planka-postgres | 2025-10-08 07:43:57.770 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:43:58.887 UTC [27] LOG: checkpoint complete: wrote 12 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.106 s, sync=0.006 s, total=1.117 s; sync files=12, longest=0.002 s, average=0.001 s; distance=14 kB, estimate=114 kB; lsn=0/1BAFC90, redo lsn=0/1BAFC58 planka-postgres | 2025-10-08 07:48:57.932 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 07:49:03.161 UTC [27] LOG: checkpoint complete: wrote 53 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.218 s, sync=0.004 s, total=5.230 s; sync files=35, longest=0.002 s, average=0.001 s; distance=150 kB, estimate=150 kB; lsn=0/1BD5630, redo lsn=0/1BD55F8 planka-postgres | 2025-10-08 15:34:03.527 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 15:34:05.449 UTC [27] LOG: checkpoint complete: wrote 20 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.912 s, sync=0.003 s, total=1.923 s; sync files=19, longest=0.002 s, average=0.001 s; distance=5 kB, estimate=135 kB; lsn=0/1BD6E18, redo lsn=0/1BD6DE0 planka-postgres | 2025-10-08 15:44:03.595 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 15:44:05.618 UTC [27] LOG: checkpoint complete: wrote 21 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.010 s, sync=0.005 s, total=2.023 s; sync files=19, longest=0.002 s, average=0.001 s; distance=30 kB, estimate=125 kB; lsn=0/1BDE858, redo lsn=0/1BDE820 planka-postgres | 2025-10-08 15:49:03.692 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 15:49:05.928 UTC [27] LOG: checkpoint complete: wrote 23 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.218 s, sync=0.005 s, total=2.237 s; sync files=21, longest=0.002 s, average=0.001 s; distance=36 kB, estimate=116 kB; lsn=0/1BE7B20, redo lsn=0/1BE7AE8 planka-postgres | 2025-10-08 15:54:03.971 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 15:54:05.887 UTC [27] LOG: checkpoint complete: wrote 20 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.908 s, sync=0.003 s, total=1.917 s; sync files=18, longest=0.002 s, average=0.001 s; distance=22 kB, estimate=107 kB; lsn=0/1BED4B8, redo lsn=0/1BED480 planka-postgres | 2025-10-08 16:04:04.015 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 16:04:07.647 UTC [27] LOG: checkpoint complete: wrote 37 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.613 s, sync=0.004 s, total=3.632 s; sync files=35, longest=0.002 s, average=0.001 s; distance=52 kB, estimate=101 kB; lsn=0/1BFA7E8, redo lsn=0/1BFA7B0 planka-postgres | 2025-10-08 16:09:04.739 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 16:09:08.095 UTC [27] LOG: checkpoint complete: wrote 34 buffers (0.2%); 1 WAL file(s) added, 0 removed, 0 recycled; write=3.313 s, sync=0.004 s, total=3.357 s; sync files=26, longest=0.002 s, average=0.001 s; distance=78 kB, estimate=99 kB; lsn=0/1C0E228, redo lsn=0/1C0E1F0 planka-postgres | 2025-10-08 16:24:04.226 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 16:24:07.748 UTC [27] LOG: checkpoint complete: wrote 36 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.513 s, sync=0.004 s, total=3.522 s; sync files=34, longest=0.002 s, average=0.001 s; distance=63 kB, estimate=95 kB; lsn=0/1C1DFC0, redo lsn=0/1C1DF88 planka-postgres | 2025-10-08 16:25:32.087 UTC [162939] ERROR: duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique" planka-postgres | 2025-10-08 16:25:32.087 UTC [162939] DETAIL: Key (card_id, user_id)=(1616895047955908036, 1612534043524465720) already exists. planka-postgres | 2025-10-08 16:25:32.087 UTC [162939] STATEMENT: insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning * planka-postgres | 2025-10-08 16:29:04.809 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 16:29:07.230 UTC [27] LOG: checkpoint complete: wrote 25 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.410 s, sync=0.004 s, total=2.421 s; sync files=25, longest=0.002 s, average=0.001 s; distance=36 kB, estimate=89 kB; lsn=0/1C27040, redo lsn=0/1C27008 planka-postgres | 2025-10-08 16:34:04.330 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 16:34:06.448 UTC [27] LOG: checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.108 s, sync=0.004 s, total=2.119 s; sync files=20, longest=0.002 s, average=0.001 s; distance=38 kB, estimate=84 kB; lsn=0/1C30AD8, redo lsn=0/1C30AA0 planka-postgres | 2025-10-08 16:44:04.458 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 16:44:05.976 UTC [27] LOG: checkpoint complete: wrote 16 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.507 s, sync=0.005 s, total=1.518 s; sync files=16, longest=0.003 s, average=0.001 s; distance=18 kB, estimate=78 kB; lsn=0/1C356B0, redo lsn=0/1C35678 planka-postgres | 2025-10-08 16:49:04.978 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-08 16:49:05.692 UTC [27] LOG: checkpoint complete: wrote 8 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.704 s, sync=0.005 s, total=0.714 s; sync files=8, longest=0.004 s, average=0.001 s; distance=10 kB, estimate=71 kB; lsn=0/1C38198, redo lsn=0/1C38160 planka-postgres | 2025-10-09 06:18:41.290 UTC [200067] ERROR: duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique" planka-postgres | 2025-10-09 06:18:41.290 UTC [200067] DETAIL: Key (card_id, user_id)=(1616886456603641280, 1612534043524465720) already exists. planka-postgres | 2025-10-09 06:18:41.290 UTC [200067] STATEMENT: insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning * planka-postgres | 2025-10-09 06:19:15.810 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-09 06:19:18.128 UTC [27] LOG: checkpoint complete: wrote 24 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.309 s, sync=0.004 s, total=2.318 s; sync files=24, longest=0.003 s, average=0.001 s; distance=32 kB, estimate=67 kB; lsn=0/1C40328, redo lsn=0/1C402F0 planka-postgres | 2025-10-09 08:04:16.734 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-09 08:04:19.256 UTC [27] LOG: checkpoint complete: wrote 26 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.509 s, sync=0.007 s, total=2.522 s; sync files=23, longest=0.005 s, average=0.001 s; distance=58 kB, estimate=66 kB; lsn=0/1C4EDE0, redo lsn=0/1C4EDA8 planka-postgres | 2025-10-09 08:09:16.285 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-09 08:09:18.807 UTC [27] LOG: checkpoint complete: wrote 26 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.510 s, sync=0.007 s, total=2.523 s; sync files=24, longest=0.004 s, average=0.001 s; distance=45 kB, estimate=64 kB; lsn=0/1C5A290, redo lsn=0/1C5A258 planka-postgres | 2025-10-09 08:14:16.876 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-09 08:14:17.588 UTC [27] LOG: checkpoint complete: wrote 8 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.704 s, sync=0.003 s, total=0.712 s; sync files=8, longest=0.002 s, average=0.001 s; distance=15 kB, estimate=59 kB; lsn=0/1C5DFC8, redo lsn=0/1C5DF90 planka-postgres | 2025-10-09 08:29:16.886 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-09 08:29:19.005 UTC [27] LOG: checkpoint complete: wrote 22 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.109 s, sync=0.004 s, total=2.119 s; sync files=20, longest=0.002 s, average=0.001 s; distance=44 kB, estimate=58 kB; lsn=0/1C69358, redo lsn=0/1C69320 planka-postgres | 2025-10-10 05:59:34.725 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-10 05:59:37.555 UTC [27] LOG: checkpoint complete: wrote 29 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.817 s, sync=0.005 s, total=2.830 s; sync files=29, longest=0.002 s, average=0.001 s; distance=41 kB, estimate=56 kB; lsn=0/1C73900, redo lsn=0/1C738C8 planka-postgres | 2025-10-10 06:01:04.626 UTC [263482] ERROR: duplicate key value violates unique constraint "card_subscription_card_id_user_id_unique" planka-postgres | 2025-10-10 06:01:04.626 UTC [263482] DETAIL: Key (card_id, user_id)=(1616900890596214233, 1593825223461831686) already exists. planka-postgres | 2025-10-10 06:01:04.626 UTC [263482] STATEMENT: insert into "public"."card_subscription" ("card_id", "created_at", "is_permanent", "updated_at", "user_id") values ($1, $2, $3, $4, $5) returning * planka-postgres | 2025-10-10 06:04:34.632 UTC [27] LOG: checkpoint starting: time planka-postgres | 2025-10-10 06:04:37.754 UTC [27] LOG: checkpoint complete: wrote 32 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3.112 s, sync=0.005 s, total=3.123 s; sync files=30, longest=0.002 s, average=0.001 s; distance=60 kB, estimate=60 kB; lsn=0/1C82C48, redo lsn=0/1C82C10 planka-postgres | 2025-10-10 08:34:49.997 UTC [1] LOG: received fast shutdown request planka-postgres | 2025-10-10 08:34:50.006 UTC [1] LOG: aborting any active transactions planka-postgres | 2025-10-10 08:34:50.017 UTC [1] LOG: background worker "logical replication launcher" (PID 32) exited with exit code 1 planka-postgres | 2025-10-10 08:34:50.040 UTC [27] LOG: shutting down planka-postgres | 2025-10-10 08:34:50.043 UTC [27] LOG: checkpoint starting: shutdown immediate planka-postgres | 2025-10-10 08:34:50.063 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.003 s, sync=0.004 s, total=0.024 s; sync files=3, longest=0.003 s, average=0.002 s; distance=0 kB, estimate=54 kB; lsn=0/1C82CF8, redo lsn=0/1C82CF8 planka-postgres | 2025-10-10 08:34:50.078 UTC [1] LOG: database system is shut down planka | planka | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot planka | be matched up with the column names of any attributes in this model (`cardsubscription`). This probably planka | means there is a bug in this adapter. planka | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated planka | in uniqueness errors, then just use an empty array for the `keys` property of this error.) planka | (Proceeding anyway as if these keys weren't included...) planka | planka | planka | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot planka | be matched up with the column names of any attributes in this model (`cardsubscription`). This probably planka | means there is a bug in this adapter. planka | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated planka | in uniqueness errors, then just use an empty array for the `keys` property of this error.) planka | (Proceeding anyway as if these keys weren't included...) planka | planka | planka | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot planka | be matched up with the column names of any attributes in this model (`cardsubscription`). This probably planka | means there is a bug in this adapter. planka | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated planka | in uniqueness errors, then just use an empty array for the `keys` property of this error.) planka | (Proceeding anyway as if these keys weren't included...) planka | planka | planka | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot planka | be matched up with the column names of any attributes in this model (`cardsubscription`). This probably planka | means there is a bug in this adapter. planka | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated planka | in uniqueness errors, then just use an empty array for the `keys` property of this error.) planka | (Proceeding anyway as if these keys weren't included...) planka | planka | planka | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot planka | be matched up with the column names of any attributes in this model (`cardsubscription`). This probably planka | means there is a bug in this adapter. planka | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated planka | in uniqueness errors, then just use an empty array for the `keys` property of this error.) planka | (Proceeding anyway as if these keys weren't included...) planka | planka | planka | Warning: Adapter sent back a uniqueness error, but that error references key(s) (card_id, user_id) which cannot planka | be matched up with the column names of any attributes in this model (`cardsubscription`). This probably planka | means there is a bug in this adapter. planka | (Note for adapter implementors: If your adapter doesn't support granular reporting of the keys violated planka | in uniqueness errors, then just use an empty array for the `keys` property of this error.) planka | (Proceeding anyway as if these keys weren't included...) planka | ``` I first set up Planka normally, then activated it using Authentik SSO. I also use Traefik. docker-compose.yml: ``` services: planka: image: ghcr.io/plankanban/planka:2.0.0-rc.3 container_name: planka restart: on-failure volumes: - favicons:/app/public/favicons - user-avatars:/app/public/user-avatars - background-images:/app/public/background-images - attachments:/app/private/attachments env_file: - .env environment: - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@planka-postgres/${POSTGRES_DB} depends_on: planka-postgres: condition: service_healthy networks: - backend - frontend labels: - "traefik.enable=true" # HTTPS Router - "traefik.http.routers.planka.rule=Host(`${PLANKA_DOMAIN}`)" - "traefik.http.routers.planka.entrypoints=${TRAEFIK_ENTRYPOINT}" - "traefik.http.routers.planka.tls.certresolver=${TRAEFIK_CERT_RESOLVER}" - "traefik.http.services.planka.loadbalancer.server.port=1337" # HTTP -> HTTPS Redirect - "traefik.http.routers.planka-insecure.rule=Host(`${PLANKA_DOMAIN}`)" - "traefik.http.routers.planka-insecure.entrypoints=web" - "traefik.http.routers.planka-insecure.middlewares=planka-https-redirect" - "traefik.http.middlewares.planka-https-redirect.redirectscheme.scheme=https" - "traefik.http.middlewares.planka-https-redirect.redirectscheme.permanent=true" planka-postgres: image: postgres:16-alpine container_name: planka-postgres restart: on-failure volumes: - db-data:/var/lib/postgresql/data env_file: - .env healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 10s timeout: 5s retries: 5 networks: - backend volumes: favicons: user-avatars: background-images: attachments: db-data: networks: frontend: external: true name: traefik_frontend backend: external: true name: traefik_backend ``` ### Desired behavior _No response_ ### Steps to reproduce Don't know ### Other information _No response_
Author
Owner

@meltyshev commented on GitHub (Oct 10, 2025):

Hi! Thanks for reporting this. After testing, I found that the patches don't apply when building a Docker image - I'll try to fix this now.

And don't worry about these warnings for now, this behavior is expected (except from the error showing up in the logs) - the Sails.js database adapter doesn't support enforcing uniqueness across multiple fields, which is why it warns every time (and exactly this should be disabled by the patch).

@meltyshev commented on GitHub (Oct 10, 2025): Hi! Thanks for reporting this. After testing, I found that the patches don't apply when building a Docker image - I'll try to fix this now. And don't worry about these warnings for now, this behavior is expected (except from the error showing up in the logs) - the Sails.js database adapter doesn't support enforcing uniqueness across multiple fields, which is why it warns every time (and exactly this should be disabled by the patch).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#834