Support

Admin Tools

#37330 An error has occurred

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
Joomla 4.1.4
PHP version
8.0.20
Admin Tools version
7.1.7 Pro

Latest post by nicholas on Thursday, 30 June 2022 01:42 CDT

Freiforum-N

Hello,

I have no more access to my website. Could you help me, please.

 

Regards

MS

 

nicholas
Akeeba Staff
Manager

Delete administrator/cache/autoload_psr4.php

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!

Freiforum-N
Hi Nicholas,

I have deleted the named file but now there arrives another error message with error code 500.

Regards

MS

 

nicholas
Akeeba Staff
Manager

When you receive this error, do you see a new administrator/cache/autoload_psr4.php file being generated? If not, please contact your host and tell them that PHP cannot write in the administrator/cache folder so can they please help you with the ownership and permissions to make that possible.

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!

Freiforum-N

There is a new administrator/cache/autoload_psr4.php file being generated!

nicholas
Akeeba Staff
Manager

In this case it looks like you are missing files from your Admin Tools installation.

Delete the folders plugins/system/admintools and plugins/actionlog/admintools to regain access to your site's backend. Now install Admin Tools again, twice in a row, without trying to uninstall it before or in between. This should cause Joomla to refresh all files and replace any missing ones.

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!

Freiforum-N

Hello,

I deleted the 2 plugins but after that I did not regain access to my site's backend but the error persisted.

 

Regards

MS

 

nicholas
Akeeba Staff
Manager

Also try deleting plugins/console/admintools and plugins/task/admintools, just in case you have a scheduled task. When doing support "unlikely" doesn't mean "impossible", so let's go super safe.

If you STILL get the same error (and please do pay attention at the class name it tells you is not found) then the problem does not come from the Admin Tools extensions but from something third party trying to do something naughty with our software.

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!

Freiforum-N

Even after deleting the 2 mentioned plugins the error message remains.

Thank you for your engagement.

MS

nicholas
Akeeba Staff
Manager

I have an idea about what is going on. Time for the nuclear option.

Delete the folders administrator/components/com_admintools and components/com_admintools

At this point we have removed ALL CODE belonging to Admin Tools. If you still see this message there are exactly two possibilities: a third party extension is being naughty OR your server is messed up (probably because it has a stupid OPcache setup). To determine what is what edit your configuration.php file and set

public $debug = true;

(That line would show false instead of true on your existing file).

Now retry accessing the site. You should see a far more detailed message with a debug trace. Screenshot it and attach it to your next reply. It will tell me which of the two problems you have so I can tell you what to do.

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!

Freiforum-N

Hello Nicholas,

after having deleted the named files

administrator/components/com_admintools
components/com_admintools
plugins/console/admintools
plugins/task/admintools
plugins/system/admintools
plugins/actionlog/admintools

the access to the BACKEND was possible again.

I haven't reinstalled admintools yet as there might be a bug in it. 

How should I go on?

 

Regards

Manfred

 

 

 

nicholas
Akeeba Staff
Manager

I do not appreciate your last response. Let me get you through our communication so far.

You reported an error about a missing class. There are two possible root causes: either Joomla messed up the autoloader or the file is missing. The simplest and most common root cause in Joomla 4 is Joomla not updating its autoload_psr4.php file or not being able to regenerate it due to file permissions, so let's try that first.

Once we had confirmed this is not the issue it was clear that you've hit a Joomla extensions update bug which makes random files go missing or you had accidentally deleted that file (or the entire administrator/components/com_admintools folder). We had to find out what is calling the missing class (this is the class which retrieves the WAF configuration from the database), disable it and get access to the site so we can reinstall Admin Tools to bring back the missing file.

The system and action log plugins are "always loaded" kinds of plugins, they are initialised very early in the Joomla page load process so that's the first ones we wanted to remove (since we'll be reinstalling it's not a biggie if we remove their files for now). When you said this did not help I was very skeptical about whether you actually followed my instructions. So my plan for attacking this problem is to remove all other first-party possibilities for loading this class and see where this is going.

There were just two more plugins which can indirectly call this class. The console plugin is only loaded by the Joomla Console Application (cli/joomla.php) unless there's a third party developer doing something stupid, so let's play it safe and remove it. The task plugin is loaded by the Scheduled Tasks and only when you are managing or running scheduled tasks. It's unlikely to be loaded on every page unless you have set up scheduled tasks using the lazy scheduling. Also unlikely but let's remove it. So, neither was likely to cause you trouble but we were removing them just in case you had indeed already followed my instructions and you had a very niche issue.

You replied all too quickly that that removing all the plugins did nothing. At this point I was confident that you had not in fact followed my instructions. I did not want to tell you that I don't believe you so my next step was to have you turn on debugging. Joomla would then give us a debug trace which would prove that the call comes from a plugin you said you removed. But if it runs it means it wasn't removed so I'd just ask you to follow my instructions.

Then you told me you removed the folders I had already asked you to remove and you confirmed you did, plus the two folders of the plugin itself. Even if we accept that you had followed my instructions so far, the only other two folders you'd have removed are the component folders. But doing that would NOT change the missing class problem! If anything, removing these folders makes it absolutely sure that the class will be missing (you removed the folder it's in)!

At this point I have to think that you were either not following my instructions all along or you have a server with OPCache and a cache invalidation frequency that's very high (in the order of hundreds of seconds). These are the only two possibilities which concur with what you are reporting. If you didn't follow my instructions until last night it's not a problem, it happens all too frequently, just don't make unfounded allegations about a "bug" to cover it up, please. I get very annoyed with that.

No, there is no bug in Admin Tools. This conversation taking place on a Joomla 4 site with Admin Tools running on it, with paranoid settings, proves it. If there was a bug our own site would be down so how would we be having this discussion to begin with?

Your problem, as I told you three days ago, was that you were missing a file from your installation, a file that is most definitely shipped with the software and installed as proven by the very fact that we are having this conversation here. The whole idea was to help you regain access to your site so you can reinstall Admin Tools twice in a row, without uninstalling it before or in between, to make sure that Joomla copies over all of the missing files.

As for the missing file, this is due to a Joomla bug. Please read https://www.akeeba.com/news/1746-working-around-joomla-s-broken-extensions-updater.html for the technical discussion about it. The problem is that on very few occasions Joomla forgets to copy files when it performs an extension update. The JSST lead David Jardin has finally confirmed this in February 2022 after it happened to him — this is something I have been reported since 2014 and people wouldn't believe me. That's why we need you to install Admin Tools twice in a row, without uninstalling it before or in between.

Finally, please do remember that you are talking to the developer of Admin Tools and the person who started the Joomla 4 Working Group and has contributed a lot of code to Joomla itself. If you had not followed all of my instructions it's okay, just tell me so, no hard feelings. If you DID follow all of my instructions then also do tell me because you have a server problem you will need help with AFTER you install Admin Tools again.

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!

Freiforum-N
Hello, I have done it again in the following sequence. Delete all your mentioned ftp files 
  • administrator/components/com_admintools
  • components/com_admintools
  • plugins/console/admintools
  • plugins/task/admintools
  • plugins/system/admintools
  • plugins/actionlog/admintools
Login to BACKEND is possible. Then I Installed admintools latest version 7.1.8

Try to Login to BACKEND entering j4test.heidgrabener-liedertafel.de/administrator The result is that the FRONTEND is displayed.
I have done this procedure multiple times and all with the same result.

 

Freiforum-N

Hello Nicholas,

see my answer to my problem I have sent on

Friday, 24 June 2022 15:03 CDT

 

In the meantime I have installed admintools 7.1.8 again and have the same problem. If I want to go the the BACKEND I enter j4test.heidgrabener-liedertafel.de/administrator

the system opens the FRONTEND. When debugging with FIREFOX I see an error 307 Temporary Redirect.

I have attached the whole debug report.

Then as a test I renamed /plugins/system/admintools   TO  AAAAAadmintools  and reloaded the site and the BACKEND is displayed!!!

 

I hope I could make me understandable as my mother tongue is GERMAN.

 

Regards

nicholas
Akeeba Staff
Manager

Danke schön für die Aufklärung! That's the full extent of my German — I can thank you for the clarification :)

OK, we have two interesting tidbits of information here:

  1. The Admin Tools system plugin is the one which triggers the error. This was not clear earlier because you had told me that deleting it didn't make any difference.
  2. The administrator/cache/autoload_psr4.php file is regenerated per the first thing I asked you to try.

This tells me that your Joomla installation or your server is broken!

Let's take things one at a time to understand how I reached that conclusion.

Joomla 4, unlike previous versions, uses PHP namespaces for its extensions. Each extension declares its root namespace in its XML manifest file. For example, the Admin Tools component declares that in the administrator/components/com_admintools/admintools.xml file, namely in this line:

<namespace path="src">Akeeba\Component\AdminTools</namespace>

This tells Joomla that the PHP namespace Akeeba\Component\AdminTools\Administrator (that latter part is added magically by Joomla) is fulfilled by the files inside the administrator/components/com_admintools/src folder. Therefore the place to find the \Akeeba\Component\AdminTools\Administrator\Helper\Storage class is the file administrator/components/com_admintools/src/Helper/Storage.php.

According to what you have told me this file does exist. Please double check. If it does not exist stop reading and tell me "The Storage.php file is missing".

Joomla registers a PSR-4 autoloader when it runs so these namespace to directory assignments can be used automatically, without the developers having to explicitly load each file individually. However, that would require Joomla to read the XML manifests of every component, plugin, module, template, and library extension installed on your site every time it tries to load a page. This would be a waste of time. So Joomla will instead cache this information in the administrator/cache/autoload_psr4.php file.

This file is regenerated in two cases. One, if you are installing or updating and extension. Two, if it's missing. 

According to what you have told me, if you delete this file it is regenerated. Please delete it, load a new page and double check that the administrator/cache/autoload_psr4.php file exists. If it does not exist stop reading and tell me "The autoload_psr4.php file does not get regenerated".

When Joomla is regenerating this file it is indeed reading the XML manifests of every component, plugin, module, template, and library extension installed on your site, calculates the namespaces and directories and writes all of that information to the autoload_psr4.php file. This means that you should have the following line in it:

'Akeeba\\Component\\AdminTools\\Administrator\\' => [JPATH_ADMINISTRATOR . '/components/com_admintools/src'],

According to what you have told me, this line exists. Please double check that you do see this line in the administrator/cache/autoload_psr4.php file. If it does not exist stop reading and tell me "The autoload_psr4.php file is missing the information for Admin Tools".

The Admin Tools plugin does indeed reference the \Akeeba\Component\AdminTools\Administrator\Helper\Storage class directly in the \Joomla\Plugin\System\AdminTools\Extension\AdminTools class. That's the file plugins/system/admintools/src/Extension/AdminTools.php. Since the namespace prefix \Akeeba\Component\AdminTools\Administrator\ is already mapped to a folder in the autoload_psr4.php file (as we have already established) it can be found by the autoloader. If you are still getting an error claiming this class does not exist it can only mean one of the following:

  1. You are using a cache folder that's different than administrator/cache. If you are, you should know about it because it requires editing Joomla's includes/defines.php file yourself. This is extremely unlikely, especially since you'd have thought to mention doing something that non-standard!
  2. Joomla's autoloader is broken. This does not happen on any other site (development or live), ours or our clients', therefore something is broken in your installation. Download the update ZIP package for the Joomla version you are using from downloads.joomla.org, extract it on your computer and upload all the files on your site, overwriting the existing core Joomla files. This does not affect your site's database or third party extensions. It simply makes sure there is no discrepancy between what Joomla ships and what you have installed on your site.
  3. Your server has OPcache enabled but does not have a sensibly low opcache.invalidate_freq set in its php.ini. Ask your host if OPcache is enabled. If it is, ask them to set the opcache.invalidate_freq to 2 seconds. This will solve your issue.

That's how I conclude that based on all the information you had given me so far either Joomla is broken (case #2 above) or your server is broken (case #3 above).

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!

Freiforum-N
Let's take things one at a time. You wrote: Therefore the place to find the \Akeeba\Component\AdminTools\Administrator\Helper\Storage class is the file administrator/components/com_admintools/src/Helper/Storage.php. My answer: The file exists. See the attached file.

 

Regards

Manfred

nicholas
Akeeba Staff
Manager

Okay, keep going. I wrote things in a certain order so you understand what we are checking and why. I want to see at which point we'll have a discrepancy between what we expect based on what we've discussed so far and what really happens on your site.

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!

Freiforum-N
First I deleted the file administrator/cache/autoload_psr4.php file Then I reloaded the website The file administrator/cache/autoload_psr4.php file was regenerated
(see attached file Attach-1.png)
Then I opened the file administrator/cache/autoload_psr4.php.
The line 
'Akeeba\\Component\\AdminTools\\Administrator\\' => [JPATH_ADMINISTRATOR . '/components/com_admintools/src']
is the first one in the file (see attached file)  

Regards

 

 

 

nicholas
Akeeba Staff
Manager

Okay. Joomla generated the file and it did so correctly. But the plugin trying to use a class which Joomla should be autoloading results in an error. Therefore either Joomla is broken or your server is misconfigure. Follow the instructions in items 2 and 3 at the bottom of my longer reply above to refresh your Joomla files and have your host check the OPcache settings.

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!

Freiforum-N
1. I have contacted my host to check the OPcache settings
2. Which of the 2 packages should I download (see attached file)?

Freiforum-N
I think this is the right package (see the screenshot attached) isn't it.

nicholas
Akeeba Staff
Manager

Correct. That's the ZIP file you need: Joomla! 4.1.5 Upgrade Package (.zip)

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!

Freiforum-N
I have downloaded the zip.file, extracted it  and uploaded the files.
Then I reloaded the website j4test.heidgrabener-liedertafel.de/administrator.
The result was disappointing. The FRONTEND instead of the BACKEND was displayed.
 
The host hasn't yet answered.

nicholas
Akeeba Staff
Manager

This is GOOD NEWS! I know it doesn't sound like it, but it is. You know why? Because Admin Tools worked without throwing an error :) So we know that the problem was indeed with your Joomla installation.

Now, let's solve the minor problem of not being able to access the backend of your site. This happens because when you first set up Admin Tools and went through its Quick Setup Wizard you enabled the administrator secret URL parameter. If your secret URL parameter is foobar and your site is https://www.example.com then you need to access your administrator login page as https://www.example.com/administrator/index.php?foobar .

Since you don't remember any of that happening, no worries, we can get you back into your site so you can figure out what you configured. Follow the instructions in https://www.akeeba.com/documentation/admin-tools-joomla/atwafissues.html. You need to follow the instructions under the “Using FTP to regain access to your site's administrator” and “Administrator Secret URL parameter” sections of that page.

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!

Freiforum-N
I have performed this step: Go inside the plugins/system/admintools/services directory. You will see a file named provider.php. Rename it to provider-disable.php. Now the BACKEND is shown!! but the site is not protected  You have renamed the plugins/system/admintools/services/provider.php file to provider-disable.php. As a result Admin Tools does not protect your site. If you did this intentionally, to fix some problem you were experiencing, please remember to rename the file back to provider.php. In most cases you can click the link below to do it automatically. Rename the file back to provider.php There is no administrator secret URL paramete.

Administrator secret URL parameter
For example, if you enter 'test', then you will only be able to access your administrator area by typing the URL http://www.example.com/administrator/index.php?test. WARNING! IT MUST START WITH A LETTER, NOT A NUMBER. For better compatibility across servers, please use lowercase ASCII characters and numbers only (a-z, 0-9).

 

What should be the next step?

nicholas
Akeeba Staff
Manager

Read the page I linked you to again. It has four things to check under “Step 2. Unblock yourself”. Go through them one at a time until you find what is blocking you.

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!

Freiforum-N
“Step 2. Unblock yourself”.  I have gone through them one at a time and until I hope to have found the solution for what is blocking me
I added my own IP address to ADMINISTRATOR IP EXCLUSIVE ALLOW LIST AND renamed plugins/system/admintools/services/ provider-disable.php back to provider.php
Result: THE BACKEND IS SHOWN.
I am not sure if my IP-address is static.

nicholas
Akeeba Staff
Manager

I would recommend turning off the Administrator IP Exclusive Allow List feature if you are not sure if you have a static IP address. I have a suspicion that this is why you got blocked in the first place.

Well, it's easy to figure out if you need to do that. If you get blocked out of your backend again you will know that your IP address is dynamic, therefore you need to follow the procedure to unblock yourself again, this time disabling the Administrator IP Exclusive Allow List feature in Components, Admin Tools for Joomla, Configure WAF.

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!

Freiforum-N
1. I don't have a static IP address 2. How can I disable the Administrator IP Exclusive Allow List feature in Components ???? 3. The host provider told me that opcache.invalidate_freq is already set to 2 seconds

 

nicholas
Akeeba Staff
Manager

1 & 2. All you need to do is go to Components, Admin Tools for Joomla, Web Application Firewall, Configure WAF and click on the Basic Features tab. Set the “Allow administrator access only to IPs in Exclusive Allow IP List” option to No. Click on Save & Close

3. It's okay, in the meantime we already established this was not the problem we were having :) Their setting is very good for live sites. No change necessary.

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!

Freiforum-N
I wanted to set Allow administrator access only to IPs in Exclusive Allow IP List” option to No.  (see attachment #1)
but I can't save it (see attachment #2)

nicholas
Akeeba Staff
Manager

You are given messages on your screen which tell you what's wrong. 

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!