# Error deleting badge

**URL:** https://meta.discourse.org/t/error-deleting-badge/151512
**Category:** Support
**Created:** [May 14, 2020, 4:50pm UTC](https://meta.discourse.org/t/error-deleting-badge/151512 "2020-05-14T16:50:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 14, 2020, 4:50pm UTC](https://meta.discourse.org/t/error-deleting-badge/151512/1 "2020-05-14T16:50:17Z")

</div>

I guess this is another corrupt index issue? The only non-standard plugin is `https://github.com/gdpelican/retort.git`.

```plaintext
Started DELETE "/admin/badges/118" for 107.77.237.138 at 2020-05-14 16:41:57 +0000
Processing by Admin::BadgesController#destroy as */*
  Parameters: {"id"=>"118"}
  Rendering categories/index.html.erb within layouts/application
  Rendered categories/index.html.erb within layouts/application (Duration: 1.8ms | Allocations: 883)
  Rendered layouts/_head.html.erb (Duration: 1.2ms | Allocations: 220)
  Rendered common/_discourse_stylesheet.html.erb (Duration: 1.3ms | Allocations: 431)
  Rendered application/_header.html.erb (Duration: 0.2ms | Allocations: 63)
Completed 200 OK in 307ms (Views: 17.9ms | ActiveRecord: 0.0ms | Allocations: 69013)
  Rendering topics/show.html.erb within layouts/application
  Rendered topics/show.html.erb within layouts/application (Duration: 2.9ms | Allocations: 1052)
  Rendered layouts/_head.html.erb (Duration: 1.6ms | Allocations: 238)
  Rendered common/_discourse_stylesheet.html.erb (Duration: 2.4ms | Allocations: 474)
  Rendered application/_header.html.erb (Duration: 0.1ms | Allocations: 57)
Completed 200 OK in 465ms (Views: 84.4ms | ActiveRecord: 0.0ms | Allocations: 89326)
Started GET "/manifest.webmanifest" for 209.23.49.27 at 2020-05-14 16:41:57 +0000
Processing by MetadataController#manifest as */*
Completed 200 OK in 7ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 1733)
Completed 500 Internal Server Error in 297ms (ActiveRecord: 0.0ms | Allocations: 16403)
ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR: update or delete on table "badges" violates foreign key constrai
nt "fk_rails_38ea484ed4" on table "user_profiles"
DETAIL: Key (id)=(118) is still referenced from table "user_profiles".

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 25, 2024, 1:28pm UTC](https://meta.discourse.org/t/error-deleting-badge/151512/2 "2024-07-25T13:28:43Z")

</div>


