Magento – There are no commands defined in the “cache” namespace

admincachemagento2upgrade

Update

Everything is working now but There are no commands defined in the "cache" namespace is still there. I tried chmod 777 -R var/generation, didn't fix a thing. AFAIK no module is enabled

   public_html]# bin/magento module:status
List of enabled modules:
Nosto_Tagging

List of disabled modules:
Magento_Store
Magento_AdvancedPricingImportExport
Magento_Directory
Magento_Theme
Magento_Backend
Magento_Backup
Magento_Eav
Magento_Customer
Magento_BundleImportExport
Magento_AdminNotification
Magento_CacheInvalidate
Magento_Indexer
Magento_Cms
Magento_CatalogImportExport
Magento_Catalog
Magento_Rule
Magento_Msrp
Magento_Search
Magento_Bundle
Magento_Quote
Magento_CatalogUrlRewrite
Magento_Widget
Magento_SalesSequence
Magento_CheckoutAgreements
Magento_Payment
Magento_Downloadable
Magento_CmsUrlRewrite
Magento_Config
Magento_ConfigurableImportExport
Magento_CatalogInventory
Magento_SampleData
Magento_Contact
Magento_Cookie
Magento_Cron
Magento_CurrencySymbol
Magento_CatalogSearch
Magento_CustomerImportExport
Magento_CustomerSampleData
Magento_Deploy
Magento_Developer
Magento_Dhl
Magento_Authorization
Magento_User
Magento_ImportExport
Magento_Sales
Magento_CatalogRule
Magento_Email
Magento_EncryptionKey
Magento_Fedex
Magento_GiftMessage
Magento_Checkout
Magento_GoogleAnalytics
Magento_GoogleOptimizer
Magento_GroupedImportExport
Magento_GroupedProduct
Magento_Tax
Magento_DownloadableImportExport
Magento_Braintree
Magento_Integration
Magento_LayeredNavigation
Magento_Marketplace
Magento_MediaStorage
Magento_ConfigurableProduct
Magento_MsrpSampleData
Magento_Multishipping
Magento_NewRelicReporting
Magento_Newsletter
Magento_OfflinePayments
Magento_SalesRule
Magento_OfflineShipping
Magento_PageCache
Magento_Captcha
Magento_Paypal
Magento_Persistent
Magento_ProductAlert
Magento_Weee
Magento_ProductVideo
Magento_CatalogSampleData
Magento_Reports
Magento_RequireJs
Magento_Review
Magento_BundleSampleData
Magento_Rss
Magento_DownloadableSampleData
Magento_Authorizenet
Magento_OfflineShippingSampleData
Magento_ConfigurableSampleData
Magento_SalesSampleData
Magento_ProductLinksSampleData
Magento_ThemeSampleData
Magento_ReviewSampleData
Magento_SendFriend
Magento_Ui
Magento_Sitemap
Magento_CatalogRuleConfigurable
Magento_Swagger
Magento_Swatches
Magento_SwatchesSampleData
Magento_GroupedProductSampleData
Magento_TaxImportExport
Magento_TaxSampleData
Magento_GoogleAdwords
Magento_CmsSampleData
Magento_Translation
Magento_Shipping
Magento_Ups
Magento_UrlRewrite
Magento_CatalogRuleSampleData
Magento_Usps
Magento_Variable
Magento_Version
Magento_Webapi
Magento_WebapiSecurity
Magento_SalesRuleSampleData
Magento_CatalogWidget
Magento_WidgetSampleData
Magento_Wishlist
Magento_WishlistSampleData
Sm_BasicProducts
Sm_Categories
Sm_Deals
Sm_ImageSlider
Sm_ListingTabs
Sm_Market
Sm_MegaMenu
Sm_QuickView

The issue was there long before I installed nosto, I initially installed SM quickstart then upgraded it the latest magento version. if I clear the cache from admin area, I see no error. I need to fix it otherwise I'll never be able to install any module or fix this

Update now I disabled nosto.

Best Answer

That error comes up when a module does not correctly declare its commands. It just stops Magento from correctly reading the wole commands list.

Unless you have broken third party modules, you probably have something left in your cache or generation folder preventing you to correctly run Magento commands.

From your Magento root:

rm -Rf var/cache/*
rm -Rf generated/* (or rm -Rf var/generation/* depending on your Magento version)

Then try again:

php bin/magento cache:flush

If it does not work just try to run:

php bin/magento

And see what is the last shown command.

Related Topic