cancel
Showing results for 
Search instead for 
Did you mean: 

Magento update to 2.3 compilation errors

SOLVED

Magento update to 2.3 compilation errors

Best,

 

After updating magento 2.2.6 to magento 2.3 i have compilation issues.

I had compilation errors with Mageplaza extensions on compilation step 1/7, I removed these extensions.

After this problem was resolved compilation hangs again on step 5/7.

 

1. php bin/magento setup:upgrade

Runs well

 

2. php -dmemory_limit=6G bin/magento setup:di:compile

Stops at step 5/7

 

 

Error compilatie2.png

 

 

(please ignore the style code in the compilation this will be resolved later and does not break the compilation process.)

 

CassReader.php Line 17 / 38

 

 public function getConstructor($className)
    {
        $class = new \ReflectionClass($className);
        $result = null;
        $constructor = $class->getConstructor();
        if ($constructor) {
            $result = [];
            /** @var $parameter \ReflectionParameter */
            foreach ($constructor->getParameters() as $parameter) {
                try {
                    $result[] = [
                        $parameter->getName(),
                        $parameter->getClass() !== null ? $parameter->getClass()->getName() : null,
                        !$parameter->isOptional() && !$parameter->isDefaultValueAvailable(),
                        $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null,
                    ];
                } catch (\ReflectionException $e) {
                    $message = $e->getMessage();
                    throw new \ReflectionException($message, 0, $e);
                }
            }
        }

 

GetStockBySalesChannel.php line 44 / 59

 

 /**
     * @inheritdoc
     */
    public function execute(SalesChannelInterface $salesChannel): StockInterface
    {
        $stockId = $this->stockIdResolver->resolve(
            $salesChannel->getType(),
            $salesChannel->getCode()
        );

        if (null === $stockId) {
            throw new NoSuchEntityException(__('No linked stock found'));
        }
        return $this->stockRepository->get($stockId);
    }
}

 

 exeption.log :

 

[2018-12-05 11:01:27] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:02:30] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:02:52] main.CRITICAL: Class Magento\Email\Model\Source\Variables does not exist {"exception":"[object] (ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:35, ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:29)"} []
[2018-12-05 11:03:27] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:04:27] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:04:31] main.CRITICAL: Class Magento\Email\Model\Source\Variables does not exist {"exception":"[object] (ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:35, ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:29)"} []
[2018-12-05 11:05:32] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:05:33] main.CRITICAL: Class Magento\Email\Model\Source\Variables does not exist {"exception":"[object] (ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:35, ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:29)"} []
[2018-12-05 11:06:04] main.CRITICAL: Class Magento\Email\Model\Source\Variables does not exist {"exception":"[object] (ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:35, ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:29)"} []
[2018-12-05 11:06:27] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:07:04] main.CRITICAL: Class Magento\Email\Model\Source\Variables does not exist {"exception":"[object] (ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:35, ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:29)"} []
[2018-12-05 11:07:26] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:08:25] main.CRITICAL: No linked stock found {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php:163, Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No linked stock found at /home/myserver/public_html/vendor/magento/module-inventory-sales/Model/GetStockBySalesChannel.php:55)"} []
[2018-12-05 11:08:52] main.CRITICAL: Class Magento\Email\Model\Source\Variables does not exist {"exception":"[object] (ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:35, ReflectionException(code: 0): Class Magento\\Email\\Model\\Source\\Variables does not exist at /home/myserver/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:29)"} []

 

 How to resolve this compilation problem?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento update to 2.3 compilation errors

Try going into Stores > Inventory > Sources and adding in a source. Maybe call it your business name, then fill in a country and zip value.

 

Then, try going into Stores > Inventory > Stocks. Call it "Default Stock" and apply it to all websites (if multi store) and hit save.

 

After that, see if the issue remains.

View solution in original post

10 REPLIES 10

Re: Magento update to 2.3 compilation errors

I am having this exact issue on my dev upgrading from 2.2.6 Commerce Edition to 2.3

Re: Magento update to 2.3 compilation errors

Thanks for your reply,

 

If you use extensions, check the compatibility with magento 2.3

If they are all verified to work with magento 2.3 update them one by one to the latest version.

All extensions that are not compatible must be removed, for example Mageplaza smtp was not compatible and Mageworx ceo tool is was also not compatible. After updating all problems were solved.

 

Best regarsd

Re: Magento update to 2.3 compilation errors

Try going into Stores > Inventory > Sources and adding in a source. Maybe call it your business name, then fill in a country and zip value.

 

Then, try going into Stores > Inventory > Stocks. Call it "Default Stock" and apply it to all websites (if multi store) and hit save.

 

After that, see if the issue remains.

Re: Magento update to 2.3 compilation errors

Happy new year!

 

Thank you very very much.

 

Problem Solved!

Re: Magento update to 2.3 compilation errors

Thank you, that was definitely and odd error report that I've never encountered before.

Re: Magento update to 2.3 compilation errors

The solution works well in local.

 

But when deployed to staging, still we see the products are hidden from our storefront.

 

Do we need to run any commands after setting the source and stock?

Re: Magento update to 2.3 compilation errors

@rajeshrest try:

php bin/magento indexer:reindex
php bin/magento cache:flush php bin/magento cache:clean

 

 

I think this issue appears if you're using an older version of composer.

 

I had the same issue in my developer machine over and over again when testing our update from Magento 2.2.4 to 2.3.1 using composer 1.2.2 (which is the standard version in the Debian 9 Repo).

 

I also tested it in a Ubuntu 16.04 developer machine with composer 1.5.2 with no issues.

 

Then I removed composer version 1.2.2 from my debian 9 system and installed the latest version 1.8.6 and the issue disappeared.

Re: Magento update to 2.3 compilation errors

Not working on server

Re: Magento update to 2.3 compilation errors

thank you for the help