Class defaultTokenProvider does not exist

Based on an open GitHub ticket and other topic+some posts here, the defaultTokenProvider error shows up when for different reasons Nextcloud cannot access the database:

So whoever lands here, check if the database is running and accessible properly, PHP database module is installed for the PHP version that the webserver uses and such. In one case the database user, configured in config.php, was missing and such things.