我已经设置了从 AWS 到我的 EC2 Magento 2.4 服务器的 Redis 服务。但是,在完成设置过程后,我现在在我的网页中以及每当我尝试运行 Magento 命令时都会收到 Redis 消息。
/var/www/html$ bin/magento setup:upgrade
MOVED 7487 172.31.46.51:6379#0 /var/www/html/vendor/colinmollenhour/credis/Client.php(1034): Credis_Client->read_reply()
#1 /var/www/html/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php(472): Credis_Client->__call()
#2 /var/www/html/vendor/magento/framework/Cache/Backend/Redis.php(61): Cm_Cache_Backend_Redis->load()
#3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Core.php(306): Magento\Framework\Cache\Backend\Redis->load()
#4 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(55): Zend_Cache_Core->load()
#5 /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\Cache\Frontend\Adapter\Zend->load()
#6 /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\Cache\Frontend\Decorator\Bare->load()
#7 /var/www/html/vendor/magento/framework/App/Cache.php(59): Magento\Framework\Cache\Frontend\Decorator\Bare->load()
#8 /var/www/html/vendor/magento/framework/App/Cache/Proxy.php(67): Magento\Framework\App\Cache->load()
#9 /var/www/html/vendor/magento/framework/App/ProductMetadata.php(78): Magento\Framework\App\Cache\Proxy->load()
#10 /var/www/html/vendor/magento/framework/Console/Cli.php(98): Magento\Framework\App\ProductMetadata->getVersion()
#11 /var/www/html/bin/magento(22): Magento\Framework\Console\Cli->__construct()
#12 {main}
在网络上,我收到了类似的消息,而不是我的网页:
CredisException: MOVED 8822 172.31.46.51:6379 in /var/www/html/vendor/colinmollenhour/credis/Client.php:1299
Stack trace:
#0 /var/www/html/vendor/colinmollenhour/credis/Client.php(1034): Credis_Client->read_reply()
#1 /var/www/html/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php(472): Credis_Client->__call()
#2 /var/www/html/vendor/magento/framework/Cache/Backend/Redis.php(61): Cm_Cache_Backend_Redis->load()
#3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Core.php(306): Magento\Framework\Cache\Backend\Redis->load()
#4 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(55): Zend_Cache_Core->load()
#5 /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\Cache\Frontend\Adapter\Zend->load()
#6 /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\Cache\Frontend\Decorator\Bare->load()
#7 /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\Cache\Frontend\Decorator\Bare->load()
#8 /var/www/html/vendor/magento/framework/App/Cache/Type/AccessProxy.php(74): Magento\Framework\Cache\Frontend\Decorator\Bare->load()
#9 /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\App\Cache\Type\AccessProxy->load()
#10 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(269): Magento\Framework\Cache\Frontend\Decorator\Bare->load()
#11 /var/www/html/vendor/magento/framework/Cache/LockGuardedCacheLoader.php(118): Magento\Config\App\Config\Type\System->Magento\Config\App\Config\Type\{closure}()
#12 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(281): Magento\Framework\Cache\LockGuardedCacheLoader->lockedLoadData()
#13 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(207): Magento\Config\App\Config\Type\System->loadDefaultScopeData()
#14 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(181): Magento\Config\App\Config\Type\System->getWithParts()
#15 /var/www/html/vendor/magento/framework/App/Config.php(132): Magento\Config\App\Config\Type\System->get()
#16 /var/www/html/vendor/magento/framework/App/Config.php(80): Magento\Framework\App\Config->get()
#17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Config->getValue()
#18 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Config\Interceptor->___callParent()
#19 /var/www/html/vendor/cart2quote/module-license/Plugin/App/ConfigPlugin.php(100): Magento\Framework\App\Config\Interceptor->Magento\Framework\Interception\{closure}()
#20 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Cart2Quote\License\Plugin\App\ConfigPlugin->aroundGetValue()
#21 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Config\Interceptor->Magento\Framework\Interception\{closure}()
#22 /var/www/html/generated/code/Magento/Framework/App/Config/Interceptor.php(23): Magento\Framework\App\Config\Interceptor->___callPlugins()
#23 /var/www/html/vendor/magento/framework/App/Config.php(93): Magento\Framework\App\Config\Interceptor->getValue()
#24 /var/www/html/vendor/magento/module-new-relic-reporting/Model/Config.php(94): Magento\Framework\App\Config->isSetFlag()
#25 /var/www/html/vendor/magento/module-new-relic-reporting/Plugin/HttpPlugin.php(49): Magento\NewRelicReporting\Model\Config->isNewRelicEnabled()
#26 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\NewRelicReporting\Plugin\HttpPlugin->beforeCatchException()
#27 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#28 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins()
#29 /var/www/html/vendor/magento/framework/App/Bootstrap.php(270): Magento\Framework\App\Http\Interceptor->catchException()
#30 /var/www/html/pub/index.php(29): Magento\Framework\App\Bootstrap->run()
#31 {main}
从异常日志中,我发现了这个错误,当我搜索它可能出现的可能原因时,我得到了与数据库行问题相关的答案,我验证这些问题不是我的数据库中问题的根源:
[2021-11-08 11:59:46] main.CRITICAL: The store that was requested wasn't found. Verify the store and try again. {"exception"
:"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): The store that was requested wasn't found. Verify
the store and try again. at /var/www/html/vendor/magento/module-store/Model/StoreRepository.php:75)"} []
更新
我从中删除了 Redis 主机,app/etc/env.php
并且网站 + Magento 命令正常工作。当我重新添加它们时,同样的问题再次出现。