# 现有会员无法通过 Facebook 登录

**URL:** <https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843>\
**Category:** Support\
**Created:** [2018年九月22日 16:27 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843 "2018-09-22T16:27:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [2018年九月22日 16:27 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/1 "2018-09-22T16:27:55Z")

</div>

Hi,

Reportedly, this is an error message.

# Oops

The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.

Detailed information about the error was logged, and an automatic notification generated. We’ll take a look at it.

No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site’s feedback category.

* * *

What I am aware?

- **I recently changed FB App I’d.**
- For me, sign up and login via FB Is working.
- I also used to some SSH command as suggested.

What I want to know?

- What above message indicate?

Thanks in advanced!  
Sincerely,  
Gulshan

---

<div class="post-metadata">

**Author:** ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)\
**Post date:** [2018年九月22日 16:40 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/2 "2018-09-22T16:40:30Z")

</div>

Try visiting `<your-site>/logs` to see what the error is, and report back with that info, which will hopefully provide some more info for those that could help you.

---

<div class="post-metadata">

**Author:** ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)\
**Post date:** [2018年九月22日 16:50 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/3 "2018-09-22T16:50:24Z")

</div>

If you changed your ID you may need to remove existing information

> [@Configure Facebook login for Discourse](https://meta.discourse.org/t/configure-facebook-login-for-discourse/13394/1):
>
> ## Troubleshooting
> 
> If the Facebook app API is updated, or the app ID/secret are change, you’ll need to remove existing `FacebookUserInfo` from your site before users can log in again. To remove this data, run the following:

You can read the full topic here:

> [@Configure Facebook login for Discourse](https://meta.discourse.org/t/configuring-facebook-login-for-discourse/13394):
>
> exclamation As of February 2023, Meta has implemented a business verification requirement when publishing new and existing apps. warning Updating the Facebook app API or creating a new app will break existing logins. See troubleshooting at the bottom of this post for a solution. Configuration Go to [developers.facebook.com/apps](https://developers.facebook.com/apps) and … Login with the credentials of the account you want to connect to Discourse and follow the wizard. If you already have other apps instead of Get Started …

---

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [2018年九月22日 16:55 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/4 "2018-09-22T16:55:23Z")

</div>

I have already run this command just after changing. Do I need to rebuild now?

```plaintext
cd /var/discourse
./launcher enter app
rails c
FacebookUserInfo.delete_all

```

---

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [2018年九月22日 16:59 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/5 "2018-09-22T16:59:57Z")

</div>

> [@gdpelican](#):
>
> Try visiting `<your-site>/logs` to see what the error is

Yes, there is an error message

```plaintext
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 5:55 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 5:55 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 8:44 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 8:44 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 8:44 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 8:44 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 8:46 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 8:46 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 8:49 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 8:49 pm
(facebook) Authentication failure! invalid_credentials: OAuth2::Error, {"message"=&gt;"This authorization code has been used.", "type"=&gt;"OAuthException", "code"=&gt;100, "fbtrace_id"=&gt;"Elt2/DBijKq"}: {"err 8:49 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 8:49 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 8:49 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 8:50 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 8:50 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 8:51 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 8:51 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(250) already exists. : INSERT 9:23 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(250) 9:23 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(250) already exists. : INSERT 9:23 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(250) 9:23 pm
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) already exists. : INSERT I 10:14 pm
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_facebook_user_infos_on_user_id" DETAIL: Key (user_id)=(27) 10:14 pm

```

Please tell me, what should I do to resolve?

Thanks

---

<div class="post-metadata">

**Author:** ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)\
**Post date:** [2018年九月22日 17:01 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/6 "2018-09-22T17:01:57Z")

</div>

If you can still log in then did it work? Were you required to re-authenticate?

---

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [2018年九月22日 17:03 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/7 "2018-09-22T17:03:23Z")

</div>

This problem is happening for old member who uses FB for sign in to forum since day 1.

As a first time user, I am able to signup/login with new FB acc in the incognito.

---

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [2018年九月22日 17:05 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/8 "2018-09-22T17:05:40Z")

</div>

> [@robmc](#):
>
> Were you required to re-authenticate?

Learned, it ask for re-auth after above message comes.

---

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [2018年九月22日 17:10 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/9 "2018-09-22T17:10:11Z")

</div>

I would like to give one more detail that, before it was working fine.  
Somehow my FB app got deleted from my account, so I created again and followed official tutorial for the integration.

---

<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:** [2018年九月23日 11:58 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/10 "2018-09-23T11:58:32Z")

</div>

Did you do that delete all command above? If so, I’m not sure what to think. You might try it again.

---

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [2018年九月23日 12:22 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/11 "2018-09-23T12:22:09Z")

</div>

Thanks, I have tried it again.

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

---

<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:** [2018年十月23日 12:34 UTC](https://meta.discourse.org/t/exisiting-member-unable-to-login-via-facebook/97843/12 "2018-10-23T12:34:29Z")

</div>

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