1

I got the below error while installing the Magento 2.3.5 in windows 10 PC using Wamp server.

Module 'Magento_Theme':
[ERROR] InvalidArgumentException: Wrong file in C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\Image\Adapter\Gd2.php:64 Stack trace: #0 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\Image.php(55): Magento\Framework\Image\Adapter\Gd2->open('C:/wamp64/www/m...') #1 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\Image.php(36): Magento\Framework\Image->open() #2 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(121): Magento\Framework\Image->__construct(Object(Magento\Framework\Image\Adapter\Gd2), 'C:/wamp64/www/m...') #3 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) #4 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\ObjectManager\ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array) #5 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\Image\Factory.php(47): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array) #6 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\View\Design\Theme\Image.php(127): Magento\Framework\Image\Factory->create('C:/wamp64/www/m...') #7 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\module-theme\Model\Theme\Registration.php(135): Magento\Framework\View\Design\Theme\Image->createPreviewImage('C:/wamp64/www/m...') #8 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\module-theme\Model\Theme\Registration.php(114): Magento\Theme\Model\Theme\Registration->_savePreviewImage(Object(Magento\Theme\Model\Theme\Data)) #9 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\module-theme\Model\Theme\Registration.php(73): Magento\Theme\Model\Theme\Registration->_registerThemeRecursively(Object(Magento\Theme\Model\Theme\Data)) #10 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\module-theme\Setup\Patch\Data\RegisterThemes.php(47): Magento\Theme\Model\Theme\Registration->register() #11 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\Setup\Patch\PatchApplier.php(162): Magento\Theme\Setup\Patch\Data\RegisterThemes->apply() #12 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Model\Installer.php(1023): Magento\Framework\Setup\Patch\PatchApplier->applyDataPatch('Magento_Theme') #13 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Model\Installer.php(890): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\DataSetup), 'data', Array) #14 [internal function]: Magento\Setup\Model\Installer->installDataFixtures(Array) #15 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Model\Installer.php(371): call_user_func_array(Array, Array) #16 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Controller\Install.php(109): Magento\Setup\Model\Installer->install(Array) #17 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\Controller\AbstractActionController.php(83): Magento\Setup\Controller\Install->startAction() #18 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent)) #19 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #20 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\Controller\AbstractController.php(115): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #21 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\DispatchListener.php(117): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response)) #22 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent)) #23 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #24 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\Application.php(339): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #25 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\index.php(39): Laminas\Mvc\Application->run() #26 {main} Next Magento\Framework\Setup\Exception: Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. Original exception message: Wrong file in C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\magento\framework\Setup\Patch\PatchApplier.php:170 Stack trace: #0 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Model\Installer.php(1023): Magento\Framework\Setup\Patch\PatchApplier->applyDataPatch('Magento_Theme') #1 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Model\Installer.php(890): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\DataSetup), 'data', Array) #2 [internal function]: Magento\Setup\Model\Installer->installDataFixtures(Array) #3 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Model\Installer.php(371): call_user_func_array(Array, Array) #4 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\src\Magento\Setup\Controller\Install.php(109): Magento\Setup\Model\Installer->install(Array) #5 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\Controller\AbstractActionController.php(83): Magento\Setup\Controller\Install->startAction() #6 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent)) #7 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #8 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\Controller\AbstractController.php(115): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #9 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\DispatchListener.php(117): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response)) #10 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent)) #11 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #12 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\vendor\laminas\laminas-mvc\src\Application.php(339): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #13 C:\wamp64\www\magento-ce-2.3.5-p1-2020-04-24-08-33-34_2\setup\index.php(39): Laminas\Mvc\Application->run() #14 {main}
1

I solved following this manual: [ERROR] InvalidArgumentException

Find validateURLScheme function in vendor\magento\framework\Image\Adapter\Gd2.php file at line 96. Replace function with this:

private function validateURLScheme(string $filename) : bool
{
  $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
  $url = parse_url($filename);
  if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
      return false;
  }
  return true;
}
| improve this answer | |
  • Above solution worked for me – zuber bandi Jun 22 at 10:22
0

Had the exact same problem while installing 2.3.5 using Wamp on Windows 10. The error occurred while the installer tried to install "Module 'Magento_Theme'".

Workaround

I worked around the problem by installing version 2.3.4 instead of 2.3.5. To do this:

  • Delete the existing database and create a new empty database
  • Delete the content of C:\wamp64\www\
  • Go to the download archive tab in the Download page of Magento
  • Download 2.3.4 and unzip it to C:\wamp64\www\
  • Go to http://localhost in Incognito mode. As the installer otherwise remembers your 2.3.5 settings and fails, as it tries to install 2.3.5 sample data module.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.