jazzband / django-dbbackup

Management commands to help backup and restore your project database and media files
BSD 3-Clause "New" or "Revised" License
970 stars 221 forks source link

dbrestore command fails with dropbox #289

Open kiddhustle opened 6 years ago

kiddhustle commented 6 years ago

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 commented 5 years ago

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

Spacehug commented 4 years ago
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 commented 3 years ago

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 commented 2 years ago

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