# Error sending messages to groups

**URL:** https://meta.discourse.org/t/error-sending-messages-to-groups/152999
**Category:** Bug
**Created:** [May 27, 2020, 5:41pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999 "2020-05-27T17:41:32Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![GuidoD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidod/32/292621_2.png) [@GuidoD](https://meta.discourse.org/u/GuidoD)
#### Post date: [May 27, 2020, 5:41pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/1 "2020-05-27T17:41:32Z")

</div>

sending a new message to a group ends up in an error message:

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/6/d/6d2e5bed7f5f30617b06fec345ffaa6722715efe.png)  
(One of the recipients of this message could not be found)

Sending the message to the group “admins” (I am one of the admins) does work.

We are on 2.5.0.beta5 ( [7bc496070f](https://github.com/discourse/discourse/commits/7bc496070f744a411f6b8efd111c096d485617a4) )

Update:  
I just did a test, all group names that include a capital letter (and almost all our groups do have capital letters in the group names) do not work any longer as message recipients.  
So “Testuser” is no longer working, but after renaming the group to “testuser” is worked.  
Renaming it back to “Testuser” does again show the error.  
So something is wrong in the current releases with the sending to group names with capital letters.

The error logs does show as latest error for several times the below error but I am unsure if that error does belong to the problem above (probably that error is a different problem).

```plaintext
Message (39 copies reported)

Job exception: ERROR: syntax error at or near "WHERE"
LINE 1: ...E groups SET flair_url = NULL, flair_upload_id = WHERE id =...
                                                             ^

Backtrace

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:110:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:110:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mini_sql-0.2.5/lib/mini_sql/postgres/connection.rb:135:in `run'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mini_sql-0.2.5/lib/mini_sql/postgres/connection.rb:107:in `exec'
/var/www/discourse/app/jobs/onceoff/migrate_group_flair_images.rb:80:in `block in execute_onceoff'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3/lib/active_record/relation/delegation.rb:87:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3/lib/active_record/relation/delegation.rb:87:in `each'
/var/www/discourse/app/jobs/onceoff/migrate_group_flair_images.rb:18:in `execute_onceoff'
/var/www/discourse/app/jobs/onceoff/onceoff.rb:25:in `execute'
/var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'

```

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 27, 2020, 6:01pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/2 "2020-05-27T18:01:16Z")

</div>

If you’re sure that permissions to message the group have been set correctly can you check the group name presented in /g/ versus the group name in the message?

There have been a couple of places where case sensitivity has caused this error.

[https://meta.discourse.org/t/case-sensitivity-in-links-to-groupname/147596/8](https://meta.discourse.org/t/case-sensitivity-in-links-to-groupname/147596/8)

---

<div class="post-metadata">

### Author: ![GuidoD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidod/32/292621_2.png) [@GuidoD](https://meta.discourse.org/u/GuidoD)
#### Post date: [May 27, 2020, 6:19pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/3 "2020-05-27T18:19:14Z")

</div>

well to these groups were sent a lot of messages every day and in beta4 it still worked fine.  
The permissions are unchanged, group members and admins can sent to that group and I am a member of that group and also of the admin group.  
This morning I did the upgrade to beta5 and since then the problem started.

The group name in the message is the same like in the group, i.e “Team\_CM\_MP-Mod”

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 27, 2020, 6:29pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/4 "2020-05-27T18:29:24Z")

</div>

> [@GuidoD](#):
>
> The group name in the message is the same like in the group, i.e “Team\_CM\_MP-Mod”

Is that the group `name`, the group `full name`, or both?

---

<div class="post-metadata">

### Author: ![GuidoD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidod/32/292621_2.png) [@GuidoD](https://meta.discourse.org/u/GuidoD)
#### Post date: [May 27, 2020, 6:33pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/5 "2020-05-27T18:33:35Z")

</div>

this if the group name not the full name.  
I just did a test, all group names that include a capital letter (and almost all our groups do have capital letters in the group names) do not work any longer as message recipients.  
So “Testuser” is no longer working, but after renaming the group to “testuser” is worked.  
Renaming it back to “Testuser” does again show the error.  
So something is wrong in the current releases with the sending to group names with capital letters.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 27, 2020, 7:17pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/6 "2020-05-27T19:17:26Z")

</div>

Ok, so that confirms what I was referring to above. It looks to relate to this commit:

[https://github.com/discourse/discourse/commit/e8fb9d406667c758cba0f7b1cc779e1ceb352c4c](https://github.com/discourse/discourse/commit/e8fb9d406667c758cba0f7b1cc779e1ceb352c4c)

Paging @techAPJ!

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [May 27, 2020, 8:56pm UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/8 "2020-05-27T20:56:45Z")

</div>

Thanks for reporting this!

This commit should fix the issue:

[https://github.com/discourse/discourse/commit/6548cd1a969746b37f505c37a1ba5ff8dd4e774a](https://github.com/discourse/discourse/commit/6548cd1a969746b37f505c37a1ba5ff8dd4e774a)

---

<div class="post-metadata">

### Author: ![GuidoD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidod/32/292621_2.png) [@GuidoD](https://meta.discourse.org/u/GuidoD)
#### Post date: [May 28, 2020, 5:51am UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/9 "2020-05-28T05:51:35Z")

</div>

just installed the latest Discourse version, works fine now.  
Thanks for the fix.

---

<div class="post-metadata">

### Author: ![olegbc1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/olegbc1/32/154008_2.png) [@olegbc1](https://meta.discourse.org/u/olegbc1)
#### Post date: [May 28, 2020, 5:59am UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/10 "2020-05-28T05:59:27Z")

</div>

We’re experiencing the same issue. Should we just update discourse to the latest beta?

For posterity, the message we get in english is “One of the users you are sending this message to could not be found.”

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/3/933d0947b03784a4288b46dbe4c0aa783a7627d2.png)

---

<div class="post-metadata">

### Author: ![GuidoD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidod/32/292621_2.png) [@GuidoD](https://meta.discourse.org/u/GuidoD)
#### Post date: [May 28, 2020, 6:01am UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/11 "2020-05-28T06:01:14Z")

</div>

well at least for our installation the update on the latest beta version a few hours ago did now fix it so I would assume that it would also fix your problem.

---

<div class="post-metadata">

### Author: ![olegbc1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/olegbc1/32/154008_2.png) [@olegbc1](https://meta.discourse.org/u/olegbc1)
#### Post date: [May 28, 2020, 6:03am UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/12 "2020-05-28T06:03:12Z")

</div>

Thanks! The reason I ask is because we’ve updated the forum this morning (12 hours ago or so) and this is when the issue started occuring. The linked fix on git hub was comitted 3 days ago, so we should have the latest version it seems… Could you do me a favor and check what version you’re currently running?

---

<div class="post-metadata">

### Author: ![GuidoD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidod/32/292621_2.png) [@GuidoD](https://meta.discourse.org/u/GuidoD)
#### Post date: [May 28, 2020, 6:06am UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/13 "2020-05-28T06:06:30Z")

</div>

I did our update 2,5 hours ago and the fix was committed only 9 hours ago (I just checked it on github)  
I am running 2.5.0.beta5 subversion [c8370b9c78](https://github.com/discourse/discourse/commits/c8370b9c78df1161aa3db2699bbd53c3e04b9925)

---

<div class="post-metadata">

### Author: ![olegbc1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/olegbc1/32/154008_2.png) [@olegbc1](https://meta.discourse.org/u/olegbc1)
#### Post date: [May 28, 2020, 6:07am UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/14 "2020-05-28T06:07:36Z")

</div>

You’re right - thanks!

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [May 29, 2020, 12:00am UTC](https://meta.discourse.org/t/error-sending-messages-to-groups/152999/15 "2020-05-29T00:00:03Z")

</div>

This topic was automatically closed after 26 hours. New replies are no longer allowed.
