0

I am trying to run a magento install script (using deployer). The exact same script on exact same git branch works on another machine.

This is the error:

✔ Executing task deploy:prepare
✔ Executing task deploy:lock
✔ Executing task deploy:release
✔ Executing task deploy:update_code
✔ Executing task deploy:shared
✔ Executing task deploy:vendors
✔ Executing task mydebug
✔ Executing task deploy:clear_paths
✔ Executing task magento:setup:permissions
➤ Executing task magento:config
✔ Executing task deploy:failed
✔ Executing task deploy:unlock

In Client.php line 103: The command "cd /home/justadev/public_html/releases/20210226153919/ && /usr/local/bin/php /usr/local/bin/n98-magerun2 cache:enable --quiet" failed.                                                              
                                                                                                                                   
  In ClassReader.php line 26:       
    Class Magento\GoogleShoppingAds\Model\Cache\Type does not exist 

My previous release was using Magento 2.3.3, in this release I am trying to upgrade to Magento 2.3.6

The deploy script (with Magento 2.3.6) is also working on another server. I tried to disable the Magento_GoogleShoppingAds from app/etc/config.php and also remove it completely. It doesn't help.

I don't see this GoogleShoppingAds anywhere in my code. When I do bin/magento module:status it is in the disabled section. Where it is coming from and how can I remove it?

UPDATE

same issue happens with normal magento cache:flash

$ bin/magento cache:flush

In ClassReader.php line 26:
                                                                   
  Class Magento\GoogleShoppingAds\Model\Cache\Type does not exist 

I added "magento/google-shopping-ads":"4.0.1" to composer.json, and I see that composer did install it:

$ ll vendor/magento/google-shopping-ads/
total 12
-rwxr-xr-x. 1 myuser myuser 691 Jun  1  2020 composer.json
drwxr-xr-x. 2 myuser myuser  41 Feb 26 16:11 etc
-rwxr-xr-x. 1 myuser myuser 218 Jun  1  2020 README.md
-rwxr-xr-x. 1 myuser myuser 274 Jun  1  2020 registration.php
drwxr-xr-x. 2 myuser myuser  50 Feb 26 16:11 Setup

However the issue is still happening.

5
  • Same setup, same upgrade, same issue. Did you find any solution? Mar 9, 2021 at 12:36
  • Yes. Removing the (redis) cache helped in my case
    – justadev
    Mar 9, 2021 at 13:49
  • When you say "removing", you mean "purging". Right? Mar 9, 2021 at 14:33
  • 1
    At the moment I really disabled the cache from env.php because I didn't had redis permissions on that server. I will need to get back to this issue soon as now redis is ok. Try purging, I hope that it works as well
    – justadev
    Mar 9, 2021 at 14:54
  • You're right! It made the trick. Gonna post my solution as an answer. Mar 10, 2021 at 10:07

1 Answer 1

3

Errors like Class Magento\ModuleName\Model\Cache\Type does not exist are usually related to cache.

I had exactly the same issue. The deployments were failing even purging all caches just before.

Disabling or removing Redis permanently is a bad idea. The negative impact on performance might be really really high.

To bypass this situation and complete the deployment, I followed this steps:

  1. Open the app/etc/env.php file with any text editor.
  2. Comment the lines related to the Redis setup. They start with the 'cache' key (More info here).
  3. Save the changes.
  4. Retry the deployment. In my case (Or yours if you are using Deployer.org), dep -v deploy production. The stage name production could be different according to your setup.
  5. If your release was successfully deployed, open the app/etc/env.php more one time and revert the changes made in step 2.
  6. Save the changes and purge all caches (Via adminhtml or CLI using bin/magento c:c && bin/magento c:f).

Everything should be working as expected, including Redis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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