[SolidMean] ForumBackup Dropbox Upload [Deleted]

You specify how many copies of the database and file backups you'd like to keep. The add-on removes the oldest ones.
 
Attention, I began some work into upgrading the DropBox v1 API to v2. I came across some issues.

1) There is not an official PHP SDK for the core DropBox interface at the moment. I can't seem to figure out if they actually plan one or not.
2) The good news is that there are 2 Github projects that provide an (unofficial) PHP SDK to the v2 API for Dropbox. The problem with these libraries is that they both require Composer to install, which means that they wouldn't be a good fit for this add-on. I don't want to have to force people to install Composer in there environments just to be able to upload a backup file to their DropBox account.

So anyway, I'm still doing some investigation. The v1 API's expiration is in June 2017, so I have a little time yet to determine a solution.
 
Attention, I began some work into upgrading the DropBox v1 API to v2. I came across some issues.

1) There is not an official PHP SDK for the core DropBox interface at the moment. I can't seem to figure out if they actually plan one or not.
2) The good news is that there are 2 Github projects that provide an (unofficial) PHP SDK to the v2 API for Dropbox. The problem with these libraries is that they both require Composer to install, which means that they wouldn't be a good fit for this add-on. I don't want to have to force people to install Composer in there environments just to be able to upload a backup file to their DropBox account.

So anyway, I'm still doing some investigation. The v1 API's expiration is in June 2017, so I have a little time yet to determine a solution.

okay, that's cool, i'm really glad to hear you're working on it. thanks for keeping us updated!
 
SneakyDave updated [SolidMean] ForumBackup Dropbox Upload with a new update entry:

8/23/2016: Upgrade to v2 DropBox API

08/23/2016
- Updated the DropBox SDK to use API v2. This library comes from https://github.com/kunalvarma05/dropbox-php-sdk, and is currently unsupported by DropBox.
- Updated PHP requirements to PHP 5.5 to support this new API version.
- After updating to this version, administrators should delete the "dropbox-sdk" directory from the xfroot/library/SolidMean/ForumBackup/DropBox/ directory if it exists.

Read the rest of this update entry...

This update includes the changes for Version 2 of the DropBox API. This also increases the minimum PHP version to 5.5. No tokens should need to be re-generated.
 
@SneakyDave - Is it just a standard upgrade required for V1 to V2 (you know, disable Add-on, upload files, upgrade xml, check options, enable), or is there anything specific needs to be done?? :D

Cheers
Paul
 
@SneakyDave
Hm, this is error, backup not created, addon is last version, and after updated "dropbox-sdk" directory from the xfroot/library/SolidMean/ForumBackup/DropBox/ was deleted.

Code:
Error Info
Kunnu\Dropbox\Exceptions\DropboxClientException: - library/SolidMean/ForumBackup/DropBox/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/Http/Clients/DropboxGuzzleHttpClient.php:67
Generated By: Unknown Account, Today at 05:16
Stack Trace
#0 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/DropBox/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/DropboxClient.php(155): Kunnu\Dropbox\Http\Clients\DropboxGuzzleHttpClient->send('https://content...', 'POST', '\xB2\xCD\xA3\x8ER\xFAs\x1A\x15S\xC0\xA4Y\x06\xA6...', Array)
#1 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/DropBox/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/Dropbox.php(250): Kunnu\Dropbox\DropboxClient->sendRequest(Object(Kunnu\Dropbox\DropboxRequest))
#2 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/DropBox/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/Dropbox.php(278): Kunnu\Dropbox\Dropbox->sendRequest('POST', '/files/upload_s...', 'content', Array, 'fnoW5P9VaM8AAAA...')
#3 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/DropBox/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/Dropbox.php(939): Kunnu\Dropbox\Dropbox->postToContent('/files/upload_s...', Array)
#4 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/DropBox/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/Dropbox.php(999): Kunnu\Dropbox\Dropbox->appendUploadSession(Object(Kunnu\Dropbox\DropboxFile), 'AAAAAAAAETB8UKZ...', 64000000, 4000000)
#5 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/DropBox/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/Dropbox.php(784): Kunnu\Dropbox\Dropbox->uploadChunked(Object(Kunnu\Dropbox\DropboxFile), '/tvorbackupmod_...', 93079154, 4000000, Array)
#6 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/DropBox/CronEntry/Backup.php(81): Kunnu\Dropbox\Dropbox->upload(Object(Kunnu\Dropbox\DropboxFile), '/tvorbackupmod_...')
#7 /home/nginx/domains/pijanitvor.com/public/library/SolidMean/ForumBackup/CronEntry/Backup.php(86): SolidMean_ForumBackup_DropBox_CronEntry_Backup->upload(Object(SolidMean_ForumBackup_Options), Object(SolidMean_ForumBackup_Helper_Log))
#8 /home/nginx/domains/pijanitvor.com/public/library/XenForo/Model/Cron.php(356): SolidMean_ForumBackup_CronEntry_Backup::saveDatabase(Array)
#9 /home/nginx/domains/pijanitvor.com/public/library/XenForo/Deferred/Cron.php(24): XenForo_Model_Cron->runEntry(Array)
#10 /home/nginx/domains/pijanitvor.com/public/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_Cron->execute(Array, Array, 7.9999990463257, '')
#11 /home/nginx/domains/pijanitvor.com/public/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999990463257, '', false)
#12 /home/nginx/domains/pijanitvor.com/public/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, 8, '', false)
#13 /home/nginx/domains/pijanitvor.com/public/deferred.php(23): XenForo_Model_Deferred->run(false)
#14 {main}
Request State
array(3) {
  ["url"] => string(39) "https://www.pijanitvor.com/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(3) {
    ["_xfRequestUri"] => string(54) "/threads/kako-kada-i-sa-kojom-varalicom-na-klena.1958/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Did this run successfully in the past? I would try reinstalling the addon. I will investigate. The error comes from the v2 SDK, so I'll have to trace it down from that.

Make sure that you just removed the dropbox-sdk directory from the xfroot/library/SolidMean/ForumBackup/DropBox directory, and no other directories.

Also, if you have the ForumBackup debug log turned on, please send me the last 50 lines of that content too, in a conversation here.
 
According to the SDK, it looks like it got a bad http response from DropBox trying to upload your file, although it doesn't indicate in your output what the error reponse is.

Code:
//Something went wrong
if ($rawResponse->getStatusCode() >= 400) {
    throw new DropboxClientException($rawResponse->getBody());
}

I'll take a look at this and share with the SDK developer to find out if there is a better way to interpret the status code.
 
Top Bottom