Support

Admin Tools

#17429 White Screen / 500 Error - After enabling Geographic Blocking

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Monday, 23 September 2013 14:27 CDT

user78427
Mandatory information about my setup:

1) Have I read the related troubleshooter articles ? Yes
- Admin Tools' Web Application Firewall (WAF) locked you out of your site
- Troubleshooting instructions for February 2013 releases
2) Have I searched the tickets before posting? Yes
- #13176 – Site IP Blacklist,
- #14359 – Error 500 when try to add item to Blacklist
- #17401 – White Screen After Upgrading to Admin Tools Professional 2.5.7
3) Have I read the documentation before posting (which pages?)? Yes
- Admin Tools User Guide (Web Application Firewall, Site IP Blacklist, Geographic blocking)

Joomla! version: 2.5.12
PHP version: 5.x
PERL, CGI, SSI support
MySQL version: (unknown)
Host: TwoCows
Admin Tools version: Pro 2.5.7

Description of my issue:
White screen / Error 500 on front-end and back-end after attempting to enable Geographic Blocking.

What happened before:
- Updated Admin Tools from 2.5.6 to 2.5.7
- Created a blacklist of specific IPs (countries of different origin than my own)
- Uploaded GeoIP.dat for the first time via Admin Tools Update Geo.Ip button. Checked off China.
- All went blank (Chrome specifies it as a 500 error)

What did i do next:
- Disabled System-Admin Tools to see if it is the culprit. Confirmed.
- Read above material
- Deleted .htaccess and replaced it with Joomla's default .htaccess
- Changed error reporting from none to default in Configuration.php
- Manually updated the GeoIP directory, and verified files - they are empty (i.e no blocking).

Current status / Additional Notes:
Site is up and 'working' so long as System-Admin Tools plugin is disabled. Can't make changes to WAF in back-end as a warning states "You have to publish the "System - Admin Tools" plug-in before any of these settings have any effect". A catch 22 ... maybe.

Also since I've installed and configured the basics in Admin Tools Pro, I have a Warning message under Extensions Manager (thought harmless until now): The PHP temporary directory is the directory that PHP uses to store an uploaded file before Joomla! can access this file. Whilst the directory not being set isn't always a problem, if you are having issues with manifest files not being detected or uploaded files not being detected, setting this in your php.ini file might fix the issue.

dlb
You can make and save changes in WAF, the warning is telling you those changes will not affect your site until you enable the System - Admin Tools plugin.

The php temporary directory could affect installing new updates or extensions. It doesn't have any effect on your current issue.

Dale


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user78427
Thanks for the info Dale.
But even so, where to go from here to resolve the 500 error / white screen?
What do you suspect may be the cause? Are there any options or files I should look at, overwrite, etc.?

Thx

dlb
You have already done some of these steps, what I'm interested in at this point is the error log. If you can not get to the error log, then the setting the error display so we can see an error message.


A white page or a page with a 500 Internal Server Error is, in fact, either a .htaccess issue to a PHP fatal error in disguise.

First, let's see if it is a .htaccess issue. Try renaming the .htaccess file in your site's root to htaccess.bak If there is a .htaccess file in the site's administrator directory, try renaming it as well. If that solves the problem, the issue was with a directive in your .htaccess file. We'd like to recommend you to try removing directives from your .htaccess until you find the one which causes the problem.

If that doesn't help, the error you are receiving is in fact a PHP error in disguise. First, check your server's error logs (not the access logs) immediately after visiting the page which throws the error. There should be an exact description of the PHP fatal error which occurred. Sometimes you can find the error messages in files called error_log or error.log inside the site's root and/or administrator directories. If unsure about the error log location, please consult your host. Most likely the error logs are available in your site's cPanel, Plesk control panel or similar hosting account management facility.

If your host does not give you access to the error logs and you have access to the Joomla! administrator area, please log in to your site's back-end, go to Global Configuration, click on the Server tab and set the Error Reporting to Maximum (Joomla! 1.5) or Development (Joomla! 2.x and later). Try visiting the problem page again.

If you still get a blank page, edit your configuration.php file and put the following code right after the final closing curly brace ( this is what a curly brace looks like --> } ) but before the closing PHP tag (it looks like ?> that is a question mark and a greater-than sign):
ini_set( 'display_errors', true );
error_reporting( E_ALL ); 
Try visiting the problem page again.

If you still get a white page, please remote the two lines from your configuration.php file. Edit the .htaccess file in your site's root. If you don't have a file named .htaccess create a new one. Beware that htaccess.txt is a DIFFERENT FILE and will NOT work! Add the following to the end of the file:
php_flag display_errors On
php_value error_reporting 32767
and retry loading the problem page.

If you still get a white page, remove the two lines from your .htaccess file. Now, create a file called php.ini with the following content:
display_errors=on
error_reporting=E_ALL
and upload it into your site's root and your site's administrator directory. Retry loading the problem page.

IMPORTANT: Sometimes the error won't show. Edit your configuration.php and find the line starting with public $error_reporting and set it to:
public $error_reporting = 'development';

This instructs Joomla! to enable maximum error, warnings and notices verbosity. In 99.9% of cases it will result in the error messages being shown on the browser.

If you still get a white page, delete the php.ini files your created and choose a different host. If your host doesn't allow you to debug any PHP-related issues there is no point paying them.

Please note that if you can not understand what the PHP error message means, just copy and paste it here verbatim so that we can take a look and point you to the right direction.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user78427
Status Report
Partially fixed. Updated to latest Akeeba Admin Tools 2.5.8. This seems to have resolved the issue on the front end (displays normal), however acces to login administrator page still gives a blank screen (and thus no access to back end).

Steps taken
Thank you Dale for the thorough response and suggestions. Here are the results :
- Renaming the .htaccess did not change anything.
- Editing the configuration.php did not produce any message
- Adding code to the .htaccess file did produce a 500 Internal Server Error when accessing front end (see further below). Note that the only htaccess file I have was/is completely empty (no text) at this point.
- Adding 'development' in configuration file produced an error message on front-end. And two messages when trying to acces login admin page. (see Error Messages below).

Error Messages:
  • Internal Server Error - The server encountered an internal error or misconfiguration and was unable to complete your request. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
  • "Strict Standards:Declaration of JParameter::loadSetupFile() should be compatible with that of JRegistry::loadSetupFile() in /home/fantasti/public_html/libraries/joomla/html/parameter.php on line 512"
  • " Notice: Uninitialized string offset: 0 in /home/mysite/public_html/administrator/components/com_admintools/helpers/geoip.php on line 445"
  • " Fatal error: error traversing database - perhaps it is corrupt? in /home/fantasti/public_html/administrator/components/com_admintools/helpers/geoip.php on line 460"

Latest Error logs (300/acces/PHP)
- File does not exist: /home/mysite/public_html/404.shtml
- File does not exist: /home/mysite/public_html/res
- File does not exist: /home/mysite/public_html/admin.php
- File does not exist: /home/mysite/public_html/wp-login.php
- Warning: DocumentRoot [/home/mysite/public_html/oldjoom] does not exist
- Warning: substr() expects parameter 1 to be string, resource given in /home/mysite/public_html/libraries/joomla/installer/helper.php on line 61
- PHP Fatal error: error traversing database - perhaps it is corrupt? in /home/fantasti/public_html/administrator/components/com_admintools/helpers/geoip.php on line 460

I'll await your response. Your help is much appreciated.

dlb
OK, this is not too bad. The "strict standards" and the "warning" are just because we have the error reporting up so high. The real problem is the database error, that one is causing the 500 error.

We're going to disable the WAF so we can get to the back end, turn off the GeoIP block, repair the database and update the GeoIP data.
  1. Go inside the plugins/system/admintools directory on your site. You will see a file named main.php. Rename it to main-disable.php. This will turn disable the Web Application Firewall from executing and you can access your site's back-end again. After you have fixed the cause of your issue remember to rename main-disable.php back to main.php, otherwise your site will remain unprotected!
  2. Now that you can get to the back end of your site, turn off the GeoIP checking.
  3. Reverse step #1
  4. In Admin Tools, Repair & Optimize Tables
  5. Under Web Application Firewall, Geographic Blocking, Update GeoIP.dat
  6. Enable your GeoIP blocking
  7. Do the Dance of Joy
Somewhere about step #2.1 you should do a backup because step #4 is messing with your database and backups are good.

You will need to rename your .htaccess back to normal and undo your error reporting changes.

Dale


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user78427
Step 1 gets me in back-end.
Stuck at step 2 - how to turn off GeoIP ?

Nothing is checked off in GeoIP. This is the only way I can presume it's "off", but even so Step 3 brings me to a blank page everytime. Tried to follow the remainder of steps without luck...

dlb
I was a little bit too aggressive in cleaning things up. Let's try again with a few less steps.
  1. Go inside the plugins/system/admintools directory on your site. You will see a file named main.php. Rename it to main-disable.php. This will turn disable the Web Application Firewall from executing and you can access your site's back-end again. After you have fixed the cause of your issue remember to rename main-disable.php back to main.php, otherwise your site will remain unprotected!
  2. In Admin Tools, Repair & Optimize Tables
  3. Reverse step #1
Are you able to get to Admin Tools now?

Dale


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user78427
White Screen / 500 Error - After enabling Geographic Blocking

Status report : Problem resolved!

Dale, I can certainly appreciate the 'agressive' approach. Unfortunaely, the last steps above still produced a blank page.That said, looking back at steps 1-7, and reading over one more time the Admin Tools documentation, I found our culprit :

The solution - Manually update/upload the GeoIP.dat

As per your instructions, when I had set main-disable.php I was able to access the back-end, WAF and the Geographic Blocking. There, I updated GeoIp via the update button. All seemed fine. That said, looking under public_html/administrator/components/com_admintools/assets/geoip, I noticed the GeoIP.dat file was 0 kb. How can this file be empty if I updated it ?! I therefore manually uploaded the GeoIP.dat (capitalisation important) file to the proper directory, overwriting the existing 0kb one. Presto! Back in business.

And so begins the dance of joy...

Next steps - Troubleshooting

The question remains why won't GeoIP.dat update via the update button. A question for the team.
- I can confirm my host has the ports open to do this external update.
- I have no other extensions doing the same for geo blocking. No conflicts.
- Once problem fixed, I Repaired & Optimized Tables, and did a backup of my site
- I then updated GeoIp within WAF (again via update button) - problem reoccured. A 0kb file loaded.
- Blank page reaapered. Applied solution above to fix problem.

Many thanks Dale for your patience and help!

--
Admin Tools 2.5.8
Joomla 2.5.14
PHP 5.3.26
SQL 5.1.70

dlb
I'm glad you got it figured out. I don't feel like I was much help on this one.

You have it down to a reproduceable error, I need to turn it over to Nicholas now so he can squash it. :)

Dale


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

nicholas
Akeeba Staff
Manager
This feature is very simple: it downloads the GZip compressed file from MaxMind, extracts it and writes it to your site. If the downloaded file is corrupt, GZip is not available on your site or there is a problem with Joomla! writing to the GeoIP.dat file then yes, you will end up with a 0 bytes file. As to why Joomla! might not be able to write to that file there are so many possibilities that it would probably take an encyclopaedia to list them. I'd recommend updating this file manually.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!