Support

Akeeba Backup for Joomla!

#39822 CLI backup fails after upgrading to J5

Posted in ‘Akeeba Backup 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
5.0
PHP version
8.1
Akeeba Backup version
9.8

Latest post by nicholas on Wednesday, 15 November 2023 04:53 CST

Kordian

Hello,

After upgrading joomla to 5.0 the cli backup returns errors:

root@gyps:~# /htdocs/cli/joomla.php akeeba:backup:take
Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#624
#message: """
Attempted to load class "JPlugin" from the global namespace.\n
Did you forget a "use" statement?
"""
#code: 0
#file: "/htdocs/plugins/system/acymtriggers/acymtriggers.php"
#line: 11
trace: {
/htdocs/plugins/system/acymtriggers/acymtriggers.php:11 {
require_once^

› class plgSystemAcymtriggers extends JPlugin
› {
}
/libraries/src/Extension/ExtensionManagerTrait.php:217 { …}
/libraries/src/Extension/ExtensionManagerTrait.php:160 { …}
/libraries/src/Extension/ExtensionManagerTrait.php:99 { …}
/libraries/src/Plugin/PluginHelper.php:232 { …}
/libraries/src/Plugin/PluginHelper.php:192 { …}
/libraries/src/Application/ConsoleApplication.php:255 { …}
/cli/joomla.php:77 { …}
}
}

 

root@gyps:~# /cli/joomla.php akeeba:backup:take
Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#745
#message: """
Attempted to load class "JURI" from the global namespace.\n
Did you forget a "use" statement?
"""
#code: 0
#file: "/plugins/system/fabrik/defines.php"
#line: 34
trace: {
/plugins/system/fabrik/defines.php:34 {
require_once^
› define("COM_FABRIK_LIBRARY", COM_FABRIK_BASE . 'libraries/fabrik');
› define("COM_FABRIK_LIVESITE", JURI::root());
› define("COM_FABRIK_LIVESITE_ROOT", JURI::getInstance()->toString(array('scheme', 'host', 'port')));
}
/plugins/system/fabrik/fabrik.php:140 { …}
/libraries/src/Extension/ExtensionManagerTrait.php:242 { …}
/libraries/src/Extension/ExtensionManagerTrait.php:160 { …}
/libraries/src/Extension/ExtensionManagerTrait.php:99 { …}
/libraries/src/Plugin/PluginHelper.php:232 { …}
/libraries/src/Plugin/PluginHelper.php:192 { …}
/libraries/src/Application/ConsoleApplication.php:255 { …}
/cli/joomla.php:77 { …}
}
}

Manual backups from web work.

Back compatibility plugin is on.
Thank you in advance.

nicholas
Akeeba Staff
Manager

As you can see in the error message, the problem comes from AcyMailing's "acymtriggers" plugin and on the other site it comes from Fabrik's system plugin.

This is a bug in both these extensions (AcyMailing and Fabrik) and Joomla!.

The bug in AcyMailing and Fabrik is that their plugin is still extending from the JPlugin class which was deprecated in 2015. They should have spent five seconds in the last eight years to change JPlugin to \Joomla\CMS\Plugin\CMSPlugin. Or, they could have spent almost no time at all by using my Rector rules which is how I converted two dozen extensions and libraries. The hard part was writing them, which I've done for them. They could spend a good 15' to set up Rector and another two minutes running it. Bam, wham, done. It amazes me that the vast majority of developers just don't care and won't even bother to do simple upkeep of their software.

The bug in Joomla! is that ever though you have enabled the backwards compatibility plugin which works around this problem in AcyMailing, that plugin is NOT loaded under the CLI application. This bug has been fixed nearly 3 weeks ago, but Joomla! has not made a public release including this fix to this major bug yet.

The only thing you can do is ask the third party developers to fix their plugins. In the meantime, you can fix those issues yourself by doing what these developers did not do.

When you get the error message ‘Attempted to load class "JPlugin" from the global namespace’ check what the lines say below that for a #file line. For example:

Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#624
#message: """
Attempted to load class "JPlugin" from the global namespace.\n
Did you forget a "use" statement?
"""
#code: 0 #file: "/htdocs/plugins/system/acymtriggers/acymtriggers.php" #line: 11

The #file line tells you the plugin file to edit. The #line tells you the line of the file to edit, replacing extends JPlugin with extends \Joomla\CMS\Plugin\CMSPlugin to address the issue.

Please note that you might have more than one broken plugins on a single 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!

Kordian

Hello,

Thank you for the reply.

Unfortunately you are completely wrong.

It is not a bug of neither of the apps as Akeeba should not examine nor check the programming code of none of the apps.

Akeeba should BACKUP absolutely all data within the given directory. EVEN if the files contain scripts that make ABSOLUTELY NO SENSE from the programming point of view.

That is what backup solutions should be doing.

Please correct the error in Akeeba, remove the lines that are examining code within files and let it do, what it should be doing - backing up the files. That is what you are being paid for, by the way.

Thank you in advance!

nicholas
Akeeba Staff
Manager

You are out of line.

We are being paid to write our software. We are paid to maintain neither Joomla! itself, nor any third party extensions. We are paid to ensure the quality of our software. We are paid to ensure the quality of neither Joomla! itself, nor any third party extensions.

I have, in my own spare time, written the definitive software development book for Joomla! 4 and Joomla! 5. I cannot make third party developers read it, or force them to follow it so their software isn't chronically broken. I cannot prevent them or the Joomla! project from making mistakes and/or not caring about the quality of their software. What I can and have been doing consistently the last 17 years is ensure that our software follows all Joomla! coding standards and is of a consistent, great quality. That's what is under my control, that's what I can objectively do.

When backing up your site using a Joomla! CLI Application command, you are using Akeeba Backup through the Joomla! CLI Application — just like when you are backing up your site through the backend of your site you are using Akeeba Backup through the Joomla! Administrator Application. The fact that this is what you are doing is fully documented, and also blatantly obvious based on the fact that your command line is using cli/joomla.php, a file distributed with Joomla! itself.

In Joomla! 3 we had our own command line script which were not loading any third party plugins and worked fine. We had to discontinue them and replace them with Joomla! CLI Application commands because standalone CLI script are deprecated in Joomla! 4.0 and will be completely removed in Joomla! 6. In fact, they don't actually work very well already in Joomla! 5. We would have of course preferred it to use the old way which does not get interference from third party extensions, but Joomla! no longer gives us this option.

The obvious objective point remains that when Joomla! is broken due to its own bugs, or because of a broken third party plugin there is nothing we can do. We can only fix problems in our code, not problems in Joomla's and third party extension's code.

The Joomla! bug is described in this issue: https://github.com/joomla/joomla-cms/issues/42210. As you can see, it's not even me who reported it and fixed it, it's someone who vehemently refuses to use our software thereby proving that the problems completely unrelated to our software.

This is something you can prove yourself, on your own site.

Uninstall Akeeba Backup from your site. You will lose all your backups and backup settings.

Now, run the same cli/joomla.php command WITHOUT any arguments (without the akeeba:backup:take and so on).

As you can see, the CLI application is still broken, without any of our code on your site. Therefore, and exactly as the linked issue states, we have proven beyond any doubt that the problem lies with Joomla! itself and third party software.

I reject the language you have used in your reply and I am hereby closing your ticket with prejudice. I am also giving you a final warning to be professional in your communications to us.

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!