# Can't sign up with email domain that is automatically matched to group

**URL:** <https://meta.discourse.org/t/cant-sign-up-with-email-domain-that-is-automatically-matched-to-group/54554>\
**Category:** Bug\
**Created:** [12월 20, 2016, 1:46오후 UTC](https://meta.discourse.org/t/cant-sign-up-with-email-domain-that-is-automatically-matched-to-group/54554 "2016-12-20T13:46:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [12월 21, 2016, 2:27오전 UTC](https://meta.discourse.org/t/cant-sign-up-with-email-domain-that-is-automatically-matched-to-group/54554/3 "2016-12-21T02:27:06Z")

</div>

Hmm when I test it I see an error on the server with stack like this:

```plaintext
ActiveRecord::AssociationTypeMismatch - User(#70301387222720) expected, got User(#70301532555640):
  activerecord (4.2.7.1) lib/active_record/associations/association.rb:218:in `raise_on_type_mismatch!'

  ... snip ...

  activerecord (4.2.7.1) lib/active_record/persistence.rb:50:in `create!'
  app/services/group_action_logger.rb:28:in `log_add_user_to_group'
  app/models/user.rb:934:in `block in automatic_group_membership'
  activerecord (4.2.7.1) lib/active_record/relation/delegation.rb:46:in `each'
  app/models/user.rb:930:in `automatic_group_membership'

```

Something broke recently, maybe related to the new group features? I can look more tomorrow.

---

_[View the full topic](https://meta.discourse.org/t/cant-sign-up-with-email-domain-that-is-automatically-matched-to-group/54554)._
