Giter Club home page Giter Club logo

Comments (4)

jrochkind avatar jrochkind commented on July 17, 2024

Can you add details on the errors you get, copy-paste of the exception class and stack trace if it's an exception raised you're getting?

from hydra-derivatives.

 avatar commented on July 17, 2024

@jrochkind originally it was ArgumentError (string contains null byte).

I messed around for a long time thinking it was encoding problems, but then realised that switching to passing the filename instead of the file contents fixed the problem.

Error performing AttachFilesToWorkWithOrderedMembersJob (Job ID: 1e3ff450-ce4a-4e07-bf70-4796006d24d5) from Inline(default) in 13107.64ms: ArgumentError (string contains null byte):
/home/ec2-user/environment/hyrax_leaf/app/services/hyrax/persist_derivatives.rb:15:in `copy_stream'
/home/ec2-user/environment/hyrax_leaf/app/services/hyrax/persist_derivatives.rb:15:in `block in call'
/home/ec2-user/environment/hyrax_leaf/app/services/hyrax/persist_derivatives.rb:28:in `open'
/home/ec2-user/environment/hyrax_leaf/app/services/hyrax/persist_derivatives.rb:28:in `output_file'
/home/ec2-user/environment/hyrax_leaf/app/services/hyrax/persist_derivatives.rb:14:in `call'
/usr/local/rvm/gems/ruby-2.4.1/gems/hydra-derivatives-3.4.1/lib/hydra/derivatives/processors/document.rb:26:in `convert_to_format'
/usr/local/rvm/gems/ruby-2.4.1/gems/hydra-derivatives-3.4.1/lib/hydra/derivatives/processors/document.rb:13:in `encode_file'
/usr/local/rvm/gems/ruby-2.4.1/gems/hydra-derivatives-3.4.1/lib/hydra/derivatives/processors/shell_based_processor.rb:21:in `process'
/usr/local/rvm/gems/ruby-2.4.1/gems/hydra-derivatives-3.4.1/lib/hydra/derivatives/runners/runner.rb:30:in `block (2 levels) in create'
/usr/local/rvm/gems/ruby-2.4.1/gems/hydra-derivatives-3.4.1/lib/hydra/derivatives/runners/runner.rb:27:in `each'

from hydra-derivatives.

cjcolvar avatar cjcolvar commented on July 17, 2024

I think the difference is in the expected parameters of the output file service. In hydra-derivatives the default output service appears to be Hydra::Derivatives::PersistBasicContainedOutputFileService which is expecting an IO or String object:
https://github.com/samvera/hydra-derivatives/blob/master/lib/hydra/derivatives/services/persist_basic_contained_output_file_service.rb#L12
While for Hyrax the output file service is Hyrax::PersistDerivatives which expects something that responds to #read:
https://github.com/samvera/hyrax/blob/master/app/services/hyrax/persist_derivatives.rb#L8

from hydra-derivatives.

 avatar commented on July 17, 2024

Ah, thanks Chris, that makes sense, so my local hack is the way to go for this. I'll close this issue.

from hydra-derivatives.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.