Answers.Body: <p>I would recommend you grab this file <a href="https://github.com/civicrm/civicrm-core/blob/4.6/CRM/Upgrade/Incremental/sql/4.6.21.mysql.tpl" rel="nofollow">https://github.com/civicrm/civicrm-core/blob/4.6/CRM/Upgrade/Incremental/sql/4.6.21.mysql.tpl</a> and then save it into same path within your civicrm dir i.e. in CRM/Upgrade/Incremental/sql/</p>
  
  <p>Once you have done that re-load your pre-upgrade database and run the upgrade again. </p>
  
  <p>Should be all good then</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-09T04:43:48.733Z
Answers.LastActivityDate: 2016-09-09T04:49:06.187Z
Answers.LastEditDate: 2016-09-09T04:49:06.187Z
Answers.UserDisplayName: Seamus Lee
Answers.Body: <p>Looking at the source code for the processSQL function in CRM_Upgrade_Form, I can see that it works like this:</p>
  
  <ul>
  <li>Given a revision (in this case, <code>4.6.21</code>), it looks for <code>Incremental/sql/4.6.21.mysql.tpl</code>.</li>
  <li>If that file is NOT found, it looks for <code>Incremental/sql/4.6.21.mysql</code>.  </li>
  <li>If it finds neither, it returns the error you saw.</li>
  </ul>
  
  <p>Here's what you can try:
  * Please check the file owner/permissions of this file to ensure it can be read by your web server user.
  * Ensure it's looking for the right file in the right place.  Try putting this line into <code>CRM/Upgrade/Form.php</code> at line 426:</p>
  
  <pre><code>CRM_Core_Error::debug_var("tplFile", $tplFile);
  </code></pre>
  
  <p>Then, on upgrade, watch your debug logs (usually at <code>&lt;drupalroot&gt;/sites/default/civicrm/ConfigAndLog</code>) to see the value of <code>tplFile</code>.  Please update your question if it seems to be looking for the wrong file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-08T14:11:47.913Z
Answers.LastActivityDate: 2016-11-08T14:11:47.913Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>We're using D7 / Civi 4.6.20, attempted to upgrade to 4.6.21 following the Civi upgrade documentation.  The upgrade errors out with this error:</p>
  
  <p>Exception: "A fatal error was triggered: sqlfile - 4.6.21.mysql not found."</p>
  
  <p>I tried reloading my pre-upgrade database and repeating, but got the same error.</p>
  
  <p>Backtrace:</p>
  
  <pre><code>#0 SITEROOT/sites/all/modules/civicrm/CRM/Upgrade/Form.php(432): CRM_Core_Error::fatal("sqlfile - 4.6.21.mysql not found.")
  #1 SITEROOT/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourSix.php(86): CRM_Upgrade_Form-&gt;processSQL("4.6.21")
  #2 [internal function](): CRM_Upgrade_Incremental_php_FourSix::task_4_6_x_runSql(Object(CRM_Queue_TaskContext), "4.6.21")
  #3 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Task.php(88): call_user_func_array((Array:2), (Array:2))
  #4 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Runner.php(214): CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))
  #5 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php(52): CRM_Queue_Runner-&gt;runNext(TRUE)
  #6 SITEROOT/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php(106): {closure}()
  #7 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php(54): CRM_Queue_ErrorPolicy-&gt;call(Object(Closure))
  #8 [internal function](): CRM_Queue_Page_AJAX::runNext()
  #9 SITEROOT/sites/all/modules/civicrm/CRM/Core/Invoke.php(278): call_user_func((Array:2))
  #10 SITEROOT/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
  #11 SITEROOT/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:5))
  #12 SITEROOT/sites/all/modules/civicrm/drupal/civicrm.module(482): CRM_Core_Invoke::invoke((Array:5))
  #13 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
  #14 SITEROOT/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
  #15 SITEROOT/index.php(21): menu_execute_active_handler()
  #16 {main}
  </code></pre>
  
  <p>I searched and couldn't find a file called 4.6.21.mysql but I did find /sites/all/modules/civicrm/CRM/Upgrade/Incremental/sql/4.6.21.mysql.tpl.</p>
  
  <p>Any advice?  Thanks in advance!</p>
  
Tags: <upgrade><mysql>
Title: Upgrade from 4.6.20 to 4.6.21 fails with fatal error (sqlfile not found)
ThreadText: # Upgrade from 4.6.20 to 4.6.21 fails with fatal error (sqlfile not found)
  
  (Asked by: username_0 on 2016-09-09)
  
  We're using D7 / Civi 4.6.20, attempted to upgrade to 4.6.21 following the Civi upgrade documentation.  The upgrade errors out with this error:
  Exception: "A fatal error was triggered: sqlfile - 4.6.21.mysql not found."
  I tried reloading my pre-upgrade database and repeating, but got the same error.
  Backtrace:
  #0 SITEROOT/sites/all/modules/civicrm/CRM/Upgrade/Form.php(432): CRM_Core_Error::fatal("sqlfile - 4.6.21.mysql not found.")
  #1 SITEROOT/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourSix.php(86): CRM_Upgrade_Form->processSQL("4.6.21")
  #2 [internal function](): CRM_Upgrade_Incremental_php_FourSix::task_4_6_x_runSql(Object(CRM_Queue_TaskContext), "4.6.21")
  #3 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Task.php(88): call_user_func_array((Array:2), (Array:2))
  #4 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Runner.php(214): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
  #5 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php(52): CRM_Queue_Runner->runNext(TRUE)
  #6 SITEROOT/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php(106): {closure}()
  #7 SITEROOT/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php(54): CRM_Queue_ErrorPolicy->call(Object(Closure))
  #8 [internal function](): CRM_Queue_Page_AJAX::runNext()
  #9 SITEROOT/sites/all/modules/civicrm/CRM/Core/Invoke.php(278): call_user_func((Array:2))
  #10 SITEROOT/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
  #11 SITEROOT/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:5))
  #12 SITEROOT/sites/all/modules/civicrm/drupal/civicrm.module(482): CRM_Core_Invoke::invoke((Array:5))
  #13 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
  #14 SITEROOT/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
  #15 SITEROOT/index.php(21): menu_execute_active_handler()
  #16 {main}
  
  I searched and couldn't find a file called 4.6.21.mysql but I did find /sites/all/modules/civicrm/CRM/Upgrade/Incremental/sql/4.6.21.mysql.tpl.
  Any advice?  Thanks in advance!
  
  **Tags:** upgrade, mysql
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-09-09. Score: 1
  
  I would recommend you grab this file <https://github.com/civicrm/civicrm-core/blob/4.6/CRM/Upgrade/Incremental/sql/4.6.21.mysql.tpl> and then save it into same path within your civicrm dir i.e. in CRM/Upgrade/Incremental/sql/
  
  Once you have done that re-load your pre-upgrade database and run the upgrade again.
  
  Should be all good then
  
  
  ---
  
  ### Answer by username_2 on 2016-11-08. Score: 0
  
  Looking at the source code for the processSQL function in CRM_Upgrade_Form, I can see that it works like this:
  
  Given a revision (in this case, 4.6.21), it looks for Incremental/sql/4.6.21.mysql.tpl.
  If that file is NOT found, it looks for Incremental/sql/4.6.21.mysql.  
  If it finds neither, it returns the error you saw.
  
  Here's what you can try:
  * Please check the file owner/permissions of this file to ensure it can be read by your web server user.
  * Ensure it's looking for the right file in the right place.  Try putting this line into CRM/Upgrade/Form.php at line 426:
  CRM_Core_Error::debug_var("tplFile", $tplFile);
  
  Then, on upgrade, watch your debug logs (usually at /sites/default/civicrm/ConfigAndLog) to see the value of tplFile.  Please update your question if it seems to be looking for the wrong file.
  
  
  ---
  
  