Upgrade from 4.7.27 to 5.4.0 failed on activity_default_assignee (also 5.3.2 failed on Monmouthshire)
Trying to upgrade a test site from 4.7.27 using drush cvupdb. D7, PHP 5.6.36, MySQL 5.5.60 . Cleared templates_c/en_* before upgrading.
4.7.27 to 5.4.0 fails with:
CiviCRM_API3_Exception: "'activity_default_assignee' is not a valid option for field option_group_id"
#0 .../sites/all/modules/civicrm/CRM/Core/BAO/OptionValue.php(560): civicrm_api3("OptionValue", "get", (Array:4))
#1 .../sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FiveFour.php(108): CRM_Core_BAO_OptionValue::ensureOptionValueExists((Array:5))
#2 [internal function](): CRM_Upgrade_Incremental_php_FiveFour::addActivityDefaultAssigneeOptions(Object(CRM_Queue_TaskContext))
#3 .../sites/all/modules/civicrm/CRM/Queue/Task.php(88): call_user_func_array((Array:2), (Array:1))
1:31 PM
version in civicrm_domain at this point is 5.4.alpha1.upgrade . I re-tried, dropping db & restoring from pre-upgrade dump, same result.
Also a less serious issue, as presumed due to someone manually adding Monmouthshire to db in the past... 4.7.27 to 5.3.2 fails with:
PEAR_Exception: "DB Error: already exists"
* ERROR TYPE: DB_Error
* ERROR CODE: -5
* ERROR MESSAGE: DB Error: already exists
* ERROR MODE: 16
* ERROR USERINFO: INSERT INTO civicrm_state_province (country_id, abbreviation, name)
VALUES (@UKCountryId, 'MON', 'Monmouthshire') [nativecode=1062 ** Duplicate entry 'Monmouthshire-1226' for key 'UI_name_country_id']
* ERROR DEBUGINFO: INSERT INTO civicrm_state_province (country_id, abbreviation, name)
VALUES (@UKCountryId, 'MON', 'Monmouthshire') [nativecode=1062 ** Duplicate entry 'Monmouthshire-1226' for key 'UI_name_country_id']
#0 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#1 .../sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#2 .../sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO civicrm_state_province (country_id, abbreviation, name)\nVALUES (...")
version in civicrm_domain is 5.3.0.upgrade at this point.
I suspect Monmouthshire had previously been added manually. Resolved by manually removing it, setting the existing address records using it to state_province_id NULL, then to the new id.
Then tried 5.3.2 to 5.4.0 and it worked.