Too many redirects error
-
Since the last update many of my users, including some of my staff, keep getting a Too Many Redirects screen where it says to erase their cookies. The problem is that after a while some users see this screen again and again.
The page I need help with: [log in to see the link]
-
I already rollback the plugin to the version 5.1.8 and the problem just desapear
Hi @novelasligeras,
Can you please provide more details? Do all pages gets redirect or particular login / register ? Recent change have if login event logged and custom login page might have that issue.
If you search WP_DEBUG in wp-config.php file you may find with false it is there you need to make it true. It is generally always in wp-config.php
And if it shows critical error after login there must be some error logged in. It is general,
As this is not the general case that after login user gets critical error. we must have the what error is to check and solve the problem.
it seems the when successful login event getting added in event log the serialised stack trace creating issue.
As an temporary solution can you please comment line line 464 using double slash of below file ? as there is new version of file get changed it might be back.
/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-audit-events.php
the code commented will be like like this double slash added
//do_action('aiowps_record_event', 'successful_login', $details, 'info', $username);
I don’t know if all the pages get redirects but the login page does and also the home page, that last one was the one that scared me and made me do the rollback to the previous version, because several of my users were complaining.
Also I want to give you more info but what do you need? If you tell me I can give it to you.
In the case of the temporary solution, well I already made the roolback so that it’s not necesary.
There is no particular functionality in AIOS related to redirect and there is no such reported issue up till. It seems the .htaccess and url with index.php/ or cache might be the issue with recent update where aios-bootstrap.php being loaded and firewall rules gets applied.
Do you see any error in error log ?
# Begin AIOWPSEC Firewall <IfModule mod_php5.c> php_value auto_prepend_file '/www/aios-bootstrap.php' </IfModule> <IfModule mod_php7.c> php_value auto_prepend_file '/www/aios-bootstrap.php' </IfModule> <IfModule mod_php.c> php_value auto_prepend_file '/www/aios-bootstrap.php' </IfModule> # End AIOWPSEC Firewall
Do the .htaccess file is proper? Please remove above code once and cross check if that is the making issue.
Just check the error_log file and I find several of these errors:
[15-May-2023 05:24:59 UTC] AIOS firewall error: Unable to determine the current context. [15-May-2023 05:25:01 UTC] AIOS firewall error: Unable to determine the current context. [15-May-2023 05:25:02 UTC] PHP Fatal error: Uncaught Exception: Unable to determine the current context. in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php:42 Stack trace: #0 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(60): AIOWPS\Firewall\Context::current() #1 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(51): AIOWPS\Firewall\Context::plugins_loaded() #2 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-utility.php(31): AIOWPS\Firewall\Context::wordpress_safe() #3 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-helper.php(144): AIOWPS\Firewall\Utility::get_root_dir() #4 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/ in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php on line 42 [15-May-2023 05:25:02 UTC] AIOS firewall error: Unable to determine the current context. [15-May-2023 05:25:06 UTC] AIOS firewall error: Unable to determine the current context. [15-May-2023 05:25:07 UTC] PHP Fatal error: Uncaught Exception: Unable to determine the current context. in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php:42 Stack trace: #0 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(60): AIOWPS\Firewall\Context::current() #1 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(51): AIOWPS\Firewall\Context::plugins_loaded() #2 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-utility.php(31): AIOWPS\Firewall\Context::wordpress_safe() #3 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-helper.php(144): AIOWPS\Firewall\Utility::get_root_dir() #4 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/ in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php on line 42 [15-May-2023 05:25:07 UTC] AIOS firewall error: Unable to determine the current context. [15-May-2023 05:25:10 UTC] AIOS firewall error: Unable to determine the current context. [15-May-2023 05:25:11 UTC] PHP Fatal error: Uncaught Exception: Unable to determine the current context. in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php:42 Stack trace: #0 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(60): AIOWPS\Firewall\Context::current() #1 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(51): AIOWPS\Firewall\Context::plugins_loaded() #2 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-utility.php(31): AIOWPS\Firewall\Context::wordpress_safe() #3 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-helper.php(144): AIOWPS\Firewall\Utility::get_root_dir() #4 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/ in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php on line 42 [15-May-2023 05:25:12 UTC] AIOS firewall error: Unable to determine the current context. [15-May-2023 05:27:34 UTC] $existing_user_verified: 1 [15-May-2023 05:27:35 UTC] $existing_user_verified: 1
There are 18 of these errors, here is another one from another date:
[23-May-2023 05:24:06 UTC] AIOS firewall error: Unable to determine the current context. [23-May-2023 05:24:08 UTC] AIOS firewall error: Unable to determine the current context. [23-May-2023 05:24:09 UTC] PHP Fatal error: Uncaught Exception: Unable to determine the current context. in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php:42 Stack trace: #0 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(60): AIOWPS\Firewall\Context::current() #1 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(51): AIOWPS\Firewall\Context::plugins_loaded() #2 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-utility.php(31): AIOWPS\Firewall\Context::wordpress_safe() #3 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-helper.php(144): AIOWPS\Firewall\Utility::get_root_dir() #4 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/ in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php on line 42 [23-May-2023 05:24:10 UTC] AIOS firewall error: Unable to determine the current context. [23-May-2023 05:24:11 UTC] AIOS firewall error: Unable to determine the current context. [23-May-2023 05:24:12 UTC] PHP Fatal error: Uncaught Exception: Unable to determine the current context. in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php:42 Stack trace: #0 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(60): AIOWPS\Firewall\Context::current() #1 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(51): AIOWPS\Firewall\Context::plugins_loaded() #2 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-utility.php(31): AIOWPS\Firewall\Context::wordpress_safe() #3 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-helper.php(144): AIOWPS\Firewall\Utility::get_root_dir() #4 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/ in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php on line 42 [23-May-2023 05:24:13 UTC] AIOS firewall error: Unable to determine the current context. [23-May-2023 05:24:16 UTC] AIOS firewall error: Unable to determine the current context. [23-May-2023 05:24:17 UTC] PHP Fatal error: Uncaught Exception: Unable to determine the current context. in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php:42 Stack trace: #0 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(60): AIOWPS\Firewall\Context::current() #1 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php(51): AIOWPS\Firewall\Context::plugins_loaded() #2 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-utility.php(31): AIOWPS\Firewall\Context::wordpress_safe() #3 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-helper.php(144): AIOWPS\Firewall\Utility::get_root_dir() #4 /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/ in /home/xxxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/wp-security-firewall-context.php on line 42 [23-May-2023 05:24:18 UTC] AIOS firewall error: Unable to determine the current context.
And in regards to changing the .htaccess file, I didn’t found that code in it, but maybe that is because I’m right now using version 5.1.8
Unable to determine the current context is identified issue and it is solved in AIOS 5.1.9.
No if that .htaccesss code is not there than it might be you have not set up firewall or might be users.ini file have similar code.
Regards
Most of our visitors, admin/editors complain about redirecting error messages across multiple websites.
I just received a message from a visitor to our website who tried to open the website for the first time and received too many redirect error messages.
It is happening in the new version of AIOS, and the URL that they are getting redirected to is as under:
https://domainname.com/?aiowpsec_do_log_out=1&al_additional_data=1&_wpnonce=4ac1af6cf2
Editors and Admins are also getting the same errors. Clearing the Cache of the browser solves the issue temporarily. Does the new version of the plugin conflict with Nginx, Redis, or other cache settings?
The visitors and users are getting errors as under:
This Page isn’t working
domainname.com redirected you too many times.
ERR_TOO_MANY_REDIRECTSHi @ajaffri
Thanks for your inputs, It seems issue is when the the force logout is called.
Can you first disable force logout from WP Security > User login > force logout?
do you have WooCommerce installed? what is login url for user as after force logout it will try redirect to login url?
For visitor it should not do force logout which seems wrong to me.
Regards
Thank you prompt reply and the possible solution. We don’t have WooCommerce installed, and we are using custom admin URLs on all websites using AIOS (Brute Force -> Rename login page).
After disabling Force Logout, admin editors can view the website without clearing cookies/cache. I will also contact regular visitors and see if this solves their issue. Will report back but now going to disable Force Logout on websites.
Hi
@ajaffri glad to know the disabling the force logout editors can view the website. I have created internal ticket for this to look for this issue.
Regads
Can you please let me know do force logout is enabled in your site ?
Go to WP Security > User login > force logout there check if force logout is enabled or not.
Regards
Yes, the force logeout is enabled, I hope that is the issue.
Also, you were right, the firewall wasn’t turned on, apparently it was disabled when I rollback o the previous version, but is on now.
Ok, and what type of users were being logged out ?
are those editors or custom user roles ?
Regards
The editors, subscribers and guests, but also the admins because I saw that message one time and it was then that I made the rollback, because until that moment I wasn’t sure of how severe was the issue.
- The topic ‘Too many redirects error’ is closed to new replies.