Support

Akeeba Backup for Joomla!

#33518 Onedrive Accesses Token is deleted after saving

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
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by on Wednesday, 16 September 2020 17:17 CDT

skydog

Please look at the bottom of this page (under Support Policy Summary) for our support policy summary, containing important information regarding our working hours and our support policy. Thank you!

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 2Mb, please upload it on your server and post a link to it.

Description of my issue:

 

Hello,

if I want to connect my Onedrive account to Akeeba this will also work. I log in to Ondrive, enter my email address and password. Assign the corresponding folder and click on "Complete OneDrive authentication". The fields Access Token and Refresh Token will be filled in as well. If I save the configuration now, the message "The configuration has been saved" will appear. If I make a backup now, the upload does not work. When I make a backup now Akeeba uploads this to Onedrive. But on the next backup the two errors Access Token and Refresh Token are empty again and the backup is not uploaded anymore. Is this problem already known?

nicholas
Akeeba Staff
Manager

I am a bit confused about your description of what is going on. You said “If I make a backup now, the upload does not work. When I make a backup now Akeeba uploads this to Onedrive”. So, which one is it? Can you or can you not upload to OneDrive?

If you can upload to OneDrive its credentials will stay put and your problem cannot possibly occur.

If you CAN NOT upload to OneDrive there is a set of conditions where repeated failures would indeed make your OneDrive credentials be removed from the configuration.

If the authentication to OneDrive works BUT uploading to it through Akeeba Backup doesn't the problem is most likely a firewall or proxy your host put between your server ("server" here can mean a physical or virtual machine) and the Internet. We've seen many cases where a firewall was blocking all outbound access from the server or a misconfigured caching proxy was returning misleading information, ignoring the fact that it should never cache the results of POST and PUT requests per the standard.

You might wonder why setting up OneDrive would work in this case. It happens entirely through your browser. No information is sent from your server to the outside world or vice versa.

Moreover, you might see that the very first backups – taken within 3600 seconds of authorising OneDrive – work but subsequent backups fail. This has to do with how OneDrive works. When you authenticate you get an access token valid for 3600 seconds and a refresh token. When the access token expires your server needs to contact our server (www.akeeba.com) which acts as a mediator between your site and OneDrive for the purposes of authentication as detailed in the documentation. If that connection fails due to a server firewall / proxy, or you have not entered your Download ID, or the Download ID is invalid, or the Download ID is for an expired subscription then the renewal of the access token with the refresh token fails. Therefore the upload fails. After three retries the refresh token is considered invalid and removed from your configuration.

However, before passing judgement I need you to a. tell me if you can or cannot upload to OneDrive after setting up its connection in the Configuration page and b. ZIP and attach the backup log file from this first backup attempt and the next backup attempt. The two backup attempts need to be at least one hour apart for me to draw any useful conclusions.

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!

skydog

Hello, Nicholas,
Thank you for your answer. I have made some screenshots to illustrate my problem.

In the first and second step I successfully connect to Onedrive

In the third step I create the backup successfully and the zip file is also transferred to Onedrive

In the fourth step I also get visualized that the backup was successful

When I look into the configuration again after the successful backup, the Access Token and Refresh Token are deleted again and a further transfer to Onedrive is no longer possible.

Maybe now you understand what I mean :o)

nicholas
Akeeba Staff
Manager

First of all, I see that you are using the OneDrive legacy option. Please do not use that. This is an old version of the API which is no longer maintained and might fail. Try with the "Upload to Microsoft OneDrive or Microsoft OneDrive for Business" which is the new API version.

If the credentials keep disappearing after the first backup I will need you to ZIP and attach the log file of the backup you perceive as successful but results in the credentials disappearing.

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!

skydog

Hello,

I have disconnected the legacy connection and set the other option to upload to Onedrive. Backup worked but the login data was deleted again. In the attachment you can find the log file.

Thanks a lot Sven

nicholas
Akeeba Staff
Manager

Sorry, I do not see how your backup upload could have possibly worked given the log file I am seeing here. Trying to start the multipart upload fails repeatedly and Akeeba Backup reports that it will not remove the non-processed (therefore: not uploaded) file. In fact, this is why your authentication tokens disappear. If the upload fails repeatedly – even after refreshing the tokens – we assume that your setup is wrong and we remove your connection information. There's a good reason behind this. We don't want you to consume our server resources to refresh the OneDrive tokens for a backup that is doomed to fail.

Looking at your log file I see something troubling. When we try to start the multipart upload we do NOT receive a valid result from OneDrive. We receive the value "1" which has no meaning and cannot come from OneDrive. It also comes too fast. Way too fast. As if the request never made it to OneDrive, really.

Based on our experience we know what this means: your host is running a caching proxy server in front of your web server, catching all outbound requests and returning cached results for them. However, the Internet standards (RFCs) expressly state that caching proxies MUST NOT cache PUT and POST requests like the ones we are sending to OneDrive. In a nutshell, the problem happens because your host has misconfigured their server.

You need to contact your host. Show them my reply here so they have an idea what to look for. Please note that you will most definitely have to escalate your issue past their first level support. First level support would neither know if they are running a caching proxy nor what its configuration is. You will need to talk to one of their network engineers to resolve this.

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!