I get an error about a missing ImageMagick installation when exporting a Redmine Gantt chart to PNG. But I cannot pin down the reason because everything seems to be installed correctly, and I have an identical server with the same OS, same Redmine version / config and the same packages etc. installed. On the other (test) server, it all seems to work.
What could be the issue, or how can I pin it down?
Some more in depth information:
Error in the logs:
Started GET "/projects/migratie/issues/gantt.png MiniMagick::Error (You must have ImageMagick or GraphicsMagick installed): lib/redmine/helpers/gantt.rb:399:in `to_image' app/controllers/gantts_controller.rb:46:in `block (2 levels) in show' app/controllers/gantts_controller.rb:42:in `show' lib/redmine/sudo_mode.rb:61:in `sudo_mode'
Redmine 4.2.3.stable Standaard beheerderaccount gewijzigd Bestandsrepository schrijfbaar Plugin assets map schrijfbaar (./public/plugin_assets) MiniMagick beschikbaar (optioneel) ImageMagick comversie beschikbaar (optioneel) ImageMagick PDF support available (optional) Environment: Redmine version 4.2.3.stable Ruby version 2.7.4-p191 (2021-07-07) [amd64-freebsd13] Rails version 5.2.6 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery sendmail SCM: Git 2.33.1 Filesystem Redmine plugins: easy_gantt 1.13 redmine_agile 1.6.2 redmine_checklists 3.1.20 redmine_contacts 4.3.4 redmine_contacts_helpdesk 4.1.12 redmine_contacts_invoices 4.2.5 redmine_crm_mailchimp 1.0.4 redmine_datetime_custom_field 1.0.4 redmine_drive 1.1.1 redmine_editauthor 0.11.0 redmine_favorite_projects 2.1.1 redmine_finance 2.1.7 redmine_helpdesk_contact_sync 0.0.4.1 redmine_issue_templates 1.1.0 redmine_people 1.6.1 redmine_products 2.1.4 redmine_questions 1.0.2 redmine_reporter 2.0.0 redmine_resources 1.0.6 redmine_tint_issues 1.2.1 redmine_view_issue_description 0.0.2 redmine_zenedit 2.0.1 redmineup_tags 2.0.11 stopwatch 0.2.0
Verified steps: please bear in mind that it works on the test server.
1. Same FreeBSD version 13.0-release
2. Same Redmine 4.2.3 version, configuration and plugins (I did a directory compare)
3. ImageMagick7 installed, tested (convert and magick command) and executes as www user, available in the path env. Same options and confirmed PNG support.
4. Gem mini_magick (4.11.0, 4.10.1) installed.
5. Bundle: Using mini_magick 4.11.0 in /usr/local/www/redmine
6. configuration.yml (with two leading spaces): imagemagick_convert_command: /usr/local/bin/convert
7. Other converts (eg. pdf) in Redmine seem to work fine on both servers.
8. Moving to another database does not change a thing.
9. Apache config is identical.
#3 Updated by Jan Catrysse 5 months ago
Go MAEDA wrote:
Does applying the patch in #35027#note-1 resolve the issue?
No, this did not make a difference. I cannot point my finger on the reason... on another server with, as far as I can see, an identical configuration it works fine.
Could someone tell me how I can activate logging on production to have some more detailed information when I get the error?
#4 Updated by Jan Catrysse 5 months ago
I added this line to the patched area in gantt.rb
if Redmine::Configuration['imagemagick_convert_command'].present? MiniMagick.cli_path = File.dirname(Redmine::Configuration['imagemagick_convert_command']) MiniMagick.logger.level = Logger::DEBUG end
test, this outputs a nice
convert command line in my
httpd_error_log ... on
I first tried with a deprecated
MiniMagick.debug = true, and this is outputting a deprecated warning, also on
production. So, this means
Redmine::Configuration['imagemagick_convert_command'].present is true.
So, the issue must really be related to
MiniMagick ... or me having done something stupid.
Redmine::Configuration['imagemagick_convert_command'] with some logging... and it seems to be correct.
#5 Updated by Jan Catrysse 3 months ago
I was testing this again, and now it doesn't work on either environments: test, dev nor production. I am not sure what changed in between tests, probably some updated gems.
This is related to issue #35424.
The errors seems to come from:
def cli if instance_variable_defined?("@cli") instance_variable_get("@cli") else cli = CLI_DETECTION.key(processor) or fail MiniMagick::Error, "You must have ImageMagick or GraphicsMagick installed" instance_variable_set("@cli", cli) end end
#8 Updated by Jan Catrysse 3 months ago
I did fount this in my log, but I don't think it helps.
MiniMagick::Error (You must have ImageMagick or GraphicsMagick installed): lib/redmine/helpers/gantt.rb:402:in `to_image' app/controllers/gantts_controller.rb:46:in `block (2 levels) in show' app/controllers/gantts_controller.rb:42:in `show' lib/redmine/sudo_mode.rb:61:in `sudo_mode'
#9 Updated by Jan Catrysse 3 months ago
I fixed this by changing
MiniMagick.cli = :imagemagick to
if Redmine::Configuration['imagemagick_convert_command'].present? MiniMagick.cli_path = File.dirname(Redmine::Configuration['imagemagick_convert_command']) MiniMagick.cli = :imagemagick end