When in M2 backend, whether going to edit an existing product or adding a new product, Category selection feature not showing any categories or allow you to add any new categories.
The only error output I'm seeing in system.log is when I click on "New Category":
Notice: Undefined index: optgroup in /var/www/html/vendor/magento/module-catalog/Ui/Component/Product/Form/Categories/Options.php on line 108
Tracking that error down to this line of code from Options.php:
$this->categoriesTree = $categoryById[CategoryModel::TREE_ROOT_ID]['optgroup'];
Also getting this 500 error in browser console for this AJAX URL:
/mui/index/render_handle/handle/catalog_category_create/store/0/buttons/1/key/{token}/?namespace=new_category_form&isAjax=true
I have not installed any new extensions and this was a situation where working fine one day and all of sudden just starting getting this error the next.
I'm kind of not sure what direction to go in troubleshooting, any help is greatly appreciated.