# Granting a newly created badge with no default badge group causes errors

**URL:** https://meta.discourse.org/t/granting-a-newly-created-badge-with-no-default-badge-group-causes-errors/60346
**Category:** Bug
**Created:** [2017年四月3日 05:06 UTC](https://meta.discourse.org/t/granting-a-newly-created-badge-with-no-default-badge-group-causes-errors/60346 "2017-04-03T05:06:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [2017年四月3日 05:06 UTC](https://meta.discourse.org/t/granting-a-newly-created-badge-with-no-default-badge-group-causes-errors/60346/1 "2017-04-03T05:06:58Z")

</div>

![](https://global.discourse-cdn.com/meta/original/3X/0/b/0bf038e12fa1e70da23e3fd36f07ca71fb4c1f8b.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年四月3日 05:19 UTC](https://meta.discourse.org/t/granting-a-newly-created-badge-with-no-default-badge-group-causes-errors/60346/2 "2017-04-03T05:19:05Z")

</div>

No repro here or on meta.

---

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [2017年四月3日 05:58 UTC](https://meta.discourse.org/t/granting-a-newly-created-badge-with-no-default-badge-group-causes-errors/60346/3 "2017-04-03T05:58:46Z")

</div>

> [@codinghorror](#):
>
> No repro here or on meta.

Actually, not quite true – I found this topic after some digging and it resolved it for me:

[https://meta.discourse.org/t/user-badges-500-internal-server-error/22459/8](https://meta.discourse.org/t/user-badges-500-internal-server-error/22459/8)

Pretty much, there should be a **default** group for every new badge created – if not, user’s badge page will crash if he has a badge that has no group. Since there was no warning or default, I didn’t think much of it about assigning it a group.

Similar to a .NET form where you have radio buttons - always have 1 checked by default or bad things happen.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年四月3日 06:12 UTC](https://meta.discourse.org/t/granting-a-newly-created-badge-with-no-default-badge-group-causes-errors/60346/4 "2017-04-03T06:12:06Z")

</div>

So this is for a new badge you created?

---

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [2017年四月3日 06:15 UTC](https://meta.discourse.org/t/granting-a-newly-created-badge-with-no-default-badge-group-causes-errors/60346/5 "2017-04-03T06:15:11Z")

</div>

> [@codinghorror](#):
>
> So this is for a new badge you created?

Correct. Consolidating old topic:

> [@Granting badge via admin gives false positive err](https://meta.discourse.org/t/granting-badge-via-admin-gives-false-positive-err/60345/4):
>
> They should be at [yourdomain.com/logs](http://yourdomain.com/logs).
> 
> See this topic for all the details.

I have a feeling it has to do with this – by resolving this issue below, I bet I resolved this one, too:

> [@Granting a newly created badge with no default badge group causes errors](https://meta.discourse.org/t/user-badges-page-results-in-error-in-1-8-0-beta9-20/60346/2):
>
> No repro here or on meta.

I granted a badge that had no badge group. Since there’s no default group for badges and no warning you HAVE to have one or it’ll crash a user’s badge (if assigned), this causes both the error in this thread and the one linked above.

I recommend adding a default group for all badges that just sort of hovers to prevent this (better than warning - people dont read warnings, ehehe)
