Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync DropBox failed #130

Closed
Iraecio opened this issue Feb 5, 2018 · 10 comments
Closed

Sync DropBox failed #130

Iraecio opened this issue Feb 5, 2018 · 10 comments
Assignees
Labels
Milestone

Comments

@Iraecio
Copy link

Iraecio commented Feb 5, 2018

Exception 'phpbu\App\Backup\Sync\Exception' with message 'Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": path: 'development/mysql-20180204-2253.sql.bz2' did not match pattern '(/(.|[\r\n]))|(ns:[0-9]+(/.)?)|(id:.*)''
in phar://......./phpbu.phar/Backup/Sync/Dropbox.php:87

@sebastianfeldmann
Copy link
Owner

Which phpbu version are you unsing?

@Iraecio
Copy link
Author

Iraecio commented Feb 5, 2018

5.0.9

@sebastianfeldmann
Copy link
Owner

Looks like the Dropbox API is throwing an exception :/
Can you confirm the backup is indeed created and the path is correct?
I’ll investigate this further as soon as I’m back on my desk

@Iraecio
Copy link
Author

Iraecio commented Feb 5, 2018

sem titulo

Exception 'phpbu\App\Backup\Sync\Exception' with message 'Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": path: 'backups/mysql-20180205-0020.sql.bz2' did not match pattern '(/(.|[\r\n]))|(ns:[0-9]+(/.)?)|(id:.*)''
in phar://....../phpbu.phar/Backup/Sync/Dropbox.php:87

and in dropbox has folder backups to store files

@sebastianfeldmann
Copy link
Owner

Can you share your config file?
Off course, please replace all sensitive data with ”*”.
Thank you ;)

@Iraecio
Copy link
Author

Iraecio commented Feb 5, 2018

same of example with only backups source and syncs dropbox

@Iraecio
Copy link
Author

Iraecio commented Feb 5, 2018

{ "verbose": true, "logging": [ { "type": "json", "target": "data\/logs\/backup.json" } ], "backups": [ { "name": "DataBase", "source": { "type": "mysqldump", "options": { "databases": "development", "user": "*********", "password": "***********", "pathToMysqldump": "********/mysql\/bin" } }, "target": { "dirname": "data\/backup", "filename": "mysql-%Y%m%d-%H%i.sql", "compress": "bzip2" }, "syncs": [ { "type": "dropbox", "options": { "token": "**************************", "path": "backups" } } ] } ] }

@sebastianfeldmann
Copy link
Owner

sebastianfeldmann commented Feb 7, 2018

Sorry it took a while, but I finally could reproduce your error.

The Problem is, there is a slash missing in the dropbox configuration.
In your configuration is states "backups".
It should be

{ "type": "dropbox", "options": { "token": "***", "path": "/backups" }

That did the trick for me.
I'll add a option validator for this, so there will be a nicer exception message.

@sebastianfeldmann
Copy link
Owner

sebastianfeldmann commented Feb 7, 2018

In fact I decided to not throw an Exception. Instead I make sure that the Dropbox path always contains a leading /.
If not provided by the configuration I will add it manually.
Fix will be included in 5.1.0

@sebastianfeldmann sebastianfeldmann added this to the 5.1.0 milestone Feb 7, 2018
@sebastianfeldmann sebastianfeldmann self-assigned this Feb 7, 2018
@Iraecio
Copy link
Author

Iraecio commented Feb 7, 2018

Thx. this Work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants