# Dubbele sleutel-fout voor gamification\_leaderboard\_cache

**URL:** https://meta.discourse.org/t/duplicate-key-error-for-gamification-leaderboard-cache/305031
**Category:** Self-hosting
**Tags:** gamification
**Created:** [29 februari 2024 om 12:50 UTC](https://meta.discourse.org/t/duplicate-key-error-for-gamification-leaderboard-cache/305031 "2024-02-29T12:50:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [29 februari 2024 om 12:50 UTC](https://meta.discourse.org/t/duplicate-key-error-for-gamification-leaderboard-cache/305031/1 "2024-02-29T12:50:14Z")

</div>

Running the latest version of discourse (3.3.0.beta1-dev), I installed this plugin and I see this error in the logs

```plaintext
Message (3 copies reported)

Job exception: ERROR: duplicate key value violates unique constraint "pg_type_typname_nsp_index"
DETAIL: Key (typname, typnamespace)=(gamification_leaderboard_cache_1_all_time_1, 2200) already exists.

Backtrace

/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rack-mini-profiler-3.3.1/lib/patches/db/pg.rb:110:in `exec'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rack-mini-profiler-3.3.1/lib/patches/db/pg.rb:110:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_sql-1.5.0/lib/mini_sql/postgres/connection.rb:202:in `run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `block in with_lock'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `with_lock'

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [23 april 2024 om 08:44 UTC](https://meta.discourse.org/t/duplicate-key-error-for-gamification-leaderboard-cache/305031/2 "2024-04-23T08:44:08Z")

</div>

Did you manage to resolve this in the end?

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [23 april 2024 om 19:27 UTC](https://meta.discourse.org/t/duplicate-key-error-for-gamification-leaderboard-cache/305031/3 "2024-04-23T19:27:42Z")

</div>

No, I have no idea how to debug or resolve it. Just left it alone for now. If you’d like me to try something let me know.
