Answers.Body: <p>As per comments, possibly there was a sequence of failed upgrades and restore where the restore to 5.47 ended up with some changes from 5.48. Fixed in this case by <code>drop table civicrm_queue</code>, recreating with <a href="https://github.com/civicrm/civicrm-core/blob/4cbeb3a31baea58d44813905e3b131b4ae26bfea/CRM/Upgrade/Incremental/sql/5.47.alpha1.mysql.tpl#L3-L11" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/4cbeb3a31baea58d44813905e3b131b4ae26bfea/CRM/Upgrade/Incremental/sql/5.47.alpha1.mysql.tpl#L3-L11</a>, and then running the upgrade.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-13T17:22:53.667Z
Answers.LastActivityDate: 2022-07-13T17:22:53.667Z
Answers.UserDisplayName: Demerit
Body: <p>I just tried to update a CiviCRM 5.47.4 installation to the latest 5.51.0 and I am getting this error during the database upgrade process.</p>
  <p>Once the upgrade failed I reset both the filesystem and database back to where it was before I had started. So I'm back in 5.47.4. But I don't have a way to go back any farther than that. It was the first time I attempted this upgrade and I'm hoping someone can help me with what I need to do so the upgrade will be able to succeed when I try it again.</p>
  <p>I do not see an is_autorun field in my civicrm_queue table so if that was supposed to be created I suppose something failed along the way that I was unaware of.</p>
  <p>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']</p>
  <p>PEAR_Exception: DB Error: no such field in /home/kepw/www/www/wp-content/plugins/civicrm/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</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-08T20:25:26.623Z
Comments.Text: Is this a site where you tried the upgrade more than once? You can get that error if running thru the 5.48 steps again without doing a complete drop and restore from backup before rerunning.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-08T20:27:43.637Z
Comments.Text: If not, are you able to see from a backup what your civicrm_queue table looked like in 5.47? There should be a line in the backup file starting with CREATE TABLE civicrm_queue
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-11T16:05:09.837Z
Comments.Text: Once the upgrade failed I reset both the filesystem and database back to where it was before I had started. So I'm back in 5.47.4. But I don't have a way to go back any farther than that. I see the civicrm_queue table. It was the first time I attempted this upgrade.
Comments.UserDisplayName: Joshua K
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-13T00:27:35.430Z
Comments.Text: @Demerit I've updated this question and am hoping you'll have more input for me. Thanks!
Comments.UserDisplayName: Joshua K
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-13T13:52:16.603Z
Comments.Text: I don't know how it would be possible to have a 5.47 backup that had never gone past 5.48 that has a civicrm_queue table but doesn't have is_autorun. The only thing I can think is a sequence of failed upgrades that included some 5.48. Since you probably don't have anything in civicrm_queue, try `drop table civicrm_queue`, then create it using https://github.com/civicrm/civicrm-core/blob/4cbeb3a31baea58d44813905e3b131b4ae26bfea/CRM/Upgrade/Incremental/sql/5.47.alpha1.mysql.tpl#L3-L11 (leave out the utf8mb4 if your database is only utf8), then run the upgrade.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-13T16:24:38.187Z
Comments.Text: Thank you @Demerit that fixed the issue. Perhaps the restore function I used when the upgrade failed was not restoring things as completely as I assumed. I was successfully able to run the entire upgrade process after dropping and re-creating the civicrm_queue table.
Comments.UserDisplayName: Joshua K
Tags: <wordpress><upgrade>
Title: PEAR_Exception: DB Error: no such field, while upgrading CiviCRM in Wordpress
ThreadText: # PEAR_Exception: DB Error: no such field, while upgrading CiviCRM in Wordpress
  
  (Asked by: username_0 on 2022-07-08)
  
  I just tried to update a CiviCRM 5.47.4 installation to the latest 5.51.0 and I am getting this error during the database upgrade process.
  
  Once the upgrade failed I reset both the filesystem and database back to where it was before I had started. So I'm back in 5.47.4. But I don't have a way to go back any farther than that. It was the first time I attempted this upgrade and I'm hoping someone can help me with what I need to do so the upgrade will be able to succeed when I try it again.
  
  I do not see an is\_autorun field in my civicrm\_queue table so if that was supposed to be created I suppose something failed along the way that I was unaware of.
  
  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/kepw/www/www/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922
  
  * DB\_Error: DB Error: no such field in unknown on line unknown
  
  **Tags:** wordpress, upgrade
  
  > **Comments:**
  > **username_1**: Is this a site where you tried the upgrade more than once? You can get that error if running thru the 5.48 steps again without doing a complete drop and restore from backup before rerunning.  
  > **username_1**: If not, are you able to see from a backup what your civicrm_queue table looked like in 5.47? There should be a line in the backup file starting with CREATE TABLE civicrm_queue  
  > **username_0**: Once the upgrade failed I reset both the filesystem and database back to where it was before I had started. So I'm back in 5.47.4. But I don't have a way to go back any farther than that. I see the civicrm_queue table. It was the first time I attempted this upgrade.  
  > **username_0**: @username_1 I've updated this question and am hoping you'll have more input for me. Thanks!  
  > **username_1**: I don't know how it would be possible to have a 5.47 backup that had never gone past 5.48 that has a civicrm_queue table but doesn't have is_autorun. The only thing I can think is a sequence of failed upgrades that included some 5.48. Since you probably don't have anything in civicrm_queue, try `drop table civicrm_queue`, then create it using https://github.com/civicrm/civicrm-core/blob/4cbeb3a31baea58d44813905e3b131b4ae26bfea/CRM/Upgrade/Incremental/sql/5.47.alpha1.mysql.tpl#L3-L11 (leave out the utf8mb4 if your database is only utf8), then run the upgrade.  
  > **username_0**: Thank you @username_1 that fixed the issue. Perhaps the restore function I used when the upgrade failed was not restoring things as completely as I assumed. I was successfully able to run the entire upgrade process after dropping and re-creating the civicrm_queue table.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-07-13. Score: 0 | Accepted answer
  
  As per comments, possibly there was a sequence of failed upgrades and restore where the restore to 5.47 ended up with some changes from 5.48. Fixed in this case by `drop table civicrm_queue`, recreating with <https://github.com/civicrm/civicrm-core/blob/4cbeb3a31baea58d44813905e3b131b4ae26bfea/CRM/Upgrade/Incremental/sql/5.47.alpha1.mysql.tpl#L3-L11>, and then running the upgrade.
  
  
  ---
  
  