Support

Admin Tools

#32022 Admin tools not protecting site error

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 on Friday, 17 January 2020 17:17 CST

joomladienst
Hi,

I am getting a error message "Admin Tools is not protecting your site yet. Please run the Quick Setup Wizard to configure Admin Tools on your site.".
I tried running the setup again, reapplying admin tools update even deleting admin tools and reinstalling.
Every time the I "fix" the error it comes back a few days later.

What do you think could be the problem?

tampe125
Akeeba Staff
Hello,

this is pretty strange.
We store all Admin Tools values inside the table #__admintools_storage. Is such table empty or there's data?
Do you have any script that is purging your database?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

joomladienst
There is data in it.
https://ibb.co/sgRbQQS

There is no script that is purging our database as far as I know. I also noticed, through PHP file change scanner, that a lot of files were modified on site.

Could changes in files cause this?

tampe125
Akeeba Staff
It seems that the flag we put to preventing the same warning to show up every time is no longer there.
Can you please try to run the Quickstart wizard again and watch that table from time to time to see if data is removed?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

joomladienst
I run the wizard again. Data looks like this now. https://ibb.co/tmzqFbb

I will send you an update when things change.

tampe125
Akeeba Staff
Good, thank you for the update. Those are the contents that such table should have.
By the way, since this is a public ticket, I removed your attachment. Attachments are available only to support and the original poster, but I'd like to be extra sure.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

joomladienst
I originally thought that the problem was with the server of this problematic site. Now the same issue has showed up on 3 new sites on 3 different servers.
Could it be a bug in Admin Tools? What else could be causing this?

tampe125
Akeeba Staff
Are those on with the same hosting company?
Do you have any script about caching/optimize the database?

I can't replicate this issue and we never received any report from our customers, I suspect there's some extension conflicting.
How many extensions do you have installed? Can you please try to install a temporary site in a subfolder of one of your sites with Admin Tools only and see if this problem still happens? Then try to install one extension at time and check again.
I know it's a long process, but this is the only way to understand who's the culprit.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

joomladienst
They do not use the same hosting company.
One of them is on our server. Hosteurope is the hosting company. We have several sites on it, multiple of them have admin tools and this problem shows up on only one site.

I will test it in the way you described.

tampe125
Akeeba Staff
Thank you. Please keep me updated since I'm genuinely curious about this.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

joomladienst
Hi,

I tested a page on my local environment and I could not recreate the issue.
This problem showed up on 5 sites so far. On some multiple times.
My reaction was to reinstall admin tools. That works for a time.
On one site after I reinstalled admin tools the problem came back after 3 weeks.

Are you sure no one else had this problem before?
What data in #__admintools_storage is affecting that message?

I also noticed that data in .htaccess Maker is lost when that problem shows up. Actual file is not changed.
Options in Configure WAF are also gone, I do not know if they are still working and just not showing up.

nicholas
Akeeba Staff
Manager
The biggest block of data that goes into the #__admintools_storage table is the .htaccess Maker settings. Everything else is much more compact and predictable. The .htaccess Maker settings include large segments of arbitrary text data (all the custom rules you add) which could, under certain conditions, cause the stored data to be broken.

A few years ago that table's value field type was TEXT which is just 64KB of storage on MySQL. We discovered that if you added a lot of custom rules you'd go beyond that size. Therefore MySQL would truncate the JSON data in the field, making it impossible to read them back. That would be consistent with your experience. However, we changed it to a LONGTEXT which allows up to 4 GB of storage. That was more than 3 years ago. I'd have to go a long way back to the edit history of our SQL file to find the exact date.

Can you please confirm that the field type is LONGTEXT? If it's not try the following. Disable the System - Admin Tools plugin. Export your settings. Delete the table. Go back to Components, Admin Tools. You may have to reload the page twice before it stops complaining about the database table being broken. Import your settings. Re-enable the System - Admin Tools plugin.

Another issue is what kind of data you put in it. By default, Joomla uses plain old UTF8 encoding for its tables. Admin Tools will use whatever encoding Joomla is using. If it's UTF8 and you try including some Emoji or other long multibyte characters (4 bytes per character) the data in the table will be broken. I don't see why you'd do that in the settings but that's a possibility. The solution to that is converting your site's database to UTF8MB4 encoding which means backing it up with Akeeba Backup and restoring it, making sure you check the box about UTF8MB4 in the Restore Database step.

The final issue that could cause the MySQL data to be broken is including a \x00 (NULL byte) in it. If I would be hard pressed to see any practical reason why you'd include Emoji I can definitely see absolutely no reason why anyone would end up with null bytes in their .htaccess Maker data. The only solution to that is, um, not include null bytes in your data?

Beyond that I cannot think of any other reason you'd have a problem reading data back from the table assuming the table is not corrupt. You can never rule out table corruption. But I'd be more willing to believe it if it was only affecting a specific server or host than separate hosts. Given that the problem happens to you but nobody else (that we know of) and you cannot reproduce it except your live sites I am thinking that the problem lies with the kind of data that you put into Admin Tools' configuration and the field type or the table's character encoding. Everything else sounds far-fetched to me.

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!

joomladienst
Hi, thank you for the detailed response.

I checked the field type and it is LONGTEXT.
I did not put any emoji or NULL byte in to htaccesss custom rules.

I compared versions of the site, before and after this error. In this particular case the change happened over the weekend. Nobody was doing anything on the site. The only change I could find is in the database.

db->#_admintools_storage->cparams value
The data in that cell is changed. Like it has been reset to a fresh install state. I will send you files, before and after.

Another change is in the criticalfiles field. When I compared the information about the files I found that the "configuration.php" file got changed. It got bigger. When I compared the actual files they were identical. Both had the bigger size.

I do not know what is causing this. On this particular site I reinstalled admin tools when the error first appeared. Then for 2 weeks everything was fine. Then over the weekend when no one is doing anything on the site it comes back. And only on that particular site. The server is hosting multiple sites. I have external cronjobs that are starting akeeba backup and PHP file change scan every day, but those should not cause this.

tampe125
Akeeba Staff
It seems there's something deleting stuff inside your database. Honestly I don't know what could be, I've never experienced something like that.
I you really want to got that extra mile, you can install Admin Tools, configure it, backup the table, uninstall it and then restore the table.
Take a look at the table in the following days: something strange happens there?
If you create another table with the same structure and contents, but with a different name, something happens?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!