whosonfirst / whosonfirst-www-boundaryissues

Boundary Issues is a web-application for editing Who's On First data.
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Sporatic "Missing or invalid crumb" errors #338

Closed dphiffer closed 7 years ago

dphiffer commented 7 years ago

Seemingly resolves itself after reloading the page, but wtf?

thisisaaronland commented 7 years ago

I can confirm I've been seeing these too.

dphiffer commented 7 years ago

Ran sudo ntpdate time.nist.gov on the server, in case it's a time drift issue.

dphiffer commented 7 years ago

Continued issues leads me to believe the cause was not time drift.

dphiffer commented 7 years ago

I tracked this down. The cause was that $GLOBALS['_SERVER']['REMOTE_ADDR'] contained the IP address of the ELB instead of the client IP.

thisisaaronland commented 7 years ago

Yeah, you don't want to use that. You should use the remote_addr function:

https://github.com/whosonfirst/whosonfirst-www-boundaryissues/blob/master/www/include/init.php#L113-L122

dphiffer commented 7 years ago

Hmm that gives me back 192.168.18.245 on dev. I wonder if we need to tinker with how the headers are set upstream?

thisisaaronland commented 7 years ago

It's possible we're passing a different header. I would start with the proxy configs.

dphiffer commented 7 years ago

Pretty sure this is fixed now.