GeezerVison is showing github.com — Check ActiveStorage setup · Issue #1510 · openHPI/codeharbor
Check ActiveStorage setup #1510
Description
Lately, we encountered a few issues with attachments through ActiveStorage. Thus, we should validate our integration:
- Ensure files get removed completely through ActiveStorage. This includes:
- Deleting the attachment (keeping the record otherwise) removes the database entry (in internal ActiveStorage tables) and the file on disk.
- Completely removing the record also removes database entries and files.
- All relevant files (i.e., resized images) are considered.
- Provide a simple script to check that all files in
/storage are referenced in the database and vice versa. Further, each object referenced in the internal ActiveStorage tables should still exist and not be soft-deleted (users!). This script is intended to run on production once.
Activity
kkoehn commented on May 6, 2025
I did some testing. When solidqueue is running, deletion of file added to tasks works fine (locally for me solidqueue keeps crashing, so some files stay)
Files uploaded for importing don't get deleted automatically, but would be deleted when a cleanup for ImportCacheFiles happens (there is a rake task for that).
MrSerth commented on May 6, 2025
Thanks for testing and summarizing your findings. I've checked production as well and extracted the following next steps:
- We should fix your SolidQueue setup (through Slack)
- We should migrate from Whenever to SolidQueue for recurring tasks. The whenever setup is, once again, broken since no secret key base is currently passed to the jobs started through whenever. We had similar problems before, mainly because the environment a cron job is running from is often not identical to the regular environment the server process is executed. Also, maintaining the whenever config is an additional step during deployment. I would consider a full switch to SolidQueue here, which supports recurring tasks well (and does not come with the same issues). Both CodeOcean and CodeHarbor are affected. Consequently, the rake task is not executed properly right now.
- Feel free to tick the check boxes above for everything you checked; maybe we just saw a temporary issue back then.
Metadata
Metadata
Development
No branches or pull requestsIssue actions