Hi @the9mm,
Thanks for the details! When you get a chance, could you please let me know if you’re getting 404 in Google or on your site? The issue still looks like because of some firewall blocking the incoming request from Google, some parts of the URL are filtered and you’re redirected to 404 page. Could you please check the mod_security logs after authenticating with Google? The docs says, If you see 418 response codes in your access.log files, it means that the request was blocked by mod_security..
Thanks!
Thread Starter
the9mm
(@the9mm)
Hi Sanjeev,
The 404 error is on my site, not on Google. Here’s what is being returned to me in the access log:
x.x.x.x - - [31/Aug/2020:12:33:16 -0700] "GET /wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/ HTTP/1.1" 404 34286 "https://accounts.google.com/signin/oauth/consentsummary?authuser=0&part=[removed]&approvedScope=https%3A%2F%2Fmail.google.com%2F" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"
x.x.x.x - - [31/Aug/2020:12:33:17 -0700] "GET /wp-includes/css/admin-bar.min.css?ver=5.4.2 HTTP/1.1" 200 8455 "https://www.ecosourcellc.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"
x.x.x.x - - [31/Aug/2020:12:33:17 -0700] "GET /wp-includes/js/hoverintent-js.min.js?ver=2.2.1 HTTP/1.1" 200 5034 "https://www.domain.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"
x.x.x.x - - [31/Aug/2020:12:33:18 -0700] "GET /wp-includes/js/admin-bar.min.js?ver=5.4.2 HTTP/1.1" 200 5846 "https://www.domain.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"
x.x.x.x - - [31/Aug/2020:12:33:20 -0700] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 4630 "https://www.domain.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"
Hi @the9mm,
Thanks for the log. The URL in the first line is good and is expected, so there is something redirecting to the 404 pages. You might still need to contact your hosting provider to show these logs or you have some other security plugins that is causing this issue.
Have a good one!
Thread Starter
the9mm
(@the9mm)
Hi Sanjeev,
My hosting provider has stated:
“I am so sorry for the continued issues. I investigated this with one of
our security engineers about this and we find no evidence that this is
being blocked by Mod_Security. We have specific logging for things
blocked by modsec and it will record a “418” error to help us easily
identify modsec issues. I checked our separate mod_sec logs as well and
there are no entries for google, your IP, gmail, smtp. Unfortunately we
are not sure what else could be causing it, but again, it is not modsec.
It would be best to continue to have the plugin developer look into it
more, possibly enabling verbose logging from the plugin to see what the
process is actually doing, which results in the 404 error.”
I have tried to run this while disabling all plugins, and resulted in the same issue. Initially BulletProof Security was capturing it as a 405 (which resulted in me having to disable that plugin and replace my htaccess with a default one), so while there may have been another plugin involved prior, I’m not seeing one now. Is there anything else I can enable or specifically ask for from my hosting provider to get to the bottom of this?
A 405 error is a HEAD Request that was blocked. Maybe this was for something else? Post the BPS Security log 405 log entry so I can take a look at it. To allow/not block all HEAD Requests use this solution below. If you still have the BPS plugin installed then deactivate wp-admin BulletProof Mode to eliminate/confirm the BPS wp-admin htaccess file is causing the problem. If you do not still have the BPS plugin installed then delete the /wp-admin/.htaccess file if it exists. If BPS was blocking this then you would be seeing a 403 error and not a 404 error, but eliminate BPS htaccess files entirely to be sure that the BPS root or wp-admin htaccess files are not involved in the problem. Also copy the URL from the Apache error log entry and paste it into your Browser address bar. If you see a 404 error then most likely the problem is with the URL itself.
1. Copy the code below into this BPS Root Custom Code text box: 9. CUSTOM CODE REQUEST METHODS FILTERED
2. Click the Encrypt htaccess Code button first if your host server has ModSecurity installed. ModSecurity blocks saving BPS Custom Code unless it is encrypted before saving it.
3. Click the Save Root Custom Code button.
4. Go to the Security Modes tab page and click the Root Folder BulletProof Mode Activate button.
# REQUEST METHODS FILTERED
# If you want to allow HEAD Requests use BPS Custom Code and copy
# this entire REQUEST METHODS FILTERED section of code to this BPS Custom Code
# text box: CUSTOM CODE REQUEST METHODS FILTERED.
# See the CUSTOM CODE REQUEST METHODS FILTERED help text for additional steps.
RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK|DEBUG) [NC]
RewriteRule ^(.*)$ - [F]
#RewriteCond %{REQUEST_METHOD} ^(HEAD) [NC]
#RewriteRule ^(.*)$ /wp-content/plugins/bulletproof-security/405.php [L]
Hi @the9mm, @aitpro
Thanks for the details. Unfortunately, I don’t see any other reasons if there is no restriction by your hosting provider and especially if the incoming URL is correct. Please follow this troubleshooting guide to identify any conflict with theme/plugins or .htaccess rules.
Have a good one!