# Not able to search user with pending invitation

**URL:** <https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170>\
**Category:** Elastic Search\
**Tags:** elastic-workplace-search\
**Created:** [May 27, 2021, 9:22am UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170 "2021-05-27T09:22:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prateek\_Yadav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prateek_yadav/32/76036_2.png) [@Prateek\_Yadav](https://discuss.elastic.co/u/Prateek_Yadav)\
**Post date:** [May 27, 2021, 9:22am UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170/1 "2021-05-27T09:22:57Z")

</div>

Hi,  
I'm on 7.12 self hosted version of Workplace Search and have realised that users who haven't accepted email invitation are not visible anymore on UI. This has happened after update to 7.12 I believe. Now, if I add them again it throws "An invitation already exists with username" which is correct, but there isn't a way for them to use this again. (Even email went to spam and have been deleted now)

Is there a way to delete user via API or something from backend?

---

<div class="post-metadata">

**Author:** ![ross.bell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ross.bell/32/77559_2.png) [@ross.bell](https://discuss.elastic.co/u/ross.bell)\
**Post date:** [May 27, 2021, 8:18pm UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170/2 "2021-05-27T20:18:47Z")

</div>

Hey @Prateek_Yadav,

Thanks for letting us know about this issue. I'm assuming you're running with [Standard](https://www.elastic.co/guide/en/workplace-search/current/workplace-search-security.html#standard) auth mode? I've tested this myself now and can confirm there is a bug where existing user invitations enter a broken state as a result of the 7.11-\>7.12 migration. Additionally, if the invited user clicks the link they were sent, the invite will not work if it was sent before the migration to 7.12 (more on that towards the bottom).

To make the invitations visible and working again, you can issue this update to your Elasticsearch cluster:

```auto
POST .ent-search-actastic-workplace_search_invitations/_update_by_query?refresh=true
{
  "script": {
    "source": "ctx._source.frito_pie_organization_id = \"000000000000000000000001\""
  },
  "query": {
    "bool": {
      "must_not": {
        "term": {
          "frito_pie_organization_id": "000000000000000000000001"
        }
      }
    }
  }
}

```

Now, if a user was invited pre-7.12 and then clicked the invite link after the migration to 7.12 without the above update, my testing shows that the invite will still not work even after correcting the data with the above update. Please let me know if you have users in this state and we should be able to figure out how to get them working again.

I'm going to file a bug report with the team and I expect this to be resolved without the need for a manual update in an upcoming release.

Thanks  
Ross

---

<div class="post-metadata">

**Author:** ![Prateek\_Yadav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prateek_yadav/32/76036_2.png) [@Prateek\_Yadav](https://discuss.elastic.co/u/Prateek_Yadav)\
**Post date:** [June 1, 2021, 12:06pm UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170/3 "2021-06-01T12:06:24Z")

</div>

Thanks @ross.bell for the update!!

Yes, I'm on standard auth mode. I have users who were invited pre 7.12 upgrade. I guess running this POST call won't help, right? Slightly confused on the statement below the update command.

Also, I missed to check this update on forum. I updated to 7.13 yesterday assuming this may get resolved 🙂

---

<div class="post-metadata">

**Author:** ![ross.bell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ross.bell/32/77559_2.png) [@ross.bell](https://discuss.elastic.co/u/ross.bell)\
**Post date:** [June 1, 2021, 4:42pm UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170/4 "2021-06-01T16:42:02Z")

</div>

Hey @Prateek_Yadav,

I don't expect the issue to be resolved in 7.13, although it's still a good idea to upgrade.

The POST call should help most users who were invited before the 7.12 upgrade. However, I suspect there may be an additional issue for any user who actually tried to _click_ on their pre-7.12 upgrade invite after the 7.12 upgrade occurred. Let me know if you have any users who are stuck in that state after issuing the POST call and I can look into a fix while you wait for a patch to get released.

Ross

---

<div class="post-metadata">

**Author:** ![Prateek\_Yadav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prateek_yadav/32/76036_2.png) [@Prateek\_Yadav](https://discuss.elastic.co/u/Prateek_Yadav)\
**Post date:** [June 4, 2021, 3:00pm UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170/5 "2021-06-04T15:00:09Z")

</div>

Hi @ross.bell ,

Updating to 7.13 didn't help. I'll confirm on behavior after running POST call.

Thanks,  
Prateek

---

<div class="post-metadata">

**Author:** ![Prateek\_Yadav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prateek_yadav/32/76036_2.png) [@Prateek\_Yadav](https://discuss.elastic.co/u/Prateek_Yadav)\
**Post date:** [June 14, 2021, 5:50am UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170/6 "2021-06-14T05:50:02Z")

</div>

Hi @ross.bell , after running the POST call, I'm able to see those users on UI who were send invitation before 7.12 upgrade but didn't accept the invite.

Thanks for sharing this.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 31, 2022, 2:48am UTC](https://discuss.elastic.co/t/not-able-to-search-user-with-pending-invitation/274170/7 "2022-10-31T02:48:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
