All threads / Using Rails ActiveStorage causes Integrity Error when trying to analyse
Ask A Question

Notifications

You’re not receiving notifications from this thread.

Using Rails ActiveStorage causes Integrity Error when trying to analyse

Neil Tonge asked in Rails

I have a lot of files already on Backblaze B2 (S3 compatible) that I wish to use with ActiveStorage. The problem is, the majority of my sites data gets populated and updated by wiping it all out and being reimported by way of an Excel document and an import script.

Basically for this app, the truth is in a spreadsheet, I KNOW it's not ideal but that's the way it is here for this app.

I do not wish to download all my files each time I do a reimport.

Therefore I am writing a rake task that creates the appropriate ActiveStorage records and associates them with the correct model instances after an import. This MOSTLY works fine. It does create everything but it then comes to analysing and it says with ActiveStorage::IntegrityError. I'm not 100% sure but I assume this is something to do with the checksum?

Currently my task can be viewed here: https://gist.github.com/rctneil/7e275e74c66dd7a6ffc804ff1d740121

Any suggestions to how I can get the analysing done and the Integrity Error to be resolved?

Thanks!

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 70,078+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.