Problem/Motivation

 	TypeError: Return value of Symfony\Component\Process\Process::close() must be of the type int, null returned in Symfony\Component\Process\Process->close() (line 1476 of /data/disk/o2/static/varbase-9.0.3-9.1.15/vendor/symfony/process/Process.php)

#0 /data/disk/o2/static/varbase-9.0.3-9.1.15/vendor/symfony/process/Process.php(1365): Symfony\Component\Process\Process->close()
#1 /data/disk/o2/static/varbase-9.0.3-9.1.15/vendor/symfony/process/Process.php(367): Symfony\Component\Process\Process->updateStatus()
#2 /data/disk/o2/static/varbase-9.0.3-9.1.15/vendor/symfony/process/Process.php(249): Symfony\Component\Process\Process->start()
#3 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/modules/contrib/imagemagick/src/ImagemagickExecManager.php(335): Symfony\Component\Process\Process->run()
#4 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/modules/contrib/imagemagick/src/ImagemagickExecManager.php(408): Drupal\imagemagick\ImagemagickExecManager->runOsShell()
#5 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/modules/contrib/imagemagick/src/Plugin/ImageToolkit/ImagemagickToolkit.php(327): Drupal\imagemagick\ImagemagickExecManager->getInstalledLocales()
#6 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/modules/system/src/Form/ImageToolkitForm.php(94): Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit->buildConfigurationForm()
#7 [internal function]: Drupal\system\Form\ImageToolkitForm->buildForm()
#8 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(532): call_user_func_array()
#9 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm()
#10 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#11 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#12 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#13 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#15 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#16 /data/disk/o2/static/varbase-9.0.3-9.1.15/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 /data/disk/o2/static/varbase-9.0.3-9.1.15/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#18 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle()
#19 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle()
#20 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#21 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#22 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle()
#23 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#24 /data/disk/o2/static/varbase-9.0.3-9.1.15/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#25 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/core/lib/Drupal/Core/DrupalKernel.php(706): Stack\StackedHttpKernel->handle()
#26 /data/disk/o2/static/varbase-9.0.3-9.1.15/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()
#27 {main}

Steps to reproduce

When I access admin/config/media/image-toolkit after enabling the module, I get this error.

Drupal 9.1.15

# convert -version
Version: ImageMagick 7.0.11-13 Q16 x86_64 2021-05-16 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.5)
Delegates (built-in): bzlib djvu fontconfig freetype gvc jbig jng jp2 jpeg lcms lqr lzma openexr png tiff webp x xml zip zlib

Any ideas what might be going one? Thanks!

Comments

mrP created an issue.

junaidpv’s picture

We get same error in our server because PHP function proc_close() disabled. Either you need to ask you server team to enable that function or you would have to switch back to GD, you cant use ImageMagick module.

IMO, the module developers have to consider fixing this issue as many managed servers don't allow functions like proc_close as of security concerns.