Open bess opened 7 years ago
Sounds like an autoload problem. Are you running with config.cache_classes=true
(this is default with RAILS_ENV=production
) that might clear it up.
@jcoyne @bess Do you suspect this is an issue in master
as well?
I have never seen this case before, so I have no idea where it may surface.
This problem does not exist in our production environment. Hooray! I am also working around it locally by removing the acquire_lock_for(work.id)
line while I'm in development mode. Do you consider this an actual bug if it isn't present in the production environment? It seems worth documenting, at least. I'm sure I won't be the last person to encounter this.
The bug is real, but autoloading issues are a pain to debug, sometimes relying on system-dependent filesystem ordering.
Descriptive summary
In Hyrax 1.0.1, when I attempt to attach a file to a work via
AttachFilesToWorkJob
it fails with the errorA copy of Hyrax::Lockable has been removed from the module tree but is still active!
Rationale
I need to import legacy data into Hyrax and have it go through the same processing that works uploaded through the UI go through.
Steps to reproduce the behavior
etd = FactoryGirl.create(:etd)
Hyrax::UploadedFile
object with a file attached:uf = Hyrax::UploadedFile.create(file: File.open("#{::Rails.root}/spec/fixtures/joey/joey_thesis.pdf"))
Hyrax::UploadedFile
object to the work:AttachFilesToWorkJob.perform_now(a, [uf])
It starts to work, makes it through a few jobs, then fails:
Possibly related: https://stackoverflow.com/questions/29636334/a-copy-of-xxx-has-been-removed-from-the-module-tree-but-is-still-active