Sidekiq setup with Hyrax - problems attaching files to a work

125 views
Skip to first unread message

Kerchner, Daniel

unread,
Sep 6, 2017, 4:14:00 PM9/6/17
to samver...@googlegroups.com
Any help or advice with the following issue would be greatly appreciated!

I have a reasonably vanilla Hyrax 1.0.4 based application.  Ingesting new works, attaching files, etc. all works fine when my queue adapter is set to :inline .  However, I run into issues attaching files if I configure it to use the :sidekiq adapter as per the instructions at https://github.com/samvera/hyrax/wiki/Using-Sidekiq-with-Hyrax .  The file simply doesn't attach after I save the work.  I can successfully save edits to the Work's metadata, but can't attach files.

Redis is running and is being invoked (as verified by redis-cli monitor) so that's not an issue.

Here's the error as it appears at http://my-hyrax-app/sidekiq/retries :

Next Retry Retry Count Queue Job Arguments Error
3 ingest AttachFilesToWorkJob
{"_aj_globalid"=>"gid://scholarspace/GwWork/x346d4165"}, [{"_aj_globalid"=>"gid://scholarspace/Hyrax::UploadedFile/34"}]
ActiveJob::DeserializationError: Error while trying to deserialize arguments: Model mismatch. Expected GwWork. Got: FileSet
3 ingest ContentUpdateEventJob
{"_aj_globalid"=>"gid://scholarspace/GwWork/x346d4165"}, {"_aj_globalid"=>"gid://scholarspace/User/1"}
ActiveJob::DeserializationError: Error while trying to deserialize arguments: Model mismatch. Expected GwWork. Got: FileSet

Or for the more graphically inclined:

Inline image 1

Has anyone encountered this, or is anyone knowledgeable enough to suggest where I might try looking for the possible cause?

Thanks!!

Dan Kerchner
Senior Software Developer, Scholarly Technology Group
The George Washington University Libraries
Gelman Library
2130 H Street, NW
Washington, DC 20052
kerc...@gwu.edu




Mike Giarlo

unread,
Sep 6, 2017, 5:44:29 PM9/6/17
to samver...@googlegroups.com
Hi Dan,

I spun up a clean new instance of 1.0.4 and could not reproduce the error -- I was able to upload multi-file works using Sidekiq for background jobs. In your instance, can you look at the object corresponding to the id of 'x346d4165' and see what sort of thing it is? You should be able to do that in the Rails console via ActiveFedora::Base.find('x346d4165').class and it should return 'GwWork'. I wouldn't expect an error like this to occur solely because your ActiveJob queue adapter changed.

--
Michael J. Giarlo
Technical Manager, Hydra-in-a-Box project
Software Architect, Digital Library Systems & Services
Stanford University Libraries

________________________________________
From: samver...@googlegroups.com <samver...@googlegroups.com> on behalf of Kerchner, Daniel <kerc...@email.gwu.edu>
Sent: Wednesday, September 6, 2017 13:13
To: samver...@googlegroups.com
Subject: [samvera-tech] Sidekiq setup with Hyrax - problems attaching files to a work

Any help or advice with the following issue would be greatly appreciated!

I have a reasonably vanilla Hyrax 1.0.4 based application. Ingesting new works, attaching files, etc. all works fine when my queue adapter is set to :inline . However, I run into issues attaching files if I configure it to use the :sidekiq adapter as per the instructions at https://github.com/samvera/hyrax/wiki/Using-Sidekiq-with-Hyrax . The file simply doesn't attach after I save the work. I can successfully save edits to the Work's metadata, but can't attach files.

Redis is running and is being invoked (as verified by redis-cli monitor) so that's not an issue.

Here's the error as it appears at http://my-hyrax-app/sidekiq/retries :

Next Retry Retry Count Queue Job Arguments Error
right now<https://ec2-54-197-74-246.compute-1.amazonaws.com/sidekiq/retries/1504725060.977368-8f88f77e7110563c43aaf364> 3 ingest<https://ec2-54-197-74-246.compute-1.amazonaws.com/sidekiq/queues/ingest> AttachFilesToWorkJob
{"_aj_globalid"=>"gid://scholarspace/GwWork/x346d4165"}, [{"_aj_globalid"=>"gid://scholarspace/Hyrax::UploadedFile/34"}]

ActiveJob::DeserializationError: Error while trying to deserialize arguments: Model mismatch. Expected GwWork. Got: FileSet

in 44 seconds<https://ec2-54-197-74-246.compute-1.amazonaws.com/sidekiq/retries/1504725097.9560544-1c3131a05ebbbb79da5ab83f> 3 ingest<https://ec2-54-197-74-246.compute-1.amazonaws.com/sidekiq/queues/ingest> ContentUpdateEventJob
{"_aj_globalid"=>"gid://scholarspace/GwWork/x346d4165"}, {"_aj_globalid"=>"gid://scholarspace/User/1"}

ActiveJob::DeserializationError: Error while trying to deserialize arguments: Model mismatch. Expected GwWork. Got: FileSet


Or for the more graphically inclined:

[Inline image 1]

Has anyone encountered this, or is anyone knowledgeable enough to suggest where I might try looking for the possible cause?

Thanks!!

Dan Kerchner
Senior Software Developer, Scholarly Technology Group
The George Washington University Libraries
Gelman Library
2130 H Street, NW
Washington, DC 20052
kerc...@gwu.edu<mailto:kerc...@gwu.edu>




--
You received this message because you are subscribed to the Google Groups "samvera-tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to samvera-tech...@googlegroups.com<mailto:samvera-tech...@googlegroups.com>.
To post to this group, send email to samver...@googlegroups.com<mailto:samver...@googlegroups.com>.
Visit this group at https://groups.google.com/group/samvera-tech.
To view this discussion on the web visit https://groups.google.com/d/msgid/samvera-tech/CAHhv_RHv1aw2jJkEcsN33xaeZgGhSOAartt42cztWMYReNb%3Ddg%40mail.gmail.com<https://groups.google.com/d/msgid/samvera-tech/CAHhv_RHv1aw2jJkEcsN33xaeZgGhSOAartt42cztWMYReNb%3Ddg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
image.png

Kerchner, Daniel

unread,
Sep 12, 2017, 1:00:56 PM9/12/17
to samver...@googlegroups.com
Hi Mike,

Thanks for setting up an instance and confirming that you were not able to reproduce the error.  It turns out my experimentation had caused some Files to not be attached to their Works properly, so I think the issues below were related to weirdly-formed items (the particular example below did infact show to be of class GwWork, at the rails console). 

For the moment, I've reverted to :inline processing, but will give another shot at setting up Sidekiq soon, without the corrupted objects!

Thanks,
Dan







--
You received this message because you are subscribed to the Google Groups "samvera-tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to samvera-tech+unsubscribe@googlegroups.com<mailto:samvera-tech+unsu...@googlegroups.com>.
To post to this group, send email to samver...@googlegroups.com<mailto:samvera-tech@googlegroups.com>.
--
You received this message because you are subscribed to the Google Groups "samvera-tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to samvera-tech+unsubscribe@googlegroups.com.
To post to this group, send email to samver...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages