Apache Libcloud detect Google Storage as S3

Issue #211 new
Edwin Lunando
created an issue

So, I my Django app is treating Google Storage as Amazon S3. Here are my storage configuration.

INSTALLED_APPS = INSTALLED_APPS + ('storages',)

########## STORAGE CONFIGURATION

STATIC_URL = 'http://storage.googleapis.com/xxx-xxx/'

STATICFILES_STORAGE = 'storages.backends.apache_libcloud.LibCloudStorage'

DEFAULT_LIBCLOUD_PROVIDER = 'google'

LIBCLOUD_PROVIDERS = {
    'google': {
        'type': 'libcloud.storage.types.Provider.GOOGLE_STORAGE',
        # 'type': 'libcloud.storage.types.GOOGLE_STORAGE',
        # 'type': 'google_storage',
        'user': 'xxx-xxx',
        'key': 'xxx-xxx',
        'bucket': 'xxx-xxx',
    },
}

when I ran collectstatic, here is the stacktrace.

Traceback (most recent call last):
  File "kuliahkita/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/core/management/base.py", line 533, in handle
    return self.handle_noargs(**options)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle_noargs
    collected = self.collect()
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 107, in collect
    handler(path, prefixed_path, storage)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 305, in copy_file
    if not self.delete_file(path, prefixed_path, source_storage):
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 218, in delete_file
    if self.storage.exists(prefixed_path):
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/storages/backends/apache_libcloud.py", line 79, in exists
    obj = self._get_object(name)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/storages/backends/apache_libcloud.py", line 66, in _get_object
    return self.driver.get_object(self.bucket, clean_name)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/libcloud/storage/drivers/s3.py", line 314, in get_object
    container = self.get_container(container_name=container_name)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/libcloud/storage/drivers/s3.py", line 303, in get_container
    method='HEAD')
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/libcloud/common/base.py", line 683, in request
    response = responseCls(**kwargs)
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/libcloud/common/base.py", line 116, in __init__
    raise Exception(self.parse_error())
  File "/home/edwinlunando/.virtualenvs/kuliahkita/local/lib/python2.7/site-packages/libcloud/storage/drivers/s3.py", line 87, in parse_error
    driver=S3StorageDriver)
libcloud.common.types.LibcloudError: <LibcloudError in <class 'libcloud.storage.drivers.s3.S3StorageDriver'> 'Unknown error. Status code: 500'>

Any idea?

Comments (2)

  1. Log in to comment