Moving site to host error: getConfigRepository() on null

Permalink
Hello,

The website is working in my local development environment but when I upload everyting to the hosting provider I receive the following error:

Call to a member function getConfigRepository() on null

$config = $this->app->make('config');
        if (!$config->has('app.server_timezone')) {
            // There is no server timezone set.
            $config->set('app.server_timezone', @date_default_timezone_get() ?: 'UTC');
        }
        @date_default_timezone_set($config->get('app.server_timezone'));
    }
    protected function initializeSiteTimezone()
    {
        $siteConfig = $this->app->make('site')->getSite()->getConfigRepository();
        if (!$siteConfig->has('timezone')) {
            // There is no timezone set.
            $siteConfig->set('timezone', @date_default_timezone_get());
        }
    }


I tried this on two different providers. I am using PHP 7.1.19 and tested with concrete 8.40 and 8.4.1 (download version and via composer install).

Some advice would be appreciated.

 
rge replied on at Permalink Best Answer Reply
The problem was an empty database export...