Answers.Body: <p>This worked for me. I followed the steps, but I had to disable foreign keys and after re-creating the table civicrm_queue re-enable them by doing:
  SET FOREIGN_KEY_CHECKS=0; -- disable,
  ...
  SET FOREIGN_KEY_CHECKS=1; -- to re-enable them</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-18T13:59:19.317Z
Answers.Text: This does not provide an answer to the question. Once you have sufficient [reputation](https://civicrm.stackexchange.com/help/whats-reputation) you will be able to [comment on any post](https://civicrm.stackexchange.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/13799)
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-13T06:34:10.717Z
Answers.LastActivityDate: 2023-07-13T06:34:10.717Z
Answers.UserDisplayName: Cristian Cisternas Vásquez
Answers.Body: <p>This can happen if you try to re-run through the 5.48 part of the import and didn't do a complete drop of the database before restoring from backup. Find a pre-5.48 backup, drop the database completely, restore that backup, and then run the upgrade again.</p>
  <p>Update: To address the second issue below in comments, what <em>might</em> work is:</p>
  <ul>
  <li>drop the database completely</li>
  <li>restore the &quot;corrupted&quot; 5.47 database:</li>
  <li>then do <code>DROP TABLE civicrm_queue;</code></li>
  <li>then do the following, but if your database tables use utf8 instead of utf8mb4 then replace utf8mb4 below with utf8 everywhere. (You can check with something like <code>SHOW TABLE STATUS WHERE name = 'civicrm_contact';</code> and look in the collation column.)</li>
  </ul>
  <pre><code>CREATE TABLE `civicrm_queue` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Name of the queue',
    `type` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type of the queue',
    `runner` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the task runner',
    `batch_limit` int(10) unsigned NOT NULL DEFAULT 1 COMMENT 'Maximum number of items in a batch.',
    `lease_time` int(10) unsigned NOT NULL DEFAULT 3600 COMMENT 'When claiming an item (or batch of items) for work, how long should the item(s) be reserved. (Seconds)',
    `retry_limit` int(11) NOT NULL DEFAULT 0 COMMENT 'Number of permitted retries. Set to zero (0) to disable.',
    `retry_interval` int(11) DEFAULT NULL COMMENT 'Number of seconds to wait before retrying a failed execution.',
    `status` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT 'Execution status',
    `error` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Fallback behavior for unhandled errors',
    `is_template` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Is this a template configuration (for use by other/future queues)?',
    PRIMARY KEY (`id`),
    UNIQUE KEY `UI_name` (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC
  </code></pre>
  <ul>
  <li>then run the upgrade</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-19T13:23:59.733Z
Answers.Text: Thank you very much.
Answers.UserDisplayName: Steven James
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-19T23:17:43.017Z
Answers.Text: In April, I attempted an update from 5.44 to 5.48 which failed. At that point I did restore, without dropping the database (as suspected above). At the time, time was limited and I updated to 5.47.4 which has been working. Unfortunately a backup pre that event has been over-written. Dropping the database now and restoring the working 5.47 database still fails suggesting that the corruption is being restored. Any suggestions how I should proceed from here? Ideas gratefully received.
Answers.UserDisplayName: Steven James
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-20T02:38:30.140Z
Answers.Text: I'll update the answer since there isn't space to paste here.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-21T09:22:20.773Z
Answers.Text: SO helpful. Thank you. Will give it a go.
Answers.UserDisplayName: Steven James
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-07T10:38:39.133Z
Answers.Text: This *almost* worked for me. I found that recreating the `civicrm_queue` table still caused the upgrade to fail, whereas just dropping the table and re-running the upgrade did work.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-17T16:42:02.710Z
Answers.LastActivityDate: 2022-06-20T02:46:19.010Z
Answers.LastEditDate: 2022-06-20T02:46:19.010Z
Answers.UserDisplayName: Demerit
Body: <p>Attempting to update Civi to 5.50.3
  [Drupal 7.9, updating from 5.47, PHP v7.3, Server version: 5.7.36-39-log - MySQL Community Server (GPL)]</p>
  <p>Run into PEAR related database update error. Any thoughts/assistance most appreciated.
  <a href="https://i.sstatic.net/5ywa6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5ywa6.png" alt="screenshot at stall" /></a></p>
  <p>Full screen text as follows:
  Skip to main content
  [Error: Convert &quot;is_autorun&quot; to &quot;runner&quot;]
  Error Field Error Value
  Type    DB_Error
  Code    -19
  Message DB Error: no such field
  Mode    16
  UserInfo    UPDATE civicrm_queue SET runner = &quot;task&quot; WHERE is_autorun = 1 [nativecode=1054 ** Unknown column 'is_autorun' in 'where clause']
  DebugInfo   UPDATE civicrm_queue SET runner = &quot;task&quot; WHERE is_autorun = 1 [nativecode=1054 ** Unknown column 'is_autorun' in 'where clause']
  PEAR_Exception: DB Error: no such field in /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922</p>
  <ul>
  <li>DB_Error: DB Error: no such field in unknown on line unknown
  Exception trace</li>
  </ul>
  <h1>Function    Location</h1>
  <p>0   CRM_Core_Error::exceptionHandler(Object(DB_Error))  /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:922
  1   PEAR_Error-&gt;__construct('DB Error: no suc…', -19, 16, Array, 'UPDATE civicrm_q…')   /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB.php:997
  2   DB_Error-&gt;__construct(-19, 16, Array, 'UPDATE civicrm_q…')  /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:575
  3   PEAR-&gt;_raiseError(Object(DB_mysqli), null, -19, 16, Array, 'UPDATE civicrm_q…', 'DB_Error', true)   /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:223
  4   PEAR-&gt;__call('raiseError', Array)   /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/common.php:1928
  5   DB_common-&gt;raiseError(-19, null, null, 'UPDATE civicrm_q…', '1054 ** Unknown …')    /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php:936
  6   DB_mysqli-&gt;mysqliRaiseError()   /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php:406
  7   DB_mysqli-&gt;simpleQuery('UPDATE civicrm_q…') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/common.php:1234
  8   DB_common-&gt;query('UPDATE civicrm_q…')   /home/everyball/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php:2696
  9   DB_DataObject-&gt;_query('UPDATE civicrm_q…')  /home/everyball/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php:1829
  10  DB_DataObject-&gt;query('UPDATE civicrm_q…')   /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php:472
  11  CRM_Core_DAO-&gt;query('UPDATE civicrm_q…', true)  /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php:1637
  12  CRM_Core_DAO::executeQuery('UPDATE civicrm_q…') /home/everyball/www/www/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FiveFortyEight.php:107
  13  CRM_Upgrade_Incremental_php_FiveFortyEight::convertAutorun(Object(CRM_Queue_TaskContext))   /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Task.php:73
  14  CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))  /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Runner.php:215
  15  CRM_Queue_Runner-&gt;runNext(true) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:36
  16  CRM_Queue_Page_AJAX::{closure}()    /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:89
  17  CRM_Queue_ErrorPolicy-&gt;call(Object(Closure))    /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:38
  18  CRM_Queue_Page_AJAX::runNext()  /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:285
  19  CRM_Core_Invoke::runItem(Array) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:69
  20  CRM_Core_Invoke::_invoke(Array) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:36
  21  CRM_Core_Invoke::invoke(Array)  /home/everyball/www/www/sites/all/modules/civicrm/drupal/civicrm.module:471
  22  civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')   /home/everyball/www/www/includes/menu.inc:527
  23  menu_execute_active_handler()   /home/everyball/www/www/index.php:21
  24  {main}</p>
  
Tags: <upgrade><database>
Title: Error updating to civicrm 5.50.3 / Drupal 7.9
ThreadText: # Error updating to civicrm 5.50.3 / Drupal 7.9
  
  (Asked by: username_0 on 2022-06-17)
  
  Attempting to update Civi to 5.50.3
  [Drupal 7.9, updating from 5.47, PHP v7.3, Server version: 5.7.36-39-log - MySQL Community Server (GPL)]
  
  Run into PEAR related database update error. Any thoughts/assistance most appreciated.
  [![screenshot at stall](https://i.sstatic.net/5ywa6.png)](https://i.sstatic.net/5ywa6.png)
  
  Full screen text as follows:
  Skip to main content
  [Error: Convert "is\_autorun" to "runner"]
  Error Field Error Value
  Type DB\_Error
  Code -19
  Message DB Error: no such field
  Mode 16
  UserInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 [nativecode=1054 \*\* Unknown column 'is\_autorun' in 'where clause']
  DebugInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 [nativecode=1054 \*\* Unknown column 'is\_autorun' in 'where clause']
  PEAR\_Exception: DB Error: no such field in /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922
  
  * DB\_Error: DB Error: no such field in unknown on line unknown
    Exception trace
  
  # Function Location
  
  0 CRM\_Core\_Error::exceptionHandler(Object(DB\_Error)) /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:922
  1 PEAR\_Error->\_\_construct('DB Error: no suc…', -19, 16, Array, 'UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB.php:997
  2 DB\_Error->\_\_construct(-19, 16, Array, 'UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:575
  3 PEAR->\_raiseError(Object(DB\_mysqli), null, -19, 16, Array, 'UPDATE civicrm\_q…', 'DB\_Error', true) /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:223
  4 PEAR->\_\_call('raiseError', Array) /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/common.php:1928
  5 DB\_common->raiseError(-19, null, null, 'UPDATE civicrm\_q…', '1054 \*\* Unknown …') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php:936
  6 DB\_mysqli->mysqliRaiseError() /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php:406
  7 DB\_mysqli->simpleQuery('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/common.php:1234
  8 DB\_common->query('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php:2696
  9 DB\_DataObject->\_query('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php:1829
  10 DB\_DataObject->query('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php:472
  11 CRM\_Core\_DAO->query('UPDATE civicrm\_q…', true) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php:1637
  12 CRM\_Core\_DAO::executeQuery('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FiveFortyEight.php:107
  13 CRM\_Upgrade\_Incremental\_php\_FiveFortyEight::convertAutorun(Object(CRM\_Queue\_TaskContext)) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Task.php:73
  14 CRM\_Queue\_Task->run(Object(CRM\_Queue\_TaskContext)) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Runner.php:215
  15 CRM\_Queue\_Runner->runNext(true) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:36
  16 CRM\_Queue\_Page\_AJAX::{closure}() /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:89
  17 CRM\_Queue\_ErrorPolicy->call(Object(Closure)) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:38
  18 CRM\_Queue\_Page\_AJAX::runNext() /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:285
  19 CRM\_Core\_Invoke::runItem(Array) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:69
  20 CRM\_Core\_Invoke::\_invoke(Array) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:36
  21 CRM\_Core\_Invoke::invoke(Array) /home/everyball/www/www/sites/all/modules/civicrm/drupal/civicrm.module:471
  22 civicrm\_invoke('upgrade', 'queue', 'ajax', 'runNext') /home/everyball/www/www/includes/menu.inc:527
  23 menu\_execute\_active\_handler() /home/everyball/www/www/index.php:21
  24 {main}
  
  **Tags:** upgrade, database
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-07-13. Score: 1
  
  This worked for me. I followed the steps, but I had to disable foreign keys and after re-creating the table civicrm\_queue re-enable them by doing:
  SET FOREIGN\_KEY\_CHECKS=0; -- disable,
  ...
  SET FOREIGN\_KEY\_CHECKS=1; -- to re-enable them
  
  > **Comments:**
  > **username_2**: This does not provide an answer to the question. Once you have sufficient [reputation](https://civicrm.stackexchange.com/help/whats-reputation) you will be able to [comment on any post](https://civicrm.stackexchange.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/13799)  
  
  ---
  
  ### Answer by username_3 on 2022-06-17. Score: 1
  
  This can happen if you try to re-run through the 5.48 part of the import and didn't do a complete drop of the database before restoring from backup. Find a pre-5.48 backup, drop the database completely, restore that backup, and then run the upgrade again.
  
  Update: To address the second issue below in comments, what *might* work is:
  
  * drop the database completely
  * restore the "corrupted" 5.47 database:
  * then do `DROP TABLE civicrm_queue;`
  * then do the following, but if your database tables use utf8 instead of utf8mb4 then replace utf8mb4 below with utf8 everywhere. (You can check with something like `SHOW TABLE STATUS WHERE name = 'civicrm_contact';` and look in the collation column.)
  
  ```
  CREATE TABLE `civicrm_queue` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Name of the queue',
    `type` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type of the queue',
    `runner` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the task runner',
    `batch_limit` int(10) unsigned NOT NULL DEFAULT 1 COMMENT 'Maximum number of items in a batch.',
    `lease_time` int(10) unsigned NOT NULL DEFAULT 3600 COMMENT 'When claiming an item (or batch of items) for work, how long should the item(s) be reserved. (Seconds)',
    `retry_limit` int(11) NOT NULL DEFAULT 0 COMMENT 'Number of permitted retries. Set to zero (0) to disable.',
    `retry_interval` int(11) DEFAULT NULL COMMENT 'Number of seconds to wait before retrying a failed execution.',
    `status` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT 'Execution status',
    `error` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Fallback behavior for unhandled errors',
    `is_template` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Is this a template configuration (for use by other/future queues)?',
    PRIMARY KEY (`id`),
    UNIQUE KEY `UI_name` (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC
  
  ```
  
  * then run the upgrade
  
  > **Comments:**
  > **username_0**: Thank you very much.  
  > **username_0**: In April, I attempted an update from 5.44 to 5.48 which failed. At that point I did restore, without dropping the database (as suspected above). At the time, time was limited and I updated to 5.47.4 which has been working. Unfortunately a backup pre that event has been over-written. Dropping the database now and restoring the working 5.47 database still fails suggesting that the corruption is being restored. Any suggestions how I should proceed from here? Ideas gratefully received.  
  > **username_3**: I'll update the answer since there isn't space to paste here.  
  > **username_0**: SO helpful. Thank you. Will give it a go.  
  > **username_4**: This *almost* worked for me. I found that recreating the `civicrm_queue` table still caused the upgrade to fail, whereas just dropping the table and re-running the upgrade did work.  
  
  ---
  
  