Support

Akeeba Backup for Joomla!

#37079 Command line and cron job not working but the backup is successful when run at Joomla backend

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
4.1.2
PHP version
8
Akeeba Backup version
9.2.2

Latest post by nicholas on Monday, 09 May 2022 03:39 CDT

5uwebsite

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 10MiB, please upload it on your server and post a link to it.

 

Hi there,

We have other Joomla 4 websites working well. Therefore we understood that we need to enable the plugin and use cron job to call the corresponding cli file to do the backup. However, this is not working for one of the website. We could successfully run the backup at the backend and complete it. However, we could not trigger the backup via cron job or CLI.

Here is the command line:

/usr/local/bin/php /home/example.com/cli/joomla.php akeeba:backup:take --profile=2  

 

We got this from the cron job email:

 

InvalidArgumentException {#738 #message: "A router name must be set in console application." #code: 0 #file: "./example.com/libraries/src/Application/ConsoleApplication.php" #line: 456 trace: { ./example.com/libraries/src/Application/ConsoleApplication.php:456 { Joomla\CMS\Application\ConsoleApplication::getRouter($name = null, array $options = []) › { › \tthrow new InvalidArgumentException('A router name must be set in console application.'); › } } ./example.com/plugins/system/jmap/jmap.php:1286 { …} ./example.com/libraries/src/Extension/ExtensionManagerTrait.php:242 { …} ./example.com/libraries/src/Extension/ExtensionManagerTrait.php:160 { …} ./example.com/libraries/src/Extension/ExtensionManagerTrait.php:94 { …} ./example.com/libraries/src/Plugin/PluginHelper.php:236 { …} ./example.com/libraries/src/Plugin/PluginHelper.php:194 { …} ./example.com/libraries/src/Application/ConsoleApplication.php:231 { …} ./example.com/cli/joomla.php:78 { …} } }

 

nicholas
Akeeba Staff
Manager

As per your error trace, this issue happens because a third party system plugin is incompatible with Joomla 4:

./example.com/plugins/system/jmap/jmap.php:

That would be the JMap system plugin.

Please contact the extension developer and tell them that plugins which are ONLY meant to run in a web application should perform the following check:

$app = \Joomla\CMS\Factory::getApplication();
if (!($app instanceof \Joomla\CMS\Application\CMSApplication) || !$app->isClient('site') || !$app->isClient('administrator')) return;

Otherwise their system plugin will BREAK the Cli and Api applications which were added in Joomla 4. Therefore, if they do not perform this kind of check their extension is incompatible with Joomla 4 as it breaks two of the four applications implemented in the core Joomla distribution (site, application, cli, api).

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!

5uwebsite

Hi Nicholas,

 

Thank you so much! Yes that is the jSiteMap Pro extension and it is the cockpit of this problem.

 

After upgrading it to the latest version, this website can backup successfully via cron job. You are great!

 

Thanks again!

nicholas
Akeeba Staff
Manager

You're welcome! I am glad I could help :)

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!