Comments (4)
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.
@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.
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.
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)
- Consider adding a Dockerfile for development?
- Point README badge to CircleCI
- Fix CI Build HOT 4
- Evaluate making ActiveFedora an optional dependency. HOT 1
- Add support for Ruby 2.7.z releases
- Add support for Rails 6.0.z releases HOT 1
- Hydra::Derivatives::Processors::Jpeg2kImage.level_count_for_size can return -1 HOT 3
- "gray" vs "grey" breaking default jp2k recipe lookup? HOT 2
- Use more universally-compatible pixel format for mp4 derivatives HOT 1
- Add Circle CI step that fails if branch name is master
- Add language to README about branch naming
- Update CONTRIBUTING.md to match the maintenance template
- Update references of hard-coded legacy master branch name to main branch name
- Support Rails 6.1 releases HOT 1
- Support Ruby 3.0 releases HOT 2
- Configure nightly CircleCI test suite executions
- Update the gemspec to require MFA for RubyGems releases
- Identify a new Product Owner HOT 1
- IO::EAGAINWaitReadable error in ShellBasedProcessor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hydra-derivatives.