Magento 2 Issue with "Not Registered Handle" on all the sales sections?

The problem here is that someone defined a handle in the etc/adminhtml/di.xml

search for something like this

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="NameOfHandle" xsi:type="string">Vendor\Module\Model\ResourceModel\Something\Collection</item>
        </argument>
    </arguments>
</type>
<virtualType name="Vendor\Module\Model\ResourceModel\Something\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">NameOfTable</argument>
        <argument name="resourceModel" xsi:type="string">Vendor\Module\Model\ResourceModel\Something</argument>
    </arguments>
</virtualType>

Do not search for the handle that he can not find. Just go over etc/adminhtml/di.xml in your modules and search for

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">

Move that bit of code to etc/di.xml instead of etc/adminhtml/di.xml


Okay so I found the problem. I found another stackexchange topic that didn't seem to be 100% related because it was a different module, however the exact same scenario was occurring. You can find the discussion here: https://stackoverflow.com/questions/39763550/magento-2-1-1-admin-content-pages-not-loading-handle-not-registered

The main thing was that I didn't create any custom modules, but I did install a few modules from third parties. I guess I just assumed these would have been updated, but they were manually installed not with composer, there were minor issues with the setup of the modules file structure. Being new to Magento I looked at the topic above and was just looking at the Magento file structure, but then it clicked I needed to look at the file structure of the modules.

Once, I investigated each of the modules I had installed, I looked in the etc/adminhtml directory for each and I found a few of them had a di.xml file in that directory, and also an etc/di.xml. So I opened both files, compared them, and combined them. I only added what was missing from the adminhtml path into the etc/di.xml path. Then I renamed the etc/adminhtml/di.xml to bak.di.xml just to back it up. I cleared and flushed the cache, and everything is working again.

It appears to me that this is a change from 2.0.x to 2.1.x. Most modules will be fine working from 2.0.x to 2.1.x but that file structure is what caused my issues.


The self-provided answer from @jason-diehl doesn't really explain this issue, and I believe includes some incorrect information.

I ran into this issue when developing a custom module and testing the admin grid. I could see the container with the "Add ____" button, but a single message: Not registered handle ________. After looking into things I realized that I had specified a <dataSource> name in my view/adminhtml/ui_component/my_module_controller_listing.xml file which was not included in my etc/di.xml file as a named <item> in the list of collections for the Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory type.

Once I adjusted the name of the data source in my listing to match the name of the collection in etc/di.xml, the error was gone.

So to summarize: When you specify a data source to use in your adminhtml grid listing UI component(s), you must make sure the name attribute of your data source is specified as the name of a collection under the <type> tag of Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory.