<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>

CC BY-SA 3.0
2016-11-11T22:03:29.067Z
2016-11-11T22:03:29.067Z
Leah Scott
<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>

CC BY-SA 3.0
2016-11-03T21:55:25.340Z
Is this just happening on auto-updates or manual?  Both?
Brad Bell
CC BY-SA 3.0
2016-11-04T14:50:15.423Z
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 :(
Leah Scott
CC BY-SA 3.0
2016-11-04T18:47:16.340Z
Any chance you've got a plugin installed that's listening for update events?
Brad Bell
CC BY-SA 3.0
2016-11-04T20:11:12.547Z
Hmmm I'm not sure. Where would I look to check?
Leah Scott
CC BY-SA 3.0
2016-11-04T20:28:01.353Z
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.
Brad Bell
CC BY-SA 3.0
2016-11-04T21:13:41.163Z
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?
Leah Scott
CC BY-SA 3.0
2016-11-04T23:22:15.300Z
`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.
Brad Bell
CC BY-SA 3.0
2016-11-10T19:12:21.320Z
Any chance your server setup is in a load-balanced environment?
Brad Bell
CC BY-SA 3.0
2016-11-11T18:07:53.290Z
Yes, our servers are load balanced.
Leah Scott
CC BY-SA 3.0
2016-11-11T18:30:49.063Z
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.
Leah Scott
CC BY-SA 3.0
2016-11-11T18:37:55.617Z
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.
Brad Bell
<error><manual-updates>
Update Error: Could not validate update handle
# 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 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 :(  
> **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.


---

