cancel
Showing results for 
Search instead for 
Did you mean: 

2.4.5 to 2.4.6 di:compile failure

2.4.5 to 2.4.6 di:compile failure

I'm running into the below.  This is part of my suffering 2.3.5 to 2.4.6 journey.

 

Any insight would be greatly appreciated as I'm down in production at the moment. Smiley Happy

 

[server_admin]:public_html$ bin/magento setup:di:compile

Compilation was started.

Application code generator... 3/9 [=========>------------------]  33% 6 secs 248.0 MiB

There is an error in /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Controller/LandingUpdater.php at line: 14

Class "Zend\Mvc\Controller\AbstractActionController" not found#0 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/vendor/composer/ClassLoader.php(576): include()

#1 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()

#2 [internal function]: Composer\Autoload\ClassLoader->loadClass()

#3 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists()

#4 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass()

#5 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract()

#6 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ApplicationCodeGenerator.php(100): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList()

#7 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ApplicationCodeGenerator.php(69): Magento\Setup\Module\Di\App\Task\Operation\ApplicationCodeGenerator->getFiles()

#8 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module\Di\App\Task\Operation\ApplicationCodeGenerator->doOperation()

#9 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module\Di\App\Task\Manager->process()

#10 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/vendor/symfony/console/Command/Command.php(298): Magento\Setup\Console\Command\DiCompileCommand->execute()

#11 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()

#12 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()

#13 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun()

#14 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/vendor/symfony/console/Application.php(171): Magento\Framework\Console\Cli->doRun()

#15 /home/408275.cloudwaysapps.com/cwsqfdragk/public_html/bin/magento(23): Symfony\Component\Console\Application->run()

#16 {main}

3 REPLIES 3

Re: 2.4.5 to 2.4.6 di:compile failure

It appears that the error occurs in:

 

setup/src/Magento/Setup/Controller/LandingUpdater.php

 

The above class was probably missed by composer as part of your upgrade process, to force composer to pull down the latest version of this class, try removing the setup directory from the Magento root and then executing "composer install" again.

You may also want to consider removing the following directories from the Magento root directory:

  • setup
  • lib
  • vendor
  • dev

Afterwards, run your 'composer install' to allow the package manager to download the latest versions of the above mentioned directories.

Re: 2.4.5 to 2.4.6 di:compile failure

@jon_tomsu 

 

It seems like your compilation process has encountered an error. Without the specific error message, it's challenging to pinpoint the exact issue. However, here are some general steps you can take to troubleshoot and resolve the problem:

  1. Check Error Message: Look for the error message that follows the line "There is an error in" in your console output. This error message will provide more information about what went wrong during the compilation process.

  2. Review Code Changes: If you've recently made any changes to your Magento codebase, review those changes to see if there are any syntax errors or issues that could be causing the compilation error.

  3. Check File Permissions: Ensure that the files and directories in your Magento installation have the correct permissions. Improper file permissions can sometimes cause issues during the compilation process.

  4. Clear Cache: Clear Magento cache before running the compilation again. Sometimes, stale cache files can interfere with the compilation process.

  5. Check System Requirements: Ensure that your server meets the system requirements for running Magento. Check PHP version, required PHP extensions, memory limit, etc.

  6. Disable Compilation Mode: If you're unable to resolve the issue, you can temporarily disable the compilation mode by running the following command:

    bin/magento setup:di:compile --no-compile

    This will skip the compilation process and allow you to access your store. However, it's important to resolve the underlying issue and re-enable compilation mode for optimal performance.

     

    Once you have more information about the specific error message, you'll be better equipped to troubleshoot and resolve the compilation issue.
Manish Mittal
https://www.manishmittal.com/

Re: 2.4.5 to 2.4.6 di:compile failure

Same issue, then I  create a new magento2 in another path and found that the path "setup" in  new installation do not have those files.

So rm -r setup, and copy paste. and it works.

This is simply a result of magento not removing outdated files.