solspace/craft-express-forms

After a form is submitted, failed "Updating search indexes" jobs appear in queue

Closed this issue · 1 comments

Description

After a form has been submitted, when I go to the Craft control panel I see a failed "Updating search indexes" job for every new submission.

This is the stacktrace from queue.log:

2019-07-26 10:40:45 [-][1][-][info][craft\queue\QueueLogBehavior::beforeExec]  [45] Updating search indexes (attempt: 1) - Started
2019-07-26 10:40:45 [-][1][-][info][yii\db\Command::query] SELECT `id`, `handle`
FROM `expressforms_forms`
2019-07-26 10:40:45 [-][1][-][profile begin][yii\db\Command::query] SELECT `id`, `handle`
FROM `expressforms_forms`
2019-07-26 10:40:45 [-][1][-][profile end][yii\db\Command::query] SELECT `id`, `handle`
FROM `expressforms_forms`
2019-07-26 10:40:45 [-][1][-][info][yii\db\Command::query] SELECT `formId`
FROM `expressforms_submissions`
WHERE `id`=10008
2019-07-26 10:40:45 [-][1][-][profile begin][yii\db\Command::query] SELECT `formId`
FROM `expressforms_submissions`
WHERE `id`=10008
2019-07-26 10:40:45 [-][1][-][profile end][yii\db\Command::query] SELECT `formId`
FROM `expressforms_submissions`
WHERE `id`=10008
2019-07-26 10:40:45 [-][1][-][info][yii\db\Command::query] SELECT `expressforms_forms`.`id`, `expressforms_forms`.`uuid`, `expressforms_forms`.`fieldLayoutId`, `expressforms_forms`.`name`, `expressforms_forms`.`handle`, `expressforms_forms`.`description`, `expressforms_forms`.`color`, `expressforms_forms`.`submissionTitle`, `expressforms_forms`.`saveSubmissions`, `expressforms_forms`.`adminNotification`, `expressforms_forms`.`adminEmails`, `expressforms_forms`.`submitterNotification`, `expressforms_forms`.`submitterEmailField`, `expressforms_forms`.`spamCount`, `expressforms_forms`.`integrations`
FROM `expressforms_forms`
WHERE `expressforms_forms`.`id`=2
GROUP BY `expressforms_forms`.`id`
ORDER BY `expressforms_forms`.`sortOrder`
LIMIT 1
2019-07-26 10:40:45 [-][1][-][profile begin][yii\db\Command::query] SELECT `expressforms_forms`.`id`, `expressforms_forms`.`uuid`, `expressforms_forms`.`fieldLayoutId`, `expressforms_forms`.`name`, `expressforms_forms`.`handle`, `expressforms_forms`.`description`, `expressforms_forms`.`color`, `expressforms_forms`.`submissionTitle`, `expressforms_forms`.`saveSubmissions`, `expressforms_forms`.`adminNotification`, `expressforms_forms`.`adminEmails`, `expressforms_forms`.`submitterNotification`, `expressforms_forms`.`submitterEmailField`, `expressforms_forms`.`spamCount`, `expressforms_forms`.`integrations`
FROM `expressforms_forms`
WHERE `expressforms_forms`.`id`=2
GROUP BY `expressforms_forms`.`id`
ORDER BY `expressforms_forms`.`sortOrder`
LIMIT 1
2019-07-26 10:40:45 [-][1][-][profile end][yii\db\Command::query] SELECT `expressforms_forms`.`id`, `expressforms_forms`.`uuid`, `expressforms_forms`.`fieldLayoutId`, `expressforms_forms`.`name`, `expressforms_forms`.`handle`, `expressforms_forms`.`description`, `expressforms_forms`.`color`, `expressforms_forms`.`submissionTitle`, `expressforms_forms`.`saveSubmissions`, `expressforms_forms`.`adminNotification`, `expressforms_forms`.`adminEmails`, `expressforms_forms`.`submitterNotification`, `expressforms_forms`.`submitterEmailField`, `expressforms_forms`.`spamCount`, `expressforms_forms`.`integrations`
FROM `expressforms_forms`
WHERE `expressforms_forms`.`id`=2
GROUP BY `expressforms_forms`.`id`
ORDER BY `expressforms_forms`.`sortOrder`
LIMIT 1
2019-07-26 10:40:45 [-][1][-][error][craft\queue\QueueLogBehavior::afterError]  [45] Updating search indexes (attempt: 1) - Error (time: 0.009s): session_set_cookie_params(): Cannot change session cookie parameters when headers already sent
2019-07-26 10:40:45 [-][1][-][error][yii\base\ErrorException:2] yii\base\ErrorException: session_set_cookie_params(): Cannot change session cookie parameters when headers already sent in /path/to/project/vendor/yiisoft/yii2/web/Session.php:404
Stack trace:
#0 /path/to/project/vendor/yiisoft/yii2/web/Session.php(404): ::session_set_cookie_params()
#1 /path/to/project/vendor/yiisoft/yii2/web/Session.php(135): craft\web\Session->setCookieParamsInternal()
#2 /path/to/project/vendor/yiisoft/yii2/web/Session.php(630): craft\web\Session->open()
#3 /path/to/project/vendor/yiisoft/yii2/web/Session.php(722): craft\web\Session->get()
#4 /path/to/project/vendor/craftcms/cms/src/web/Session.php(53): craft\web\Session->getFlash()
#5 /path/to/project/vendor/solspace/craft-express-forms/src/providers/Session/FlashBagProvider.php(15): craft\web\Session->getFlash()
#6 /path/to/project/vendor/solspace/craft-express-forms/src/decorators/Forms/BaseFunctionality/SubmitFlashMessageDecorator.php(46): Solspace\ExpressForms\providers\Session\FlashBagProvider->get()
#7 /path/to/project/vendor/yiisoft/yii2/base/Event.php(312): Solspace\ExpressForms\decorators\Forms\BaseFunctionality\SubmitFlashMessageDecorator->attachParameterToForm()
#8 /path/to/project/vendor/yiisoft/yii2/base/Event.php(312): ::call_user_func:{/path/to/project/vendor/yiisoft/yii2/base/Event.php:312}()
#9 /path/to/project/vendor/solspace/craft-express-forms/src/factories/FormFactory.php(57): yii\base\Event::trigger()
#10 /path/to/project/vendor/solspace/craft-express-forms/src/services/Forms.php(229): Solspace\ExpressForms\factories\FormFactory->populateFromArray()
#11 /path/to/project/vendor/solspace/craft-express-forms/src/services/Forms.php(38): Solspace\ExpressForms\services\Forms->createFormFromDbData()
#12 /path/to/project/vendor/solspace/craft-express-forms/src/elements/db/SubmissionQuery.php(145): Solspace\ExpressForms\services\Forms->getFormById()
#13 /path/to/project/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1311): Solspace\ExpressForms\elements\db\SubmissionQuery->customFields()
#14 /path/to/project/vendor/yiisoft/yii2/db/QueryBuilder.php(227): Solspace\ExpressForms\elements\db\SubmissionQuery->prepare()
#15 /path/to/project/vendor/yiisoft/yii2/db/Query.php(146): craft\db\mysql\QueryBuilder->build()
#16 /path/to/project/vendor/yiisoft/yii2/db/Query.php(237): Solspace\ExpressForms\elements\db\SubmissionQuery->createCommand()
#17 /path/to/project/vendor/craftcms/cms/src/db/Query.php(162): Solspace\ExpressForms\elements\db\SubmissionQuery->all()
#18 /path/to/project/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1441): Solspace\ExpressForms\elements\db\SubmissionQuery->all()
#19 /path/to/project/vendor/craftcms/cms/src/queue/jobs/UpdateSearchIndex.php(49): Solspace\ExpressForms\elements\db\SubmissionQuery->all()
#20 /path/to/project/vendor/yiisoft/yii2-queue/src/Queue.php(214): craft\queue\jobs\UpdateSearchIndex->execute()
#21 /path/to/project/vendor/yiisoft/yii2-queue/src/cli/Queue.php(147): craft\queue\Queue->handleMessage()
#22 /path/to/project/vendor/craftcms/cms/src/queue/Queue.php(96): craft\queue\Queue->handleMessage()
#23 /path/to/project/vendor/craftcms/cms/src/controllers/QueueController.php(86): craft\queue\Queue->run()
#24 /path/to/project/vendor/yiisoft/yii2/base/InlineAction.php(57): craft\controllers\QueueController->actionRun()
#25 /path/to/project/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/path/to/project/vendor/yiisoft/yii2/base/InlineAction.php:57}()
#26 /path/to/project/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()
#27 /path/to/project/vendor/craftcms/cms/src/web/Controller.php(187): craft\controllers\QueueController->runAction()
#28 /path/to/project/vendor/yiisoft/yii2/base/Module.php(528): craft\controllers\QueueController->runAction()
#29 /path/to/project/vendor/craftcms/cms/src/web/Application.php(299): craft\web\Application->runAction()
#30 /path/to/project/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application->runAction()
#31 /path/to/project/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application->_processActionRequest()
#32 /path/to/project/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()
#33 /path/to/project/web/index.php(21): craft\web\Application->run()
#34 {main}
2019-07-26 10:40:45 [-][1][-][info][yii\db\Command::execute] UPDATE `queue` SET `fail`=1, `dateFailed`='2019-07-26 17:40:45', `error`='session_set_cookie_params(): Cannot change session cookie parameters when headers already sent' WHERE `id`='45'

Any idea what the issue might be?

  • Express Forms edition & version: Lite 1.0.2
  • Craft version: 3.2.7
  • PHP version: 7.2
  • Database driver & version: MySQL

@mtnorthrop Thanks, I can duplicate this myself - seems to happen in Craft 3.2+
We'll get a fix available for it soon. :)