You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had to make a huge search-replace in our project and it fails with the latest version in the corner of the type casting functions called before executing the update. I haven't had much time to pre-dig into it to help the diagnosis as I usually like to do, but it seems related to type casting the database before executing the update.
Steps to reproduce
Create entries with "asdf" or any words inside a sub-matrix block.
Use the admin interface "Find and replace" utility and search "asdf" to change it to "whatever"
The queue manager outputs the error
Expected behavior
Search and replace should go through.
Actual behavior
It seems to fail at type casting, maybe some of the array or json types?
Hi, thanks for reaching out! I’m not able to reproduce this. Any chance you could send your composer.json, composer.lock and database export to [email protected] and point out the find and replace strings you’re using when this error occurs?
What happened?
Description
Hi!
Had to make a huge search-replace in our project and it fails with the latest version in the corner of the type casting functions called before executing the update. I haven't had much time to pre-dig into it to help the diagnosis as I usually like to do, but it seems related to type casting the database before executing the update.
Steps to reproduce
Expected behavior
Search and replace should go through.
Actual behavior
It seems to fail at type casting, maybe some of the array or json types?
Stack trace
[queue.ERROR] [craft\queue\QueueLogBehavior::afterError] [93652] Replacing “asdf” with “whatever” (batch 1 of 3) (attempt: 1, pid: 99598) - Error (time: 0.727s): Array to string conversion {"memory":5160368}
[queue.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Array to string conversion in vendor/yiisoft/yii2/db/ColumnSchema.php:173
Stack trace:
[queue.ERROR] [craft\queue\QueueLogBehavior::afterError] [93652] Replacing “asdf” with “whatever” (batch 1 of 3) (attempt: 1, pid: 99598) - Error (time: 0.727s): Array to string conversion {"memory":5160368}
[queue.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Array to string conversion in vendor/yiisoft/yii2/db/ColumnSchema.php:173
Stack trace:
#0 vendor/craftcms/cms/src/web/ErrorHandler.php(115): yii\base\ErrorHandler->handleError(2, 'Array to string...', '...', 173)
#1 vendor/yiisoft/yii2/db/ColumnSchema.php(173): craft\web\ErrorHandler->handleError(2, 'Array to string...', '...', 173)
#2 vendor/craftcms/cms/src/db/mysql/ColumnSchema.php(36): yii\db\ColumnSchema->typecast(Array)
#3 vendor/yiisoft/yii2/db/mysql/ColumnSchema.php(49): craft\db\mysql\ColumnSchema->typecast(Array)
#4 vendor/yiisoft/yii2/db/QueryBuilder.php(651): yii\db\mysql\ColumnSchema->dbTypecast(Array)
#5 vendor/yiisoft/yii2/db/QueryBuilder.php(630): yii\db\QueryBuilder->prepareUpdateSets('{{%elements_sit...', Array, Array)
#6 vendor/yiisoft/yii2/db/Command.php(598): yii\db\QueryBuilder->update('{{%elements_sit...', Array, Array, Array)
#7 vendor/craftcms/cms/src/db/Command.php(152): yii\db\Command->update('{{%elements_sit...', Array, Array, Array)
#8 vendor/craftcms/cms/src/helpers/Db.php(1116): craft\db\Command->update('{{%elements_sit...', Array, Array, Array, false)
#9 vendor/craftcms/cms/src/queue/jobs/FindAndReplace.php(61): craft\helpers\Db::update('{{%elements_sit...', Array, Array, Array, false)
#10 vendor/craftcms/cms/src/queue/BaseBatchedJob.php(137): craft\queue\jobs\FindAndReplace->processItem(Array)
#11 vendor/yiisoft/yii2-queue/src/Queue.php(243): craft\queue\BaseBatchedJob->execute(Object(craft\queue\Queue))
#12 vendor/yiisoft/yii2-queue/src/cli/Queue.php(147): yii\queue\Queue->handleMessage(93652, 'O:31:"craft\que...', 300, 1)
#13 vendor/craftcms/cms/src/queue/Queue.php(192): yii\queue\cli\Queue->handleMessage(93652, 'O:31:"craft\que...', 300, 1)
#14 vendor/craftcms/cms/src/queue/Queue.php(167): craft\queue\Queue->executeJob()
#15 [internal function]: craft\queue\Queue->craft\queue{closure}(Object(Closure))
#16 vendor/yiisoft/yii2-queue/src/cli/Queue.php(114): call_user_func(Object(Closure), Object(Closure))
#17 vendor/craftcms/cms/src/queue/Queue.php(165): yii\queue\cli\Queue->runWorker(Object(Closure))
#18 vendor/craftcms/cms/src/controllers/QueueController.php(98): craft\queue\Queue->run()
#19 vendor/craftcms/cms/src/controllers/QueueController.php(118): craft\controllers\QueueController->actionRun()
#20 [internal function]: craft\controllers\QueueController->actionRetry()
#21 vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#22 vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#23 vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('retry', Array)
#24 vendor/craftcms/cms/src/web/Application.php(361): yii\base\Module->runAction('queue/retry', Array)
#25 vendor/craftcms/cms/src/web/Application.php(660): craft\web\Application->runAction('queue/retry', Array)
#26 vendor/craftcms/cms/src/web/Application.php(323): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#27 vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#28 web/index.php(12): yii\base\Application->run()
#29 {main} {"memory":5160640,"exception":"[object] (yii\base\ErrorException(code: 2): Array to string conversion at vendor/yiisoft/yii2/db/ColumnSchema.php:173)"}
[queue.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Array to string conversion in vendor/yiisoft/yii2/db/ColumnSchema.php:173
Stack trace:
#0 vendor/craftcms/cms/src/web/ErrorHandler.php(115): yii\base\ErrorHandler->handleError(2, 'Array to string...', '...', 173)
#1 vendor/yiisoft/yii2/db/ColumnSchema.php(173): craft\web\ErrorHandler->handleError(2, 'Array to string...', '...', 173)
#2 vendor/craftcms/cms/src/db/mysql/ColumnSchema.php(36): yii\db\ColumnSchema->typecast(Array)
#3 vendor/yiisoft/yii2/db/mysql/ColumnSchema.php(49): craft\db\mysql\ColumnSchema->typecast(Array)
#4 vendor/yiisoft/yii2/db/QueryBuilder.php(651): yii\db\mysql\ColumnSchema->dbTypecast(Array)
#5 vendor/yiisoft/yii2/db/QueryBuilder.php(630): yii\db\QueryBuilder->prepareUpdateSets('{{%elements_sit...', Array, Array)
#6 vendor/yiisoft/yii2/db/Command.php(598): yii\db\QueryBuilder->update('{{%elements_sit...', Array, Array, Array)
#7 vendor/craftcms/cms/src/db/Command.php(152): yii\db\Command->update('{{%elements_sit...', Array, Array, Array)
#8 vendor/craftcms/cms/src/helpers/Db.php(1116): craft\db\Command->update('{{%elements_sit...', Array, Array, Array, false)
#9 vendor/craftcms/cms/src/queue/jobs/FindAndReplace.php(61): craft\helpers\Db::update('{{%elements_sit...', Array, Array, Array, false)
#10 vendor/craftcms/cms/src/queue/BaseBatchedJob.php(137): craft\queue\jobs\FindAndReplace->processItem(Array)
#11 vendor/yiisoft/yii2-queue/src/Queue.php(243): craft\queue\BaseBatchedJob->execute(Object(craft\queue\Queue))
#12 vendor/yiisoft/yii2-queue/src/cli/Queue.php(147): yii\queue\Queue->handleMessage(93652, 'O:31:"craft\que...', 300, 1)
#13 vendor/craftcms/cms/src/queue/Queue.php(192): yii\queue\cli\Queue->handleMessage(93652, 'O:31:"craft\que...', 300, 1)
#14 vendor/craftcms/cms/src/queue/Queue.php(167): craft\queue\Queue->executeJob()
#15 [internal function]: craft\queue\Queue->craft\queue{closure}(Object(Closure))
#16 vendor/yiisoft/yii2-queue/src/cli/Queue.php(114): call_user_func(Object(Closure), Object(Closure))
#17 vendor/craftcms/cms/src/queue/Queue.php(165): yii\queue\cli\Queue->runWorker(Object(Closure))
#18 vendor/craftcms/cms/src/controllers/QueueController.php(98): craft\queue\Queue->run()
#19 vendor/craftcms/cms/src/controllers/QueueController.php(118): craft\controllers\QueueController->actionRun()
#20 [internal function]: craft\controllers\QueueController->actionRetry()
#21 vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#22 vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#23 vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('retry', Array)
#24 vendor/craftcms/cms/src/web/Application.php(361): yii\base\Module->runAction('queue/retry', Array)
#25 vendor/craftcms/cms/src/web/Application.php(660): craft\web\Application->runAction('queue/retry', Array)
#26 vendor/craftcms/cms/src/web/Application.php(323): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#27 vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#28 web/index.php(12): yii\base\Application->run()
#29 {main} {"memory":5163256,"exception":"[object] (yii\base\ErrorException(code: 2): Array to string conversion at vendor/yiisoft/yii2/db/ColumnSchema.php:173)"}
Craft CMS version
5.6.9.1
PHP version
8.2.20 locally and 8.2.27 on remote
Operating system and version
MacOS Sequoia 15.3 locally and AlmaLinux 8.10 (Linux 4.18.0-553.30.1.el8_10.x86_64) on remote
Database type and version
MySQL 8.3.0 locally and 8.0.41 on remote
Image driver and version
GD 8.2.27 locally and GD 8.2.20 on remote
Installed plugins and versions
The text was updated successfully, but these errors were encountered: