Skip to content
New issue

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

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

Already on GitHub? # to your account

dbrestore - dropbox error #161

Closed
napyk opened this issue May 7, 2016 · 9 comments
Closed

dbrestore - dropbox error #161

napyk opened this issue May 7, 2016 · 9 comments
Assignees
Labels
bug Bugs that need to get fixed. storage/general

Comments

@napyk
Copy link

napyk commented May 7, 2016

I managed to set up the dropbox token and created an app, the local backup and restore works fine.

But when i try to backup with dropbox i get the following error:

C:\Users\NP\Dropbox\Neuer Ordner\django_test\mysite>python manage.py dbbackup
Backing Up Database: C:\Users\NP\Dropbox\Neuer Ordner\django_test\mysite\db.sqlite3
Reading: C:\Users\NP\Dropbox\Neuer Ordner\django_test\mysite\db.sqlite3
Backup tempfile created: 70.0 KiB
Writing file to Dropbox: , filename: C:\Users\NP\Dropbox\Neuer Ordner\django_test\mysi\db-DESKTOP-9CJ0R9K-2016-05-07-100800.sqlite
    Uploaded 100.0%
    Commit to C:\Users\NP\Dropbox\Neuer Ordner\django_test\mysite\db-DESKTOP-9CJ0R9K-2016-05-07-100800.sqlite.0
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python34\lib\site-packages\django\core\management\base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Python34\lib\site-packages\django\core\management\base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "C:\Python34\lib\site-packages\dbbackup\utils.py", line 96, in wrapper
    func(*args, **kwargs)
  File "C:\Python34\lib\site-packages\dbbackup\management\commands\dbbackup.py", line 59, in handle
    self._save_new_backup(database)
  File "C:\Python34\lib\site-packages\dbbackup\management\commands\dbbackup.py", line 90, in _save_new_backup
    self.storage.write_file(outputfile, filename)
  File "C:\Python34\lib\site-packages\dbbackup\storage\dropbox_storage.py", line 119, in write_file
    self.dropbox.commit_chunked_upload(numbered_file_full_path, upload_id)
  File "C:\Python34\lib\site-packages\dropbox\client.py", line 309, in commit_chunked_upload
    return self.rest_client.POST(url, params, headers)
  File "C:\Python34\lib\site-packages\dropbox\rest.py", line 322, in POST
    return cls.IMPL.POST(*n, **kw)
  File "C:\Python34\lib\site-packages\dropbox\rest.py", line 260, in POST
    is_json_request=is_json_request)
  File "C:\Python34\lib\site-packages\dropbox\rest.py", line 235, in request
    raise ErrorResponse(r, r.read())
dropbox.rest.ErrorResponse: [400] {'path': 'The root path ("/") is not allowed.'}

in my settings.py I added:

DBBACKUP_STORAGE = 'dbbackup.storage.dropbox_storage'
DBBACKUP_TOKENS_FILEPATH = BASE_DIR+'/dropbox_token'
DBBACKUP_DROPBOX_APP_KEY = 'my key'
DBBACKUP_DROPBOX_APP_SECRET = 'my secret'

i also tried to specify a dropbox path in settings.py with:

DBBACKUP_DROPBOX_DIRECTORY = "test"

but it gave me the same error

Am i missing something?
im really desperate because it looks like im the only one with this error?

@ZuluPro
Copy link
Contributor

ZuluPro commented May 7, 2016

Hello @NiPKIT,
As DBBackup is a backup tool, this Dropbox storage will be remove.
Could you try with the one in Django Storage (Redux) ?

@ZuluPro ZuluPro self-assigned this May 7, 2016
@ZuluPro ZuluPro added the bug Bugs that need to get fixed. label May 7, 2016
@napyk
Copy link
Author

napyk commented May 7, 2016

So dbbackup is only for local backup/restore and dropbox is not supported anymore?
I will try it with redux

@ZuluPro
Copy link
Contributor

ZuluPro commented May 7, 2016

@NiPKIT
We want to let only file system storage because DBBackup must not be a collection of storages.

The Dropbox storage in redux has been wrote by myself to deprecate the one in DBBackup.

@ZuluPro
Copy link
Contributor

ZuluPro commented Jul 31, 2016

The dropbox code is moved to django-storage. I made a PR to ensure it will work with DBBackup.

Do not hesitate to give 👍 for speed up merging.

@ZuluPro ZuluPro closed this as completed Jul 31, 2016
@bhandariroshan
Copy link

how do I use it to store files in my folder to dropbox? The django-dbbackup documentation was simple but the same error pops up everytime I try and in the django-storages the documentation is not clear.

@ZuluPro
Copy link
Contributor

ZuluPro commented Aug 16, 2016

Hello @bhandariroshan
Can you give us more about your configuration: Django, DBBackup versions

DBBackup V3 is coming and will use Django-storages backend. You can already use is with V2 and DJANGO_BUILTIN_STORAGE setting.

@bhandariroshan
Copy link

bhandariroshan commented Aug 19, 2016

I am using following in my common.py

DBBACKUP_STORAGE = 'dbbackup.storage.dropbox_storage'
DBBACKUP_TOKENS_FILEPATH = 'dropboxkeys.txt'
DBBACKUP_DROPBOX_APP_KEY = '_'
DBBACKUP_DROPBOX_APP_SECRET = '_
'
DBBACKUP_DROPBOX_DIRECTORY = 'DB-Backup'

My installed app has following:
'dbbackup', # django-dbbackup

I get following when I run "Python manage.py dbbackup" as listed on the documentation:

Running: pg_dump --username=****** --host=localhost --port=5432 erpdb
Backup tempfile created: 895.0 B
Writing file to Dropbox: DB-Backup, filename: erpdb-Bhandari-Roshan-2016-08-19-101729.psql
Uploaded 100.0%
Commit to DB-Backup\erpdb-Bhandari-Roshan-2016-08-19-101729.psql

then following error:
dropbox.rest.ErrorResponse: [400] {'path': 'The root path ("/") is not allowed.'}

I tried different combination for dbbackup_dropbox_directory but the same error

@bhandariroshan
Copy link

Also, are you planning to add support for database backup to dropbox for docker environment?

@ZuluPro
Copy link
Contributor

ZuluPro commented Aug 19, 2016

Hello @bhandariroshan,
I think you are using DBBackup v2.5.x and v3.0.0 is coming,
In this new version, all storage has been removed from DBBackup in favor of Django-Storages ones.
In that repository you will find a DropBox storage.

I suggest you:

  • To use that third storage and DBBACKUP_BUILTIN_STORAGE setting.
  • Or install DBBackup v3 and prepare to upgrade.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Bugs that need to get fixed. storage/general
Projects
None yet
Development

No branches or pull requests

3 participants