In my way to build a custom migration from D7 to D8, at one point i needed to change the name of a destination content type i already created and migrated on the new d8, let say from old_ct to new_ct.
So i rolledback my old_ct migration, i cloned old_ct to new_ct, updated my migration files to reflect the new type destination and reinstalled my module.
But since i had an error on any drush migrate command i ran :
Error: Call to a member function getSetting() on null in public_html/web/core/modules/migrate_drupal/src/Plugin/migrate/EntityReferenceTranslationDeriver.php on line 105 #0 public_html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\migrate_drupal\Plugin\migrate\EntityReferenceTranslationDeriver->getDerivativeDefinitions(Array)
#1 public_html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#2 public_html/web/core/modules/migrate/src/Plugin/MigrationPluginManager.php(262): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#3 public_html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\migrate\Plugin\MigrationPluginManager->findDefinitions()
#4 public_html/web/core/modules/migrate/src/Plugin/MigrationPluginManager.php(155): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#5 public_html/web/core/modules/migrate/src/Plugin/MigrationPluginManager.php(114): Drupal\migrate\Plugin\MigrationPluginManager->expandPluginIds(Array)
#6 public_html/web/core/modules/migrate/src/Plugin/MigrationPluginManager.php(100): Drupal\migrate\Plugin\MigrationPluginManager->createInstances(Array, Array)
#7 public_html/web/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php(498): Drupal\migrate\Plugin\MigrationPluginManager->createInstance('')
#8 [internal function]: Drupal\migrate_tools\Commands\MigrateToolsCommands->resetStatus('', Array)
#9 public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#10 public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#11 public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#12 public_html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 public_html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 public_html/vendor/symfony/console/Application.php(971): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 public_html/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 public_html/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 public_html/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 public_html/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#19 public_html/vendor/drush/drush/drush.php(66): Drush\Runtime\Runtime->run(Array)
#20 public_html/vendor/drush/drush/includes/preflight.inc(17): require('/var/www/html/d...')
#21 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main()
#22 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#23 {main}
Error: Call to a member function getSetting() on null in Drupal\migrate_drupal\Plugin\migrate\EntityReferenceTranslationDeriver->getDerivativeDefinitions() (line 105 of public_html/web/core/modules/migrate_drupal/src/Plugin/migrate/EntityReferenceTranslationDeriver.php).
[error] Drush command terminated abnormally due to an unrecoverable error.
apparently it is looking for a field in an entity which is not existing anymore, looks like migrate didn't fully "understand" that my old CT does not exists anymore.
so far the only way i found to get any migration command work again is in the attached patch
i not sure if it's a bug or if i screwed up somewhere