Cms: 500 server error when using Control Panel search

Created on 6 Feb 2020  路  5Comments  路  Source: craftcms/cms

Description

When using Search in Control panel on entries view a 500 error is thrown for /index.php?p=go/actions/element-indexes/get-elements

This happens after an upgrade from 3.4.3 -> 3.4.4

Steps to reproduce

  1. Open list of entries. Use search input. Flash error shown

Additional info

  • Craft version: 3.4.4
  • PHP version: 7.2.20
  • Database driver & version: MySQL 5.7.26

Most helpful comment

3.4.4.1 is out now with the fix.

All 5 comments

Also had this happen to me today. Downgraded to 3.4.3 for a quick fix.

Here's a stack trace from my logs, hopefully it helps:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'score' in 'order clause' in /app/vendor/yiisoft/yii2/db/Command.php:1290

Stack trace:
#0 /app/vendor/yiisoft/yii2/db/Command.php(1290): PDOStatement->execute()
#1 /app/vendor/yiisoft/yii2/db/Command.php(1158): yii\db\Command->internalExecute('SELECT `element...')
#2 /app/vendor/yiisoft/yii2/db/Command.php(442): yii\db\Command->queryInternal('fetchAll', 7)
#3 /app/vendor/yiisoft/yii2/db/Query.php(307): yii\db\Command->queryColumn()
#4 /app/vendor/craftcms/cms/src/db/Query.php(202): yii\db\Query->column(NULL)
#5 /app/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1523): craft\db\Query->column(NULL)
#6 /app/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1563): craft\elements\db\ElementQuery->column(NULL)
#7 /app/vendor/craftcms/cms/src/elements/db/ElementQuery.php(2523): craft\elements\db\ElementQuery->ids()
#8 /app/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1418): craft\elements\db\ElementQuery->_applySearchParam(Object(craft\db\Connection))
#9 /app/vendor/yiisoft/yii2/db/QueryBuilder.php(227): craft\elements\db\ElementQuery->prepare(Object(craft\db\mysql\QueryBuilder))
#10 /app/vendor/yiisoft/yii2/db/Query.php(146): yii\db\QueryBuilder->build(Object(craft\elements\db\EntryQuery))
#11 /app/vendor/yiisoft/yii2/db/Query.php(237): yii\db\Query->createCommand(Object(craft\db\Connection))
#12 /app/vendor/craftcms/cms/src/db/Query.php(152): yii\db\Query->all(NULL)
#13 /app/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1482): craft\db\Query->all(NULL)
#14 /app/vendor/craftcms/cms/src/base/Element.php(620): craft\elements\db\ElementQuery->all()
#15 /app/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(535): craft\base\Element::indexHtml(Object(craft\elements\db\EntryQuery), Array, Array, '*', 'index', true, true)
#16 /app/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(135): craft\controllers\ElementIndexesController->elementResponseData(true, true)
#17 [internal function]: craft\controllers\ElementIndexesController->actionGetElements()
#18 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#19 /app/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#20 /app/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('get-elements', Array)
#21 /app/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('get-elements', Array)
#22 /app/vendor/craftcms/cms/src/web/Application.php(290): yii\base\Module->runAction('element-indexes...', Array)
#23 /app/vendor/craftcms/cms/src/web/Application.php(558): craft\web\Application->runAction('element-indexes...', Array)
#24 /app/vendor/craftcms/cms/src/web/Application.php(269): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#25 /app/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#26 /app/public/index.php(21): yii\base\Application->run()
#27 {main}

Just happened to me too trying to search for an entry in the entry selection modal:

2020-02-06 03:01:24 [-][1][-][error][yii\db\Exception] PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'score' in 'order clause' in /Users/********/Sites/********/vendor/yiisoft/yii2/db/Command.php:1290
Stack trace:
#0 /Users/********/Sites/********/vendor/yiisoft/yii2/db/Command.php(1290): PDOStatement->execute()
#1 /Users/********/Sites/********/vendor/yiisoft/yii2/db/Command.php(1158): yii\db\Command->internalExecute('SELECT `element...')
#2 /Users/********/Sites/********/vendor/yiisoft/yii2/db/Command.php(442): yii\db\Command->queryInternal('fetchAll', 7)
#3 /Users/********/Sites/********/vendor/yiisoft/yii2/db/Query.php(307): yii\db\Command->queryColumn()
#4 /Users/********/Sites/********/vendor/craftcms/cms/src/db/Query.php(202): yii\db\Query->column(NULL)
#5 /Users/********/Sites/********/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1523): craft\db\Query->column(NULL)
#6 /Users/********/Sites/********/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1563): craft\elements\db\ElementQuery->column(NULL)
#7 /Users/********/Sites/********/vendor/craftcms/cms/src/elements/db/ElementQuery.php(2523): craft\elements\db\ElementQuery->ids()
#8 /Users/********/Sites/********/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1418): craft\elements\db\ElementQuery->_applySearchParam(Object(craft\db\Connection))
#9 /Users/********/Sites/********/vendor/yiisoft/yii2/db/QueryBuilder.php(227): craft\elements\db\ElementQuery->prepare(Object(craft\db\mysql\QueryBuilder))
#10 /Users/********/Sites/********/vendor/yiisoft/yii2/db/Query.php(146): yii\db\QueryBuilder->build(Object(craft\elements\db\EntryQuery))
#11 /Users/********/Sites/********/vendor/yiisoft/yii2/db/Query.php(237): yii\db\Query->createCommand(Object(craft\db\Connection))
#12 /Users/********/Sites/********/vendor/craftcms/cms/src/db/Query.php(152): yii\db\Query->all(NULL)
#13 /Users/********/Sites/********/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1482): craft\db\Query->all(NULL)
#14 /Users/********/Sites/********/vendor/craftcms/cms/src/base/Element.php(620): craft\elements\db\ElementQuery->all()
#15 /Users/********/Sites/********/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(535): craft\base\Element::indexHtml(Object(craft\elements\db\EntryQuery), Array, Array, 'section:cdc8a15...', 'modal', true, false)
#16 /Users/********/Sites/********/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(135): craft\controllers\ElementIndexesController->elementResponseData(true, false)
#17 [internal function]: craft\controllers\ElementIndexesController->actionGetElements()
#18 /Users/********/Sites/********/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#19 /Users/********/Sites/********/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#20 /Users/********/Sites/********/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('get-elements', Array)
#21 /Users/********/Sites/********/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('get-elements', Array)
#22 /Users/********/Sites/********/vendor/craftcms/cms/src/web/Application.php(290): yii\base\Module->runAction('element-indexes...', Array)
#23 /Users/********/Sites/********/vendor/craftcms/cms/src/web/Application.php(558): craft\web\Application->runAction('element-indexes...', Array)
#24 /Users/********/Sites/********/vendor/craftcms/cms/src/web/Application.php(269): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#25 /Users/********/Sites/********/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#26 /Users/********/Sites/********/public/index.php(21): yii\base\Application->run()
#27 /Users/********/.composer/vendor/laravel/valet/server.php(158): require('/Users/darylkni...')
#28 {main}

Craft version: 3.4.4
PHP version: 7.4.2
Database driver & version: MySQL 5.5.5

Just fixed this for the next release 鈥撀爓ill get that out a little later today.

Brill. Thanks @brandonkelly

3.4.4.1 is out now with the fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bitboxfw picture bitboxfw  路  3Comments

mattstein picture mattstein  路  3Comments

davist11 picture davist11  路  3Comments

angrybrad picture angrybrad  路  3Comments

lukebailey picture lukebailey  路  3Comments