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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Copy link
Owner

sebastianfeldmann commented Feb 5, 2018

Which phpbu version are you unsing?

@Iraecio

This comment has been minimized.

Copy link
Author

Iraecio commented Feb 5, 2018

5.0.9

@sebastianfeldmann

This comment has been minimized.

Copy link
Owner

sebastianfeldmann commented Feb 5, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Owner

sebastianfeldmann commented Feb 5, 2018

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

@Iraecio

This comment has been minimized.

Copy link
Author

Iraecio commented Feb 5, 2018

same of example with only backups source and syncs dropbox

@Iraecio

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.