# Multiple error 500 Discourse InvalidAccess in default\_current\_user\_provider.rb

**URL:** https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498
**Category:** Support
**Created:** [2017年十月20日 20:23 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498 "2017-10-20T20:23:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Julian\_Somoza](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Julian\_Somoza](https://meta.discourse.org/u/Julian_Somoza)
#### Post date: [2017年十月20日 20:23 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498/1 "2017-10-20T20:23:56Z")

</div>

Hi!

I start to have a lot of 500 errors (Discourse InvalidAccess) in my installation and try upgrading, downgrading, backuping, etc… The only way to solve the problem was editing the file /var/www/discourse/lib/auth/default\_current\_user\_provider.rb. Modifying the line

` limiter = RateLimiter.new(nil, "cookie_auth_#{request.ip}", COOKIE_ATTEMPTS_PER_MIN ,60)`

By

` limiter = RateLimiter.new(nil, "cookie_auth_#{request.ip}", COOKIE_ATTEMPTS_PER_MIN ,0)`

Anybody know what to do this line?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年十月21日 20:34 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498/4 "2017-10-21T20:34:03Z")

</div>

Any thoughts on this @sam? This is an older version.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2017年十月21日 22:53 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498/5 "2017-10-21T22:53:30Z")

</div>

could be a bug in an early version, but disabling the rate limiter is not a good idea, it is there to protect against attacks.

My guess, IP is not being reported correctly to Discourse cause the site is behind a load balancer and every request looks like it is from the same ip.

---

<div class="post-metadata">

### Author: ![Julian\_Somoza](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Julian\_Somoza](https://meta.discourse.org/u/Julian_Somoza)
#### Post date: [2017年十月23日 19:35 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498/6 "2017-10-23T19:35:16Z")

</div>

Thank you so much for the replies. I will check if the IP’s is not arriving correctly and then I will re-enable the recurrent protection.

---

<div class="post-metadata">

### Author: ![Julian\_Somoza](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Julian\_Somoza](https://meta.discourse.org/u/Julian_Somoza)
#### Post date: [2017年十一月3日 17:30 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498/7 "2017-11-03T17:30:01Z")

</div>

> [@sam](#):
>
> My guess, IP is not being reported correctly to Discourse cause the site is behind a load balancer and every request looks like it is from the same ip.

You’re right… All the ips are 127.0.0.1 because all my visitors are internals users… The app is working as institutional intranet… I dont find the way to pass the real IP’s to discourse… In the nginx logs the IP’s seems fine.

---

<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: [2019年十二月21日 08:42 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498/8 "2019-12-21T08:42:50Z")

</div>



---

<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: [2020年一月20日 08:42 UTC](https://meta.discourse.org/t/multiple-error-500-discourse-invalidaccess-in-default-current-user-provider-rb/72498/9 "2020-01-20T08:42:59Z")

</div>

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