`NotImplementedError: This backend doesn't support absolute paths` error when deleting concepts using `storages.backends.s3boto3.S3Boto3Storage`
Opened this issue · 0 comments
SDScandrettKint commented
Found in Arches v6.2.9 and v7.5.
When using the STORAGES
option for S3 storages.backends.s3boto3.S3Boto3Storage
e.g like so:
STORAGES = {
"default": {
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}
attempting to delete a concept through the UI (or though the ORM) will result in the following error:
Internal Server Error: /concepts/7ae7638d-6cd9-4974-958a-afccbdebc6a3
Traceback (most recent call last):
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
return view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/samuel/arches_project_folder/arches/arches/app/views/concept.py", line 272, in concept
concept.delete(delete_self=delete_self)
File "/home/samuel/arches_project_folder/arches/arches/app/models/concept.py", line 319, in delete
models.Concept.objects.get(pk=key).delete()
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/db/models/base.py", line 1132, in delete
return collector.delete()
^^^^^^^^^^^^^^^^^^
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/db/models/deletion.py", line 512, in delete signals.post_delete.send(
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 176, in send
return [
^
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
(receiver, receiver(signal=self, sender=sender, **named))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/samuel/arches_project_folder/arches/arches/app/models/models.py", line 1221, in auto_delete_file_on_delete
if instance.value.path:
^^^^^^^^^^^^^^^^^^^
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/db/models/fields/files.py", line 62, in path
return self.storage.path(self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/samuel/arches_project_folder/env3.11/lib/python3.11/site-packages/django/core/files/storage/base.py", line 132, in path
raise NotImplementedError("This backend doesn't support absolute paths.")
NotImplementedError: This backend doesn't support absolute paths.