[GH-ISSUE #134] "An error occured while communicating to the server." (again) #82

Closed
opened 2026-02-28 01:20:54 +03:00 by kerem · 5 comments
Owner

Originally created by @hoalex on GitHub (Nov 9, 2016).
Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/134

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:

  • Debian Jessie 8.6
  • PHP 5.6.27-0+deb8u1
  • php5-sqlite 5.6.27+dfsg-0+deb8u1
  • php5-curl 5.6.27+dfsg-0+deb8u1
  • nginx 1.6.2

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

Originally created by @hoalex on GitHub (Nov 9, 2016). Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/134 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: - Debian Jessie 8.6 - PHP 5.6.27-0+deb8u1 - php5-sqlite 5.6.27+dfsg-0+deb8u1 - php5-curl 5.6.27+dfsg-0+deb8u1 - nginx 1.6.2 When loggin in with admin/admin, the site loads and immediately shows the following error message: ![Screenshot](https://i.imgur.com/ijd5eTi.png) Looking at the Firefox debug console, I can see that there are two HTTP POST requests to ``zones.php`` which fail: ![Screenshot 2](https://i.imgur.com/2XXLvFa.png) 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
kerem closed this issue 2026-02-28 01:20:54 +03:00
Author
Owner

@tuxis-ie commented on GitHub (Nov 9, 2016):

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

<!-- gh-comment-id:259462106 --> @tuxis-ie commented on GitHub (Nov 9, 2016): This is almost definite a php issue. What do you mean with "again"?
Author
Owner

@hoalex commented on GitHub (Nov 9, 2016):

"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).

<!-- gh-comment-id:259467581 --> @hoalex commented on GitHub (Nov 9, 2016): "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).
Author
Owner

@tuxis-ie commented on GitHub (Nov 9, 2016):

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

<!-- gh-comment-id:259468891 --> @tuxis-ie commented on GitHub (Nov 9, 2016): Probably has something to do with the function on line 377 of misc.php?
Author
Owner

@hoalex commented on GitHub (Nov 9, 2016):

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...

<!-- gh-comment-id:259495184 --> @hoalex commented on GitHub (Nov 9, 2016): 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...
Author
Owner

@tuxis-ie commented on GitHub (Nov 10, 2016):

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

<!-- gh-comment-id:259664131 --> @tuxis-ie commented on GitHub (Nov 10, 2016): Then it's probably an issue with php-fpm and Nginx where you are loosing $_SERVER[] stuff..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsedit#82
No description provided.