Amportal reload causes PHP Fatal error: Call to undefined method DB::IsError()

Hello, When I do an amportal reload, it causes a PHP Fatal error.

amportal reload

Fetching FreePBX settings with gen_amp_conf.php..

PHP Fatal error:  Call to undefined method DB::IsError() in /home/varfolders/www/html/admin/libraries/freepbx_conf.class.php on line 204

PHP Fatal error:  Call to undefined method DB::IsError() in /home/varfolders/www/html/admin/libraries/freepbx_conf.class.php on line 204

**** WARNING: ERROR IN CONFIGURATION ****

astrundir in '/etc/asterisk' is set to  but the directory

 

does not exists. Attempting to create it with: 'mkdir -p '

 

What is the reason behind this problem and any idea on how to fix it?