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

TypeError: __init__() got an unexpected keyword argument 'access_key' #406

Open
RogueOverride opened this issue Nov 30, 2021 · 1 comment

Comments

@RogueOverride
Copy link

Bug Report

Describe the bug

When trying to use Amazon S3 storage back end for storing the backups, I get an error saying 'access_key' is an unexpected argument. I am following accordingly to the documentation.

To Reproduce

DBBACKUP_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
DBBACKUP_STORAGE_OPTIONS = {
    'access_key': 'my-access-key',
    'secret_key': 'my-secret-key',
    'bucket_name': 'my-bucket-name',
    'default_acl': 'private',
    'location': "database/"
}

After performing the command to create a backup I get the following:

/opt/project/src # python manage.py dbbackup
TypeError: __init__() got an unexpected keyword argument 'access_key'
  File "/usr/local/lib/python3.8/site-packages/dbbackup/utils.py", line 118, in wrapper
    func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/dbbackup/management/commands/dbbackup.py", line 52, in handle
    self.storage = get_storage()
  File "/usr/local/lib/python3.8/site-packages/dbbackup/storage.py", line 30, in get_storage
    return Storage(path, **options)
  File "/usr/local/lib/python3.8/site-packages/dbbackup/storage.py", line 67, in __init__
    self.storage = self.storageCls(**options)

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.8/site-packages/dbbackup/utils.py", line 118, in wrapper
    func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/dbbackup/management/commands/dbbackup.py", line 52, in handle
    self.storage = get_storage()
  File "/usr/local/lib/python3.8/site-packages/dbbackup/storage.py", line 30, in get_storage
    return Storage(path, **options)
  File "/usr/local/lib/python3.8/site-packages/dbbackup/storage.py", line 67, in __init__
    self.storage = self.storageCls(**options)
TypeError: __init__() got an unexpected keyword argument 'access_key'

Expected behavior

I expected it to act much like sending the file to a local file system location:

/opt/project/src # python manage.py dbbackup
Backing Up Database: dbname
Writing file to database_2021-11-30-213631.sql

Versions

  • cssselect2==0.4.1
  • Django==2.2.17
  • django-dbbackup==3.3.0
  • django-storages==1.12.3
  • mysqlclient==2.1.0

External tools

  • Docker Image: python:3.8.3-alpine
  • Django: 2.2.17
@johnthagen
Copy link
Contributor

Please try the 4.0.0b0 build (#415) and report if this issue still occurs.

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

No branches or pull requests

2 participants