tuxis-ie / nsedit

DNS Editor working with PowerDNS's new API
GNU General Public License v2.0
199 stars 55 forks source link

"An error occured while communicating to the server." (again) #134

Closed hoalex closed 7 years ago

hoalex commented 7 years ago

When trying to login, I immediately get "An error occured while communicating to the server.". I know that there were already similar issues, but after reading them I'm still not sure what causes the error.

This happens for me on a fresh install (pulled today from git-master). My system:

When loggin in with admin/admin, the site loads and immediately shows the following error message: Screenshot

Looking at the Firefox debug console, I can see that there are two HTTP POST requests to zones.php which fail: Screenshot 2

I am not sure whether the error message is specifically caused by the 403, just a wild guess. PHP-FPM and nginx logs show no errors.

Regards Alex

tuxis-ie commented 7 years ago

This is almost definite a php issue. What do you mean with "again"?

hoalex commented 7 years ago

"Again" because of the previous issues here on Github that had the same error ;-)

Any advice on how I can begin troubleshooting the issue? If I disable the CSRF check in lines 9-13 in zones.php, the site loads just fine. I guess somehow the CSRF token is not correctly interpreted (note that the Firefox console shows that a "X-CSRF-Token" is transmitted during the POST request).

tuxis-ie commented 7 years ago

Probably has something to do with the function on line 377 of misc.php?

hoalex commented 7 years ago

I created a new file and ensured that the hash_pbkdf2() function works (it does). I also tried commenting out the function you mentioned, but the error still persists. :-(

Looking deeper, I found out that $found_token is always null in the _check_csrf_token() function (found in includes/session.inc.php). $csrf_token has the correct value, i.e. the one also sent by the browser...

tuxis-ie commented 7 years ago

Then it's probably an issue with php-fpm and Nginx where you are loosing $_SERVER[] stuff..