Problem/Motivation
Unable to run drush migrate-status, drush migrate-import, etc. on drush 8.0.2 due to error:
Argument 1 passed to Drupal\migrate\Plugin\migrate\source\SqlBase::setUpDatabase() must be of the type array, null given, called in [error]
/xxx/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php on line 93 and
defined SqlBase.php:116
Drush command terminated abnormally due to an unrecoverable error. [error]
Drush 8.0.2 has started to trap error E_RECOVERABLE_ERROR and was not present in 8.0.1 where the commands work. Ref: https://github.com/drush-ops/drush/commit/a0e1f70c4e5b1c897f2952624da93c...
When database_state_key is set in the migration config, but does not exist in state (not sure if it should be/how it gets there), NULL is passed to SqlBase::setUpDatabase() but should be an array.
Relevant part from migrate config:
source:
plugin: d6_file
database_state_key: migrate_upgrade_6
Proposed resolution
Workaround:
./vendor/bin/drush --halt-on-error=0 migrate-status
To fix, an empty array should be passed instead of NULL if $this->state->get() fails.
Remaining tasks
Test to be written.
User interface changes
None.
API changes
None.
Data model changes
None.