500 Internal Server Error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 (42000)

#0 /var/www/html/CM/Database/CSql.php(155): PDO->query('SELECT m.* FROM...')
#1 /var/www/html/global/functions/meta-functions.php(48): CM\Database\CSql->getAssocArray('SELECT m.* FROM...', 'icecave')
#2 /var/www/html/global/functions/meta-functions.php(87): getOgImage(NULL, 'https://www.ice...')
#3 /var/www/html/icecave/templates/head.php(5): getMeta(NULL, 0, '', 'page-not-found-...')
#4 /var/www/html/CM/Template/View.php(84): include('/var/www/html/i...')
#5 /var/www/html/CM/Template/View.php(92): CM\Template\View->render('head', Array)
#6 /var/www/html/CM/Engine.php(358): CM\Template\View->fetch('head', Array)
#7 [internal function]: CM\Engine->_render('head', Array, 'head')
#8 /var/www/html/CM/Core/Dispatcher.php(143): call_user_func_array(Array, Array)
#9 /var/www/html/CM/Core/Dispatcher.php(126): CM\Core\Dispatcher->invokeMethod(Array, Array)
#10 /var/www/html/CM/Core/Dispatcher.php(52): CM\Core\Dispatcher->execute(Array, Array)
#11 /var/www/html/CM/Engine.php(119): CM\Core\Dispatcher->run('render', Array)
#12 /var/www/html/CM/CM.php(66): CM\Engine->__call('render', Array)
#13 /var/www/html/icecave/controllers/ItemController.php(79): CM::__callStatic('render', Array)
#14 /var/www/html/icecave/controllers/ItemController.php(27): ItemController->_renderItem(false, 'page-not-found-...')
#15 /var/www/html/icecave/conf/config.php(28): ItemController->notFound()
#16 [internal function]: {closure}()
#17 /var/www/html/CM/Core/Dispatcher.php(136): call_user_func_array(Object(Closure), Array)
#18 /var/www/html/CM/Core/Dispatcher.php(127): CM\Core\Dispatcher->callFunction(Object(Closure), Array)
#19 /var/www/html/CM/Core/Dispatcher.php(52): CM\Core\Dispatcher->execute(Object(Closure), Array)
#20 /var/www/html/CM/Engine.php(119): CM\Core\Dispatcher->run('notFound', Array)
#21 /var/www/html/CM/Engine.php(317): CM\Engine->__call('notFound', Array)
#22 [internal function]: CM\Engine->_start()
#23 /var/www/html/CM/Core/Dispatcher.php(143): call_user_func_array(Array, Array)
#24 /var/www/html/CM/Core/Dispatcher.php(126): CM\Core\Dispatcher->invokeMethod(Array, Array)
#25 /var/www/html/CM/Core/Dispatcher.php(52): CM\Core\Dispatcher->execute(Array, Array)
#26 /var/www/html/CM/Engine.php(119): CM\Core\Dispatcher->run('start', Array)
#27 /var/www/html/CM/CM.php(66): CM\Engine->__call('start', Array)
#28 /var/www/html/icecave/index.php(5): CM::__callStatic('start', Array)
#29 {main}