In some cases,
The categories entity had an empty request_path.
Go to the database and with the help of this command find the categories or products entities that have an empty request_path
SELECT * FROM `url_rewrite` WHERE request_path='';
Delete all those entries and use the cache clean and flush command:
php bin/magento cache:clean
php bin/magento cache:flush
Revisit the url, and the homepage will work fine once again.

Magento2 Installation On LIVE server - Basic Plan
Magento2 Interview Preparation
Magento 2
Magento 2 Backend Development | TheCoachSMB