I did a Magento upgrade to version 2.4.2-p1. All went good, but in the logs I am getting this error message:
[2021-06-17 08:25:04] main.ERROR: There are no commands defined in the "setup:cron" namespace.
Did you mean one of these?
setup
setup:config
setup:db
setup:db-data
setup:db-declaration
setup:db-schema
setup:di
setup:performance
setup:static-content
setup:store-config
#0 /data/web/magento2/vendor/symfony/console/Application.php(657): Symfony\Component\Console\Application->findNamespace('setup:cron')
#1 /data/web/magento2/vendor/symfony/console/Application.php(237): Symfony\Component\Console\Application->find('setup:cron:run')
#2 /data/web/magento2/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /data/web/magento2/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /data/web/magento2/bin/magento(23): Symfony\Component\Console\Application->run()
#5 {main} [] []
This error prevents me to log in the admin panel or log in to my account, although other frontend pages are working ..
I found this similar issue: https://github.com/magento/magento2/issues/29872 I did a:
bin/magento cron:remove
bin/magento cron:install
But still didn't fix this issue. Any clue how to fix it ? Thank you
Crontab content:
#~ MAGENTO START 4e0174ce8466e99a2a8250c98c3279eb43a3c5471df8d5539c3c912d49638e0d
* * * * * sleep 2; flock -o -n ~/.b861095f.lock -c '/usr/bin/php7.3 /data/web/magento2/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /data/web/magento2/var/log/magento.cron.log'
#~ MAGENTO END 4e0174ce8466e99a2a8250c98c3279eb43a3c5471df8d5539c3c912d49638e0d