Problem/Motivation
I am seeing a lot of these errors in PostgreSQL logs - generally when running update.php, but also at other times (I haven't nailed down exactly what triggers it, but seems to be related to theme caching):
message: duplicate key value violates unique constraint "semaphore____pkey"
detail: Key (name)=(library_info:gin:Drupal\Core\Cache\CacheCollector) already exists
query: INSERT INTO "semaphore" ("name", "value", "expire") VALUES ('library_info:gin:Drupal\Core\Cache\CacheCollector', '682342772636186141f2d65.49789030', '1667335733.4565')
and:
message: duplicate key value violates unique constraint "key_value____pkey"
detail: Key (collection, name)=(state, system.theme.files) already exists.
query: INSERT INTO "key_value" ("name", "collection", "value") VALUES ('system.theme.files', 'state', '...')
I am not sure if this is specific to Gin, or if this is an upstream issue with Drupal core and PostgreSQL more generally. I will start this issue here, but move it to core if I can reproduce it with another theme (eg: Claro).
I did find two similar issues filed against Drupal 7 core. They may provide some clues, but they appear to be different in their origin:
- #1874966: ERROR: duplicate key value violates unique constraint "semaphore_pkey" - continous error on PostgreSQL
- #1907230: PostgreSQL - duplicate key value violates unique constraint “drupal_cache_block_pkey”
Steps to reproduce
TBD
Proposed resolution
TBD
Remaining tasks
TBD
User interface changes
None.
API changes
None.
Data model changes
None.