diff --git a/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php
index e8316e4..8a593f2 100644
--- a/core/modules/migrate/src/MigrateExecutable.php
+++ b/core/modules/migrate/src/MigrateExecutable.php
@@ -96,7 +96,7 @@ class MigrateExecutable implements MigrateExecutableInterface {
    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
    *   The migration to run.
    * @param \Drupal\migrate\MigrateMessageInterface $message
-   *   The message to record.
+   *   The migrate message service.
    * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
    *   The event dispatcher.
    *
diff --git a/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php b/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php
index 7ba0168..ad57a80 100644
--- a/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php
+++ b/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php
@@ -268,10 +268,10 @@ public function destroy();
   public function getQualifiedMapTableName();
 
   /**
-   * Sets the migrate message.
+   * Sets the migrate message service.
    *
    * @param \Drupal\migrate\MigrateMessageInterface $message
-   *   The message to display.
+   *   The migrate message service.
    */
   public function setMessage(MigrateMessageInterface $message);
 
diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
index 27b7569..6bdd51e 100644
--- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
+++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
@@ -6,6 +6,7 @@
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Plugin\PluginBase;
+use Drupal\migrate\MigrateMessage;
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\migrate\Event\MigrateIdMapMessageEvent;
 use Drupal\migrate\MigrateException;
@@ -55,7 +56,7 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP
   protected $messageTableName;
 
   /**
-   * The migrate message.
+   * The migrate message service.
    *
    * @var \Drupal\migrate\MigrateMessageInterface
    */
@@ -156,6 +157,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->migration = $migration;
     $this->eventDispatcher = $event_dispatcher;
+    $this->message = new MigrateMessage();
   }
 
   /**
diff --git a/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php b/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php
index 835fd69..cbe333b 100644
--- a/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php
+++ b/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php
@@ -3,6 +3,7 @@
 namespace Drupal\migrate\Plugin\migrate\process;
 
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\migrate\MigrateMessage;
 use Drupal\migrate\MigrateSkipProcessException;
 use Drupal\migrate\Plugin\MigratePluginManagerInterface;
 use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
@@ -222,15 +223,16 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
       // Do a normal migration with the stub row.
       $migrate_executable->processRow($stub_row, $process);
       $destination_ids = [];
+      $id_map = $migration->getIdMap();
       try {
         $destination_ids = $destination_plugin->import($stub_row);
       }
       catch (\Exception $e) {
-        $migration->getIdMap()->saveMessage($stub_row->getSourceIdValues(), $e->getMessage());
+        $id_map->saveMessage($stub_row->getSourceIdValues(), $e->getMessage());
       }
 
       if ($destination_ids) {
-        $migration->getIdMap()->saveIdMapping($stub_row, $destination_ids, MigrateIdMapInterface::STATUS_NEEDS_UPDATE);
+        $id_map->saveIdMapping($stub_row, $destination_ids, MigrateIdMapInterface::STATUS_NEEDS_UPDATE);
       }
     }
     if ($destination_ids) {
diff --git a/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php b/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
index f30c184..dd18928 100644
--- a/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
@@ -199,4 +199,43 @@ public function successfulLookupDataProvider() {
     ];
   }
 
+  /**
+   * Tests that a message is successfully created if import fails.
+   */
+  public function testImportException() {
+    $migration_plugin = $this->prophesize(MigrationInterface::class);
+    $migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
+    $process_plugin_manager = $this->prophesize(MigratePluginManager::class);
+
+    $destination_id_map = $this->prophesize(MigrateIdMapInterface::class);
+    $destination_migration = $this->prophesize('Drupal\migrate\Plugin\Migration');
+    $destination_migration->getIdMap()->willReturn($destination_id_map->reveal());
+    $migration_plugin_manager->createInstances(['destination_migration'])
+      ->willReturn(['destination_migration' => $destination_migration->reveal()]);
+    $destination_id_map->lookupDestinationId([1])->willReturn(NULL);
+    $destination_id_map->saveMessage(Argument::any(), Argument::any())->willReturn(NULL);
+    $destination_id_map->saveIdMapping(Argument::any(), Argument::any(), Argument::any())->shouldNotBeCalled();
+
+    $configuration = [
+      'no_stub' => FALSE,
+      'migration' => 'destination_migration',
+    ];
+
+    $destination_migration->id()->willReturn('destination_migration');
+    $destination_migration->getDestinationPlugin(TRUE)->shouldBeCalled();
+    $destination_migration->getProcess()->willReturn([]);
+    $destination_migration->getSourceConfiguration()->willReturn([]);
+
+    $source_plugin = $this->prophesize(MigrateSourceInterface::class);
+    $source_plugin->getIds()->willReturn(['nid']);
+    $destination_migration->getSourcePlugin()->willReturn($source_plugin->reveal());
+    $destination_plugin = $this->prophesize(MigrateDestinationInterface::class);
+    $e = new \Exception();
+    $destination_plugin->import(Argument::any())->willThrow($e);
+    $destination_migration->getDestinationPlugin(TRUE)->willReturn($destination_plugin->reveal());
+
+    $migration = new MigrationLookup($configuration, '', [], $migration_plugin->reveal(), $migration_plugin_manager->reveal(), $process_plugin_manager->reveal());
+    $migration->transform(1, $this->migrateExecutable, $this->row, '');
+  }
+
 }
