Support

Akeeba Backup for Joomla!

#38858 Back Up Timing Out/Akeeba Backup Unhandled Exception

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.2.9
PHP version
8.0.28
Akeeba Backup version
9.5.1

Latest post by cityofeagan on Wednesday, 19 April 2023 08:53 CDT

cityofeagan

Hello,

Our organization had been using Akeeba Backup with Joomla 3, but in the migration process to Joomla 4 in 2022, the component and configuration never moved over. We recently discovered this and reinstalled the component.

After running the configuration wizard we could back up the site manually, but when kicking off the automated backup with a cron job, the backups would time out. After making a few tweaks to exclude certain DB tables and directories, we were able to successfully run an automated backup.

I created a second backup profile to back up our images directory which we excluded with the default profile. Ran the config wizard and excluded all but the images folder, and while it will back up manually, the cron times out.

First, trying to figure out what settings I can tweak to avoid the time outs on cron jobs.

Second, we began receiving the attached exception error on some of the automated back ups. It's not happening on every automated back up, and we've received the error with both backup profiles.

Please review and let me know how we can resolve and if there's any further information you require.


Thank you for your time.

Ryan

tampe125
Akeeba Staff

Hello,

can you please attach the log of a failed backup? Please zip it before the upload, if it's still too large, please upload it somewhere and paste here the share link.

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!

cityofeagan

Hi Davide,

I've attached a zipped folder including log files from failures due to exception and timeout. Please let me know if there's anything else I can provide.

 

Thanks,

Ryan

tampe125
Akeeba Staff

Hello,

the attachment has been blocked. Please upload it somewhere and paste here the share link.

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!

cityofeagan

The file is available here: https://securefiles.cityofeagan.com/link/EIeBICEEgMaS4r1ljDlrrA

Let me know if you run into any further issues.

tampe125
Akeeba Staff

Just to be sure, if you run it from the web interface it successfully completes, right?

Your backups fail because your host is imposing a maximum CPU usage time limit. Please note that CPU usage is different than wall clock time, hence the small variability of a few seconds you may observe in different backups' log files from the start of the backup until the point it abruptly stops.

You will need to contact your host and let them know they have to make a configuration change in their server to let you run your backups. You may use the following text, replacing XYZ with the time it takes to run a backup from the backend plus about 10%. You can find out the time it takes to run a backup in the backend of your site, Akeeba Backup, Manage Backups. If you have multiple backup profiles use the time from the longest-running profile.

Here is the text to use:

I am using CRON jobs to take a backup of my site. I have observed that my CRON job stops executing at around REPLACE THIS BASED ON WHAT YOU SEE IN THE LOG FILE seconds. This is not enough time to complete a backup of my site. This means that you have set up a CPU usage limit either with ulimit or the /etc/security/limits.conf file on your server.

Please make the current CPU limit for my user into a soft lift and set up my CRON jobs so they have a CPU limit of XYZ. This would allow my backups to run without affecting the sensible time limits you have set up for PHP script running over the web.

If your host refuses to make changes you can still automate your backups, either using a third party over-the-web CRON job service which respects redirections (e.g. WebCRON.org) or a third party service which is compatible with Akeeba Backup such as myJoomla.com, BackupMonkey.io or Watchful.li. The latter kind of services also offer additional features such as security auditing, site monitoring, management of core Joomla and extension updates across multiple sites, even backup testing automation in some cases.

The downside of third party services is that they cost money. You can alternatively have an always on-line computer (even a cheap Raspberry Pi would do!) run backups remotely using CRON jobs, either using the Legacy Frontend Backup URL or the modern Akeeba Backup JSON API. In the latter case you'd need to set up Akeeba Remote CLI on the always on-line computer. The always on-line computer can run any of the three major Operating Systems: Windows, macOS or Linux. 

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!

cityofeagan

Thank you for the quick response.

You are correct: the back up initiated from the Joomla dashboard completes successfully. I will contact our hosting provider to increase the CPU time limit.

In addition to the timeout, a cron job will periodically return the following: 

 

Taking a backup with Akeeba Backup

==================================

Starting backup using profile #2.

---------------------------------

In Factory.php line 126:

                                                                              

Argument 1 passed to Akeeba\Engine\Factory::unserialize() must be of the ty

pe string, null given, called in /home/customer/www/cityofeagan.com/public_

html/administrator/components/com_akeebabackup/engine/Factory.php on line 3

03                                                                          

                                                                              

akeeba:backup:take [--profile [PROFILE]] [--description [DESCRIPTION]] [--comment [COMMENT]] [--overrides [OVERRIDES]] [--live-site [LIVE-SITE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--] <command>

 

 

Is this also related to the timeout, or is this a separate issue? This happens intermittently; maybe every 4 or 5 automated backups. 

tampe125
Akeeba Staff

mhm... this feels a different issue. When this happens, can you please attach the log of the failed backup? I have an hunch about what's going on, but I'd wish to double check before doing a blind change.

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!

cityofeagan

Hi Davide,
I have the applicable information at the links listed below. The output log files contain almost no information, so hopefully the Joomla debug page I included provides some insight.

Please let me know if more information is needed.

This zip file contains the markup and assets for the warning message displayed in the Joomla dashboard:
https://securefiles.cityofeagan.com/link/83M2ZJFeq5f0mLfffLmbEm

This zip file contains the log files (akeeba.cli.id-20230418-164502-409048.log.php & akeeba.log) output to the designated backup directory, and the log file downloaded using the backup manager in the Joomla dashboard (Akeeba Backup Debug Log.txt):
https://securefiles.cityofeagan.com/link/XP8dNfu8FmL4nbVVUEtqm4

Thank you.

tampe125
Akeeba Staff

So you get this error both on CLI and in the web section of the component, right?

Does this happen after a CLI backup failure?

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!

cityofeagan

The zipped web page I made available is the error we get in Joomla after a CLI cron job fails, but it appears to be a separate issue from the CPU usage limit timeout we spoke about earlier in this thread. When this happens, I think the cron job fails on launch as there is no content in the log files.

Below is the body of the email I receive from the corresponding failed cron job:

Taking a backup with Akeeba Backup
==================================

Starting backup using profile #2.
---------------------------------

 

In Factory.php line 126:

Argument 1 passed to Akeeba\Engine\Factory::unserialize() must be of the ty
pe string, null given, called in /home/customer/www/cityofeagan.com/public_
html/administrator/components/com_akeebabackup/engine/Factory.php on line 3
03

akeeba:backup:take [--profile [PROFILE]] [--description [DESCRIPTION]] [--comment [COMMENT]] [--overrides [OVERRIDES]] [--live-site [LIVE-SITE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--] <command>

 

To be clear: the only issues were are experiencing are from automated backups initiated by cron jobs with our hosting service. I don't recall ever having a manual (Joomla initiated) backup fail.

tampe125
Akeeba Staff

Ok, now it makes sense: you get a broken record generated in CLI and when the GUI tries to parse it you get a fatal error.

Please get in touch with your host with the solution suggested above

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!

cityofeagan

Thank you for all the help!

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!