Support

Akeeba Backup for WordPress

#38296 Akeeba automatic backups via cron jobs failed

Posted in ‘Akeeba Backup for WordPress’
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

WordPress version
multiple websit
PHP version
n/a
Akeeba Backup version
from 7.1.4.2 - 7.6.9

Latest post by nicholas on Tuesday, 10 January 2023 05:09 CST

marogiannis

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.

 

We are using your plugin akeeba backups to automatically back up several of our sites.  Back in July, everything worked correctly and the backing up progress was successful. Now a large number of our sites are failing with the following quote reason:
Disk Usage Warning: The user  ( Website ) has reached their disk quota
We checked and figured it was due to the Google Drive Authentication tokens. Due to the reason above, the sites did not send the backup in smaller chunks to google drive but kept all the files locally and maxed out their disk quota
We need to have this fixed because everything is set up to backup every six months, and the whole purpose of the plugin is to do it for us, not having us go manually to fix the tokens and back up the site   Time is crucial here, we have sites failing the backup every day        jul 20 2022 backup seccesfull aug 3 2022 backup seccesfull today(10/1/2022) backup failed

nicholas
Akeeba Staff
Manager

Google Drive access tokens have a lifespan of one hour and Google Drive refresh tokens have a lifespan of a month. We expect the access tokens to expire, even during the course of a backup, and do check for that. In fact, we're using the refresh tokens to get fresh access tokens.

If the refresh tokens have expired there is no solution other than reauthenticating with Google Drive. That's how Alphabet has designed their Google Drive service; refresh tokens expire after about a month to prevent "inactive" refresh tokens leaked to malicious actors from being used to gain access to your files. Their whole OAuth2 authentication is based on the premise that tokens are going to be used "regularly" to access files in your Google Drive.

The problem is that you want to only run this once every 6 months. There is really no way to do that with Google Drive. We cannot instruct Google Drive to deliver "permanent" refresh tokens, or at least control the expiration date of the refresh tokens.

Even if you would use a third party service which exposes Google Drive over WebDAV (so you can use Akeeba Backup's Upload to WebDAV feature instead) you'd still run into the same problem if it's only used once every six months: the refresh token acquired by the 3rd party service would still expire in the meantime. As I said, this is a Google Drive limitation, not a limitation imposed by any software or service connecting to Google Drive. Likewise, if you had a computer with the Google Drive client and left it dormant for over a month you'd find that you still have to reauthenticate to Google Drive upon booting it after 1 month or longer for the exact same reason, which is to say that even Google Drive's own software is hit by the same limitation.

You can either back up those sites much more frequently (every 30 days at most) to keep the refresh tokens active OR you can use something which does not use OAuth2 authentication such as Amazon S3, Backblaze B2, or even an Internet-connected NAS at your office.

I would recommend taking bi-weekly (once every 2 weeks) backups and only keep the last 2 backups by enabling the Remote Quotas feature in Akeeba Backup and setting the Count Quotas setting to 2. This way you will have a recent backup (which means in case the site breaks you won't have to install 6 months worth of WordPress and plugin updates) and it will keep the Google Drive refresh token "active".

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!