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

dbrestore command fails with dropbox #289

Open
kiddhustle opened this issue Jul 26, 2018 · 4 comments
Open

dbrestore command fails with dropbox #289

kiddhustle opened this issue Jul 26, 2018 · 4 comments

Comments

@kiddhustle
Copy link

kiddhustle commented Jul 26, 2018

Mulltiple issues are causing this commad to fail

  1. root_path setting causes the backup destination to include the absolute path (based on the host) to the saved file (i.e. /Apps/DB_APPNAME/Users/USERNAME/PATH_TO_PROJECT/backupfile.dump)

Error

dropbox.exceptions.BadInputError: BadInputError('e0628bdd4a631a8e72fee189adef81dc', 'Error in call to API function "files/get_metadata": request body: path: The root folder is unsupported.')

  1. TypeError: 'FolderMetadata' object is not subscriptable

Versions:

django-storages==1.6.6
dropbox==9.0.0
Python==3.7

@matburnham
Copy link

This is caused by the django-storages dropbox support being out of daye. See django-storages issue #567 and django-storages PR #402.

@Spacehug
Copy link

dropbox.exceptions.BadInputError: BadInputError('632f60d694aa64d62ebb8cf43b8d98c6', 'Error in call to API function "files/list_folder": request body: path: Specify the root folder as an empty string rather than as "/".')

I don't have root folder set at all. django-storages is 1.7.2 (PR you mentioned is already merged).

@Koperfild
Copy link

Koperfild commented Aug 8, 2021

Same to me. On windows 10 with following root_path
DBBACKUP_STORAGE_OPTIONS = { "oauth2_access_token": os.getenv("DBBACKUP_DROPBOX_TOKEN"), "root_path": "/backup", }
And python manage.py dbrestore -z outputs

File "C:\Users\Evgeny\AppData\Local\pypoetry\Cache\virtualenvs\x-one-server-r2VCHkdG-py3.9\lib\site-packages\stone\backends\python_rsrc\stone_validators.py", line 345, in validate
raise ValidationError("'%s' did not match pattern '%s'"
stone.backends.python_rsrc.stone_validators.ValidationError: 'C:/backup' did not match pattern '(/(.|[\r\n]))?|id:.|(ns:[0-9]+(/.*)?)'

So on windows it appends C:\ but it shouldn't be appended

@Stally18
Copy link

Im still having the same problem as the user above. On windows too. Running the 'manage.py dbbackup' gives me

raise ValidationError("'%s' did not match pattern '%s'"
stone.backends.python_rsrc.stone_validators.ValidationError: 'C:/default-TOPGAMINGPC2020-2021-12-29-180352.psql.bin' did not match pattern '(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)'

options are
DBBACKUP_STORAGE = 'storages.backends.dropbox.DropBoxStorage'
DBBACKUP_STORAGE_OPTIONS = {'oauth2_access_token': 'token',}

setting the DROPBOX_ROOT_PATH doesnt help either

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

No branches or pull requests

6 participants