This error occurs after upgrading from drupal 8 to 9. The setting for your config directory has changed. Fix this by using the following in your settings.php file:

The config sync directory is not defined in $settings["config_sync_directory"]
 

$settings['config_sync_directory'] = '../config';