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

Handle buckets with retention policy #50

Open
leocape opened this issue Oct 24, 2022 · 1 comment
Open

Handle buckets with retention policy #50

leocape opened this issue Oct 24, 2022 · 1 comment

Comments

@leocape
Copy link

leocape commented Oct 24, 2022

The bucket that I want to upload the file to has a retention policy, ie. files in it cannot be deleted.

After the file is copied to the target folder, the module attempts to delete the tmp folder that was created - which returns a 403 Object 'xxxx/uploads/tmp/1666619955-603810510513191-0001-1813/xxxxxx.jpg' is subject to bucket's retention policy and cannot be deleted, overwritten or archived until 2027-10-24T13:01:49.373695-07:00

Is there something we can do to avoid using the bucket for the tmp directory - such as copy the file directly to the target folder?

(I noticed in the store method there is a flag delete_tmp_file_after_storage that presumably could be used as a workaround to prevent attempting to delete tmp file, but that isn't ideal as we would then be storing doubles for each file ie double the storage cost etc)

Thanks

Gems:

  • carrierwave 2.2.2
  • carrierwave-google-storage-1.0.0
@leocape
Copy link
Author

leocape commented Oct 25, 2022

Further - this plugin's design also essentially precludes the ability to change storage types as well, as deleting a file while using anything other than 'Standard storage' has an 'early delete cost to it

This plugin should really be refactored in a way that it does not temporarily upload the file and then copy it, and then delete the original.

What is the benefit of uploading it first, only to copy it and delete the original?

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

1 participant