# Random 500 when authenticating in production

**URL:** <https://community.forestadmin.com/t/random-500-when-authenticating-in-production/5107>\
**Category:** Help me!\
**Created:** [August 18, 2022, 12:48pm UTC](https://community.forestadmin.com/t/random-500-when-authenticating-in-production/5107 "2022-08-18T12:48:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AugustinBarbe](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/augustinbarbe/32/4909_2.png) [@AugustinBarbe](https://community.forestadmin.com/u/AugustinBarbe)\
**Post date:** [August 18, 2022, 12:48pm UTC](https://community.forestadmin.com/t/random-500-when-authenticating-in-production/5107/1 "2022-08-18T12:48:04Z")

</div>

Hello !  
During the authentication phase on the forestAdmin interface, the authentication sometimes randomly fails. Looking at the network activity of the browser, it appears that the callback request made to our server returns a 500 with the following response :

`{"status":500,"detail":"invalid_client :: The provided client id does not match the id received at first place.} `

Clearing the cache does not seem to fix the issue

The oddity of this behaviour comes from the fact that it happens randomly : after repeating several times the authentication, we can finally access our production environment.  
Moreover, we also have a develop and staging environment for which we encounter no errors at all for authenticating.

Some more information regarding our environment

- Project name: `Folde`
- Team name: `Operations`
- Environment name: `Production`
- Agent type & version: Rails, gem: forest\_liana 7.4.5

Regards,

---

<div class="post-metadata">

**Author:** ![Alban\_Bertolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/alban_bertolini/32/1077_2.png) [@Alban\_Bertolini](https://community.forestadmin.com/u/Alban_Bertolini)\
**Post date:** [August 18, 2022, 1:02pm UTC](https://community.forestadmin.com/t/random-500-when-authenticating-in-production/5107/2 "2022-08-18T13:02:55Z")

</div>

Hello @AugustinBarbe,  
We have a [documentation](https://docs.forestadmin.com/documentation/how-tos/setup/running-forest-admin-on-multiple-servers) or [this one](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-rails/upgrade-to-v6#setup-a-static-clientid) about this behavior. Maybe you are in this case.  
Tell me if this link helps you 🤞  
Have a nice day with FA.

---

<div class="post-metadata">

**Author:** ![AugustinBarbe](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/augustinbarbe/32/4909_2.png) [@AugustinBarbe](https://community.forestadmin.com/u/AugustinBarbe)\
**Post date:** [August 18, 2022, 1:38pm UTC](https://community.forestadmin.com/t/random-500-when-authenticating-in-production/5107/4 "2022-08-18T13:38:13Z")

</div>

Hey @Alban_Bertolini  
Indeed it is my case, our production runs on multiple instances contrary to our other environments… I should have gone deeper in the documentation ! My bad, and thanks a lot for the help

---

<div class="post-metadata">

**Author:** ![Alban\_Bertolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/alban_bertolini/32/1077_2.png) [@Alban\_Bertolini](https://community.forestadmin.com/u/Alban_Bertolini)\
**Post date:** [August 18, 2022, 1:41pm UTC](https://community.forestadmin.com/t/random-500-when-authenticating-in-production/5107/5 "2022-08-18T13:41:39Z")

</div>

I’m glad it helps. I hope it will fix your problem. 🤞
