Answers.Body: <p>Looks like the issue had to do with my production environment being load-balanced. To avoid errors like these on load balanced sites, remember to set the <a href="https://craftcms.com/docs/config-settings#validationKey" rel="nofollow noreferrer">validationKey</a> and <a href="https://craftcms.com/docs/config-settings#appId" rel="nofollow noreferrer">appId</a> config keys in your general.php file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-11T22:03:29.067Z
Answers.LastActivityDate: 2016-11-11T22:03:29.067Z
Answers.UserDisplayName: Leah Scott
Body: <p>Recently, anytime an update to Craft core or a plugin is attempted on my site that requires a database migration I get an Internal Server Error: Could not validate update handle. Does anyone know what handle Craft is talking about here? Looking for help debugging this issue. My guess is that somewhere in the midst of updates and rollbacks the database got out of sync with the source code. Just need to track down where this faulty handle is.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-03T21:55:25.340Z
Comments.Text: Is this just happening on auto-updates or manual?  Both?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-04T14:50:15.423Z
Comments.Text: Hey Brad. For craft core updates I use auto-update in local development and then push those changes up to dev and prod. I haven't had a problem with the migrations in local or staging, but production triggers the error when I try to start the migration. For plugins, it's a manual update that gets pushed up. So yes, both :(
Comments.UserDisplayName: Leah Scott
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-04T18:47:16.340Z
Comments.Text: Any chance you've got a plugin installed that's listening for update events?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-04T20:11:12.547Z
Comments.Text: Hmmm I'm not sure. Where would I look to check?
Comments.UserDisplayName: Leah Scott
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-04T20:28:01.353Z
Comments.Text: If disabling all plugins isn't an option to test, then search for `onBeginUpdate` in the code and see if any plugins are referencing it.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-04T21:13:41.163Z
Comments.Text: Looks like no plugins are listening for update events. Would you enlighten me as to where this handle Craft mentions is? I can debug much more accurately if I just know what where to look. Where are these plugin handles used in the database?
Comments.UserDisplayName: Leah Scott
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-04T23:22:15.300Z
Comments.Text: `UpdatesService`,`UpdateController`, `Updater` and some update JS files are involved. Updating is an AJAX-y multi-step process that passes data between the steps. the `handle` will either be `craft` or a plugin handle letting the updater know what triggered the update. The values are hashed and decoded/validated to ensure nothing was tampered with between requests. The message you're getting is saying that validation failed on the `handle` variable.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-10T19:12:21.320Z
Comments.Text: Any chance your server setup is in a load-balanced environment?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-11T18:07:53.290Z
Comments.Text: Yes, our servers are load balanced.
Comments.UserDisplayName: Leah Scott
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-11T18:30:49.063Z
Comments.Text: I'm looking at my rollback history and it seems I first noticed the error in production after updating Dukt's OAuth plugin from 2.0.0 to 2.0.1 But I can't for the life of me figure out why the migration for that update was successful in staging but not in production. Staging, however, is not load balanced if that gives you any clues.
Comments.UserDisplayName: Leah Scott
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-11T18:37:55.617Z
Comments.Text: Try setting both https://craftcms.com/docs/config-settings#appId and https://craftcms.com/docs/config-settings#validationKey to consistent values for every server is the cluster.
Comments.UserDisplayName: Brad Bell
Tags: <error><manual-updates>
Title: Update Error: Could not validate update handle
ThreadText: # Update Error: Could not validate update handle
  
  (Asked by: username_0 on 2016-11-03)
  
  Recently, anytime an update to Craft core or a plugin is attempted on my site that requires a database migration I get an Internal Server Error: Could not validate update handle. Does anyone know what handle Craft is talking about here? Looking for help debugging this issue. My guess is that somewhere in the midst of updates and rollbacks the database got out of sync with the source code. Just need to track down where this faulty handle is.
  
  **Tags:** error, manual-updates
  
  > **Comments:**
  > **username_1**: Is this just happening on auto-updates or manual?  Both?  
  > **username_0**: Hey username_1. For craft core updates I use auto-update in local development and then push those changes up to dev and prod. I haven't had a problem with the migrations in local or staging, but production triggers the error when I try to start the migration. For plugins, it's a manual update that gets pushed up. So yes, both :(  
  > **username_1**: Any chance you've got a plugin installed that's listening for update events?  
  > **username_0**: Hmmm I'm not sure. Where would I look to check?  
  > **username_1**: If disabling all plugins isn't an option to test, then search for `onBeginUpdate` in the code and see if any plugins are referencing it.  
  > **username_0**: Looks like no plugins are listening for update events. Would you enlighten me as to where this handle Craft mentions is? I can debug much more accurately if I just know what where to look. Where are these plugin handles used in the database?  
  > **username_1**: `UpdatesService`,`UpdateController`, `Updater` and some update JS files are involved. Updating is an AJAX-y multi-step process that passes data between the steps. the `handle` will either be `craft` or a plugin handle letting the updater know what triggered the update. The values are hashed and decoded/validated to ensure nothing was tampered with between requests. The message you're getting is saying that validation failed on the `handle` variable.  
  > **username_1**: Any chance your server setup is in a load-balanced environment?  
  > **username_0**: Yes, our servers are load balanced.  
  > **username_0**: I'm looking at my rollback history and it seems I first noticed the error in production after updating Dukt's OAuth plugin from 2.0.0 to 2.0.1 But I can't for the life of me figure out why the migration for that update was successful in staging but not in production. Staging, however, is not load balanced if that gives you any clues.  
  > **username_1**: Try setting both https://craftcms.com/docs/config-settings#appId and https://craftcms.com/docs/config-settings#validationKey to consistent values for every server is the cluster.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-11-11. Score: 2 | Accepted answer
  
  Looks like the issue had to do with my production environment being load-balanced. To avoid errors like these on load balanced sites, remember to set the [validationKey](https://craftcms.com/docs/config-settings#validationKey) and [appId](https://craftcms.com/docs/config-settings#appId) config keys in your general.php file.
  
  
  ---
  
  