Answers.Body: <p><strong>UPDATE</strong>: 5.76.1 is now available for download with the below fix.</p>
  <hr />
  <p>Can you change <a href="https://github.com/civicrm/civicrm-core/blob/0360234397a3521b276319e63b92ac0e4c5ddfe8/CRM/Upgrade/Incremental/php/FiveSeventySix.php#L252-L253" rel="nofollow noreferrer">these two lines</a> from</p>
  <pre><code>start_date = job.start_date,
  end_date = job.end_date,
  </code></pre>
  <p>to</p>
  <pre><code>m.start_date = job.start_date,
  m.end_date = job.end_date,
  </code></pre>
  <p>and see if that fixes it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-09T01:41:10.757Z
Answers.Text: I had the same error and this fixed it.
Answers.UserDisplayName: richardsplayground
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-09T02:41:03.197Z
Answers.Text: Yes, making this change allowed the upgrade to proceed without error. Thanks for such a quick response! I have marked your comment as the answer
Answers.UserDisplayName: brendanonline
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-09T04:13:55.077Z
Answers.Text: Thanks for the confirmations. Have put up PRs https://github.com/civicrm/civicrm-core/pull/30825 and https://github.com/civicrm/civicrm-core/pull/30826.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-09T04:52:12.900Z
Answers.Text: Worked for me as well.  Thank you!
Answers.UserDisplayName: Marv S
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-09T17:05:14.053Z
Answers.Text: It worked here as well. Thanks.
Answers.UserDisplayName: twowheeler
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-09T00:40:41.420Z
Answers.LastActivityDate: 2024-08-09T21:39:12.883Z
Answers.LastEditDate: 2024-08-09T21:39:12.883Z
Answers.UserDisplayName: Demerit
Body: <p>Environment:  Wordpress 6.6.1</p>
  <p>Each month I checked the release notes for the latest release and install it in production.
  This month I didn't see any special steps that should be taken when upgrading from 5.75.1 to 5.76.0 so I followed my usual deployment:</p>
  <ol>
  <li>downloading the latest zip file from civicrm using wget</li>
  <li>removing the civicrm plugin directory and unzipping the zip file</li>
  <li>running the upgrade tool:  wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fupgrade&amp;reset=1</li>
  </ol>
  <p>When running the tool I get the following error:</p>
  <p>[Error: Backfill civicrm_mailing start_date, end_date, status (7 =&gt; 42)]</p>
  <p>Message DB Error: unknown error
  Mode    16
  UserInfo    UPDATE civicrm_mailing m INNER JOIN (SELECT MIN(job.start_date) as start_date, MAX(job.end_date) as end_date, job.mailing_id FROM civicrm_mailing_job job WHERE job.status = &quot;Complete&quot; GROUP BY job.mailing_id ) as job ON job.mailing_id = m.id SET m.status = &quot;Complete&quot;, start_date = job.start_date, end_date = job.end_date, is_completed = 1 WHERE (m.status IS NULL OR m.status = &quot;Draft&quot;) AND m.id BETWEEN 7 AND 42 [nativecode=1052 ** Column 'start_date' in field list is ambiguous]
  DebugInfo   UPDATE civicrm_mailing m INNER JOIN (SELECT MIN(job.start_date) as start_date, MAX(job.end_date) as end_date, job.mailing_id FROM civicrm_mailing_job job WHERE job.status = &quot;Complete&quot; GROUP BY job.mailing_id ) as job ON job.mailing_id = m.id SET m.status = &quot;Complete&quot;, start_date = job.start_date, end_date = job.end_date, is_completed = 1 WHERE (m.status IS NULL OR m.status = &quot;Draft&quot;) AND m.id BETWEEN 7 AND 42 [nativecode=1052 ** Column 'start_date' in field list is ambiguous]</p>
  <p>Civi\Core\Exception\DBQueryException: DB Error: unknown error in /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 945</p>
  <ul>
  <li>DB_Error: DB Error: unknown error in unknown on line unknown</li>
  </ul>
  <p><a href="https://i.sstatic.net/0ksGQpIC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0ksGQpIC.png" alt="enter image description here" /></a></p>
  <p>It appears that there's a problem with the civicrm_mailing_job table.  I have upgraded just fine until this release.  Any ideas how to fix this so that I can upgrade?</p>
  
Tags: <upgrade><error><database>
Title: Backfill civicrm_mailing unknown error when upgrading to 5.76.0
ThreadText: # Backfill civicrm_mailing unknown error when upgrading to 5.76.0
  
  (Asked by: username_0 on 2024-08-08)
  
  Environment: Wordpress 6.6.1
  
  Each month I checked the release notes for the latest release and install it in production.
  This month I didn't see any special steps that should be taken when upgrading from 5.75.1 to 5.76.0 so I followed my usual deployment:
  
  1. downloading the latest zip file from civicrm using wget
  2. removing the civicrm plugin directory and unzipping the zip file
  3. running the upgrade tool: wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fupgrade&reset=1
  
  When running the tool I get the following error:
  
  [Error: Backfill civicrm\_mailing start\_date, end\_date, status (7 => 42)]
  
  Message DB Error: unknown error
  Mode 16
  UserInfo UPDATE civicrm\_mailing m INNER JOIN (SELECT MIN(job.start\_date) as start\_date, MAX(job.end\_date) as end\_date, job.mailing\_id FROM civicrm\_mailing\_job job WHERE job.status = "Complete" GROUP BY job.mailing\_id ) as job ON job.mailing\_id = m.id SET m.status = "Complete", start\_date = job.start\_date, end\_date = job.end\_date, is\_completed = 1 WHERE (m.status IS NULL OR m.status = "Draft") AND m.id BETWEEN 7 AND 42 [nativecode=1052 \*\* Column 'start\_date' in field list is ambiguous]
  DebugInfo UPDATE civicrm\_mailing m INNER JOIN (SELECT MIN(job.start\_date) as start\_date, MAX(job.end\_date) as end\_date, job.mailing\_id FROM civicrm\_mailing\_job job WHERE job.status = "Complete" GROUP BY job.mailing\_id ) as job ON job.mailing\_id = m.id SET m.status = "Complete", start\_date = job.start\_date, end\_date = job.end\_date, is\_completed = 1 WHERE (m.status IS NULL OR m.status = "Draft") AND m.id BETWEEN 7 AND 42 [nativecode=1052 \*\* Column 'start\_date' in field list is ambiguous]
  
  Civi\Core\Exception\DBQueryException: DB Error: unknown error in /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 945
  
  * DB\_Error: DB Error: unknown error in unknown on line unknown
  
  [![enter image description here](https://i.sstatic.net/0ksGQpIC.png)](https://i.sstatic.net/0ksGQpIC.png)
  
  It appears that there's a problem with the civicrm\_mailing\_job table. I have upgraded just fine until this release. Any ideas how to fix this so that I can upgrade?
  
  **Tags:** upgrade, error, database
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-08-09. Score: 4 | Accepted answer
  
  **UPDATE**: 5.76.1 is now available for download with the below fix.
  
  ---
  
  Can you change [these two lines](https://github.com/civicrm/civicrm-core/blob/0360234397a3521b276319e63b92ac0e4c5ddfe8/CRM/Upgrade/Incremental/php/FiveSeventySix.php#L252-L253) from
  
  ```
  start_date = job.start_date,
  end_date = job.end_date,
  
  ```
  
  to
  
  ```
  m.start_date = job.start_date,
  m.end_date = job.end_date,
  
  ```
  
  and see if that fixes it.
  
  > **Comments:**
  > **username_2**: I had the same error and this fixed it.  
  > **username_0**: Yes, making this change allowed the upgrade to proceed without error. Thanks for such a quick response! I have marked your comment as the answer  
  > **username_1**: Thanks for the confirmations. Have put up PRs https://github.com/civicrm/civicrm-core/pull/30825 and https://github.com/civicrm/civicrm-core/pull/30826.  
  > **username_3**: Worked for me as well.  Thank you!  
  > **username_4**: It worked here as well. Thanks.  
  
  ---
  
  