0

I have a Prestashop 1.7.8 module that uses Symfony commands to perform scheduled tasks. In my crontab, I can trigger $ php bin/console algoliaprestashop:reindex

It works fine in my Production environment, but not in my Development environment where I get that error message:

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "IndexCommand" from namespace "PrestaShop\Module\AlgoliaPrestashop\Command".

I got it to work by doing some nasty require('<insert path to PHP file>').

Production and Development are docker containers hosted on 2 AWS instances.

What we have change is that we turn the dev container on and off every night.

How can I fix that ?

The expected behaviour is that the Symfony Command $ php bin/console algoliaprestashop:reindex as defined in services.yaml instantiates the IndexCommand class and performs the execute method.

I have tried executing composer install and composer dump-autoload in the root folder, then in the module's folder. After that I have cleared the cache.

1
  • "How can I fix that ?" -> do a nightly build of the development version and put the container on distribution and integrate it in a third AWS instance. When integration looks good, review the results quickly and then deploy on production. If it does not look good, fix the build, approve it on the integration instance and then deploy on production. You should be able to turn off and on any amount of dev containers and independent to the phase of the moon regardless of the build and integration. Dev is dev, it must not work. Production must work. Build & Deploy. Commented Jan 14 at 3:52

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.