Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with SVG and thumbnails generation rake tasks #2127

Closed
afdev82 opened this issue Jun 10, 2021 · 2 comments · Fixed by #2129
Closed

Error with SVG and thumbnails generation rake tasks #2127

afdev82 opened this issue Jun 10, 2021 · 2 comments · Fixed by #2129

Comments

@afdev82
Copy link
Contributor

afdev82 commented Jun 10, 2021

Steps to reproduce

Run one of the generate rake tasks for the picture thumbnails (eg: ´bin/rake alchemy:generate:thumbnails`) when one of the images is in SVG format.

Expected behavior

It should generate the thumbnails for the pictures.

Actual behavior

I get the following error and the task stops:

rake aborted!
Dragonfly::Shell::CommandFailed: Command failed: convert /home/antonio/Projects/SmartMirror/Server/uploads/pictures/2017/11/30/2nl1oo9qm4_Hornbach.svg -resize 80x60\> /tmp/dragonfly20210610-9700-3o9ww0.svg, exit status: 1, error: 
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/shell.rb:55:in `raise_command_failed!'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/shell.rb:46:in `run_command'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/shell.rb:14:in `run'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/content.rb:216:in `run'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/content.rb:175:in `shell_update'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/image_magick/processors/convert.rb:14:in `call'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/content.rb:99:in `process!'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/image_magick/processors/thumb.rb:29:in `call'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/job/process.rb:23:in `apply'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/job.rb:119:in `block in apply'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/job.rb:119:in `each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/job.rb:119:in `apply'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/dragonfly-1.3.0/lib/dragonfly/job.rb:250:in `result'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/2.7.0/forwardable.rb:229:in `to_file'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/bundler/gems/alchemy_cms-f95af6e82139/app/models/alchemy/picture_thumb/create.rb:19:in `call'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/bundler/gems/alchemy_cms-f95af6e82139/app/models/alchemy/picture_thumb.rb:52:in `block in generate_thumbs!'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/bundler/gems/alchemy_cms-f95af6e82139/app/models/alchemy/picture_thumb.rb:42:in `each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/bundler/gems/alchemy_cms-f95af6e82139/app/models/alchemy/picture_thumb.rb:42:in `generate_thumbs!'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/bundler/gems/alchemy_cms-f95af6e82139/lib/tasks/alchemy/thumbnails.rake:17:in `block (4 levels) in <main>'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:70:in `block (2 levels) in find_each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:70:in `each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:70:in `block in find_each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:136:in `block in find_in_batches'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:238:in `block in in_batches'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:222:in `loop'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:222:in `in_batches'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:135:in `find_in_batches'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:69:in `find_each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/querying.rb:21:in `find_each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/bundler/gems/alchemy_cms-f95af6e82139/lib/tasks/alchemy/thumbnails.rake:16:in `block (3 levels) in <main>'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `block in execute'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `execute'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:241:in `each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:241:in `invoke_prerequisites'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:188:in `invoke'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:160:in `invoke_task'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `each'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block in top_level'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:125:in `run_with_threads'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:110:in `top_level'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:83:in `block in run'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:80:in `run'
/home/antonio/Projects/SmartMirror/Server/bin/rake:9:in `<main>'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:318:in `block in load'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:318:in `load'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
/home/antonio/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
-e:1:in `<main>'
Tasks: TOP => alchemy:generate:thumbnails => alchemy:generate:picture_thumbnails

System configuration

  • Alchemy Version: (5.2.1 f95af6e)
  • Rails Version: (6.0.3.6)
@afdev82
Copy link
Contributor Author

afdev82 commented Jun 10, 2021

I found that the tasks were introduced in this PR and then this other one fixed the generation when uploading a picture.
Maybe a fix is needed also in the rake tasks? If this is the case I can have a look at it.

@afdev82
Copy link
Contributor Author

afdev82 commented Jun 10, 2021

It ended up that I had the wrong image_file_format for one SVG image (in the table it was png instead of svg).
Anyway I think we need to skip the thumbnails generation, I have now the same error as in the #2090

NoMethodError: undefined method `steps' for #<#<Class:0x00007f878e4f52f0>:0x0000559ea5aed988>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant